[R] Display data by condition

Rui Barradas ruipbarradas at sapo.pt
Thu Mar 16 18:47:20 CET 2017


Hello,

Maybe you're missing a comma. (I'm assuming your dataset is a data.frame 
or a matrix.)
Try

View(data[data$fact>5000, ])

To give you a better answer you need to show us the output of

str(data)

And don't name your data 'data', it already is the name of an R function.
And post in plain text, not HTML.

Hope this helps,

Rui Barradas

Em 16-03-2017 15:16, Juan Ceccarelli Arias escreveu:
> Hello,
> I need to show the observations of a data set only if the earn more than
> $5000 (fact is its name in the date set). I use this:
>
> View(data[data$fact>5000])
>
> The code above shows nothing. No error or message at all.
> What am i doing wrong?
> Thanks for your help and time.
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list