Re: [R] Trouble Combining With Paste

2011-05-25 Thread Phil Spector
John - Try infert[,toolong] = sapply(infert[,toolong],cut2,g=10,levels.mean=TRUE) - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Trouble Combining With Paste

2011-05-25 Thread Sarah Goslee
You need to use get() so that you are acting on the dataframe, and not the string that names the dataframe. Sarah On Wed, May 25, 2011 at 12:02 PM, Sparks, John James wrote: > Dear R Helpers, > > I am having trouble combining some pieces of programming that work fine > individually, but fall dow

Re: [R] Trouble Combining With Paste

2011-05-25 Thread Joshua Wiley
Hi John, The issue is that: "infert$age" != infert$age One is a text string, the other references the information stored in the age variable of the infert object. If you need to pass the names as a string, use "[" instead: ## for a data frame infert[, "age"] ## for a list infert[["age"]] It l

[R] Trouble Combining With Paste

2011-05-25 Thread Sparks, John James
Dear R Helpers, I am having trouble combining some pieces of programming that work fine individually, but fall down when I try to get them to work together. The end goal is to take a data frame, and if any of the variables has more than 10 values, then use cut2 to reduce the number of (effective)