[R] SOLVED, Re: lists everywhere
Kehl Dániel
kehld at ktk.pte.hu
Mon Dec 5 20:36:09 CET 2011
nevermind, typo (and some gray hair)
sorry
12/5/2011 8:21 PM keltezéssel, Kehl Dániel írta:
> 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
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
More information about the R-help
mailing list