Hello Everyone, I would like to know if I can call one of the columns of a list, to use it as a variable in a function. Thanks in advance for any advice! Jana -- Jana Makedonska, B.Sc. Biology, Universite Paul Sabatier Toulouse III M.Sc. Paleontology, Paleobiology and Phylogeny, Universite de Montpellier II Ph.D. candidate in Physical Anthropology and Part-time lecturer Department of Anthropology College of Arts & Sciences State University of New York at Albany 1400 Washington Avenue 12222 Albany, NY Office phone: 518-442-4699 http://electricsongs.academia.edu/JanaMakedonska http://www.youtube.com/watch?v=OHbT9VvtonM<http://www.youtube.com/watch?v=jRoMoLjzpf4&list=PL5BF6ACDCC2E4AAA0&index=7> [[alternative HTML version deleted]]
If you are using the list as simply a collection of data frames a simple example to accomplish what you are describing is this: data(iris) data(mtcars) y=list(iris, mtcars) #return Sepal.Length column from first data frame in list #list[[number of list component]][number of column] y[[1]][1] Cheers, On Thu, Apr 25, 2013 at 7:24 PM, Jana Makedonska <jmakedonska@gmail.com>wrote:> Hello Everyone, > > I would like to know if I can call one of the columns of a list, to use it > as a variable in a function. > > Thanks in advance for any advice! > > Jana > > -- > > Jana Makedonska, > B.Sc. Biology, Universite Paul Sabatier Toulouse III > M.Sc. Paleontology, Paleobiology and Phylogeny, Universite de Montpellier > II > Ph.D. candidate in Physical Anthropology and Part-time lecturer > Department of Anthropology > College of Arts & Sciences > State University of New York at Albany > 1400 Washington Avenue > 12222 Albany, NY > Office phone: 518-442-4699 > http://electricsongs.academia.edu/JanaMakedonska > http://www.youtube.com/watch?v=OHbT9VvtonM< > http://www.youtube.com/watch?v=jRoMoLjzpf4&list=PL5BF6ACDCC2E4AAA0&index=7 > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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. >-- Charles Determan Integrated Biosciences PhD Student University of Minnesota [[alternative HTML version deleted]]
Please read "An Introduction to R" or other basic R tutorial to learn basic R operations before posting. Please read the posting guide (link at bottom) or other similar online guides for how to post a coherent question that will elicit an accurate and helpful answer. -- Bert On Thu, Apr 25, 2013 at 5:24 PM, Jana Makedonska <jmakedonska at gmail.com> wrote:> Hello Everyone, > > I would like to know if I can call one of the columns of a list, to use it > as a variable in a function. > > Thanks in advance for any advice! > > Jana > > -- > > Jana Makedonska, > B.Sc. Biology, Universite Paul Sabatier Toulouse III > M.Sc. Paleontology, Paleobiology and Phylogeny, Universite de Montpellier II > Ph.D. candidate in Physical Anthropology and Part-time lecturer > Department of Anthropology > College of Arts & Sciences > State University of New York at Albany > 1400 Washington Avenue > 12222 Albany, NY > Office phone: 518-442-4699 > http://electricsongs.academia.edu/JanaMakedonska > http://www.youtube.com/watch?v=OHbT9VvtonM<http://www.youtube.com/watch?v=jRoMoLjzpf4&list=PL5BF6ACDCC2E4AAA0&index=7> > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.-- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm