| To: | "Data Analytics Corp." <dataanalytics@earthlink.net> |
|---|---|
| Subject: | Re: Processing a list |
| From: | David L Lorenz <lorenz@usgs.gov> |
| Date: | Mon, 24 Sep 2007 07:36:46 -0500 |
| Cc: | s-news@lists.biostat.wustl.edu, s-news-owner@lists.biostat.wustl.edu |
| In-reply-to: | <46F549D6.20905@earthlink.net> |
|
Walt, You need to pass the object to describe, not just the name. Try this lapply(x, function(y) describe(get(y))) Dave
Hi, I have 100 data frames for a project, each data frame beginning with the word "data" followed by a word for the data itself. I'd like to write a function to loop through each data frame and apply the describe function from the HMISC library. I created a list using x <- as.list(objects(pattern = "data*")) which returns a list with 100 elements, each of which is the data frame name as a character. Then I did lapply(x, describe) and got garbage. I think the issue is that x contains character strings which a function cannot use as the name of an object. How do I tell S+ to treat each character string in the list x as a data frame name which could then be read by describe? I'm using s+8.0 if that matters. Thanks, Walt Paczkowski -------------------------------------------------------------------- This message was distributed by s-news@lists.biostat.wustl.edu. To unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with the BODY of the message: unsubscribe s-news |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | fixed effects estimates, Ana Maria Adalid Martinez |
|---|---|
| Next by Date: | Announcement: 2008 ASA Computing/Graphics Student Paper Competition, J.R. Lockwood |
| Previous by Thread: | Processing a list, Data Analytics Corp. |
| Next by Thread: | fixed effects estimates, Ana Maria Adalid Martinez |
| Indexes: | [Date] [Thread] [Top] [All Lists] |