r - store rows of a data.frame are equal to top.20. in frequens from column as factor i.e names -
data.fr (d1.csv) looks like this:
Weight 23 170 60 Judo 33 193 125 Athletics
Let me introduce a new data like D2 with the top 20. Frame will be created
name (top 20. source) [1] "athletics" "swimming" "football" "rowing"
... and Use it to use match ()
or % in%
subset ()
such as D1 with subset = game %% names (top .20.sports)
I have tried many things, I'm new on this and I'm missing something ...
d2 < -subset (d1, (% in game% name (above .20.sports)))
returns a hole list, like
d2 and lt ; - d1 [d1 $ Sport% name matches
match me "NA"
d2 < -d1 [, tolower (name) gives a bunch (name) (top.20.sports)) in% d1 [, 4]] with dataframe 0 colomon and 9038 rows
< P> (9038 rows are the right bud where the data is?) < P> I sleep Was that I have 10,384 rows
-10384 24 221 110 Basketball -
basketball in the final. Number of lines in the row is not the number of rows:
nrow (d2)
[1] 800 9
Dim (D2)
[1] 800 9 4
Comments
Post a Comment