[R] lists everywhere
Kehl Dániel
kehld at ktk.pte.hu
Mon Dec 5 20:21:20 CET 2011
Dear list members,
I have a really simple problem.
I connected to a DB and have the following query
adat <- dbGetQuery(con, paste("select * from kmdata where SzeAZ='",
szeazok[i], "' order by datum", sep=""))
now I have the data in the adat variable which is a list. In fact the
elements of the list are lists as well
> is.list(adat)
[1] TRUE
> is.list(adat[10])
[1] TRUE
> is.list(adat[[10]])
[1] FALSE
> is.vector(adat[[10]])
[1] TRUE
I simply want to use a function with sapply on the 13-76th columns of
the original list.
sapply(data[[13:76]], myfunc) does not work of course. I tried to define
13:76 in a vector, still no result.
How is it possible?
thanks a lot
d
More information about the R-help
mailing list