OK, couldn't find a better title
Let's say I have my_dataframe:
Name Value1 Value2
AA 10 20
BB 15 30
if I do:
nrow(my_dataframe[my_dataframe$Value2>20,]
I get '1' as result
I want to create my_second_dataframe, such as there's only column 'Value2':
my_second_dataframe<- my_dataframe[,'Value2', drop=FALSE]
let me check it out:
class(my_second_dataframe)
[1] "data.frame"
class(my_second_dataframe$Value2)
[1] "numeric"
but then:
nrow(my_second_dataframe[my_second_dataframe$Value2>20,]
NULL
????? This would be part of a function, in which I want to isolate a column of choice and also get number of rows of that column based on a threshold number. What am I doing wrong?
Thanks