R List row name -
i have (one column) list called test in r.
when view in r this:
> test value 569 n 1012 y 4279 n 7588 n 3434 n 2408 y 1958 y 1251 y how reference "row name"? i.e. 569, 1012, 4279 etc.
i want find example value @ "row" 1012 (which "y" here). i've tried using test[1], test[,1] etc. first column isn't column. don't know is. makes kind of sense. don't know find solution this.
if test is data frame;
txt <- " value 569 n 1012 y 4279 n 7588 n 3434 n 2408 y 1958 y 1251 y " test <- read.table(textconnection(txt), header = true) then,
> test["1012", ] [1] y levels: n y will extract required row.
Comments
Post a Comment