简体   繁体   English

如何获取有关已识别点的信息并将其排除在R中的下一个图中

[英]How to get information about identified point and exclude it in next plot in R

i've got problem with identify() . 我有identify()问题。

I have something like this 我有类似的东西

library (UsingR)
df=data.frame(emissions)
plot (df)
getPoint=identify(df)

And I have to exclude the point that is too far away from correct observation group. 我必须排除距正确观察组太远的观点。

How can I take this uncorrect point save it, exclude it, and get the correct frame in next plotting without saved point? 如何保存这个不正确的点,将其排除,并在下一个绘图中获得正确的帧而不保存点?

First off I tried using identify on a data frame plot- it doesn't seem to work so instead I did one comparison- GDP vs perCapita: 首先,我尝试在数据框图上使用identify它似乎不起作用,所以我做了一个比较 - GDP与perCapita:

plot(df$GDP,df$perCapita)
getPoint=identify(df$GDP,df$perCapita)

I then picked a few points on the plot and then pressed 'ESC' 然后我在情节上选了几个点,然后按'ESC'

getPoint returns the number of the row of the points that I picked. getPoint返回我选择的点的行数。 I can then omit or select these points: 然后我可以省略或选择以下几点:

df[getPoint,] #select picked data points
df[-getPoint,] #exclude picked data points

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM