r - Error selecting columns in dataframe -
this easy question still not able figure out i'm wrong.
i have following dataframe
data3 <- structure(list(p1 = c("david skoch", "viktor troicki", "peter luczak", "simon stadler", "philipp petzschner", "jamie murray", "michal mertinak", "igor kunitsyn", "daniel munoz de la nava", "alexandre sidorenko"), p2 = c("lovro zovko", "dmitri sitak", "martin vassallo arguello", "sebastien de chaunac", "n.sriram balaji", "jaroslav levinsky", "stephen amritraj", "wesley moodie", "andrey golubev", "nicolas tourte"), date = structure(c(1167618386.44068, 1167619381.13208, 1167622892.30769, 1167626322.58065, 1167627172.88136, 1167629162.26415, 1167635959.32203, 1167636184.61538, 1167638943.39623, 1167643045.16129), tzone = "utc", class = c("posixct","posixt")), factor = c(0.82, 1.28, 1.37, 1.37, 1.28, 1.28, 1.46, 0.73, 1.82, 1.55), weight = c(1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1)), .names = c("p1", "p2", "date", "factor", "weight"), class = c("data.table", "data.frame"), row.names = c(na, -10l))
which trying subset with:
data3[,c("weight","date","factor")]
that unfortunately gives following result:
[1] "weight" "date" "factor"
instead of selecting dataframe specified columns.
any hint?
we need use with = false
data.table
.
data3[,c("weight","date","factor"), = false]
Comments
Post a Comment