Re: [R] Loops (run the same function per different columns)

2014-04-25 Thread CRoa
Hi Arun, Thanks a lot for your script. Ill work on it tomorrow. Cheers On 24/04/2014, at 11:54 AM, "arun kirshna [via R]" wrote: > HI, > I guess you got an output like this using my script: > ##Please use ?dput() to show the example data. > > FA <- structure(list(Sample = c("L1 Control",

Re: [R] Loops (run the same function per different columns)

2014-04-23 Thread CRoa
Hi Arun, Your script works but it does not do what I was after. To be a bit more specific, this the table FA in which Im working on ( but the original one has 34 fatty acids instead of 3: C14.0, C15.0, and C15.1). SampleC14:0C15:0C15:1 L1 Control0.4565091920.4695626870.774909216 L1 Control0.51398

Re: [R] Loops (run the same function per different columns)

2014-04-23 Thread arun
HI, I guess you got an output like this using my script: ##Please use ?dput() to show the example data. FA <- structure(list(Sample = c("L1 Control", "L1 Control", "L1 Control", "BBM Control", "BBM Control", "BBM Control", "L1 Ash", "L1 Ash", "L1 Ash", "BBM Ash", "BBM Ash", "BBM Ash"), C14.0 = c

Re: [R] Loops (run the same function per different columns)

2014-04-21 Thread CRoa
Thank you Arun for your quick answer. Ill try it and ill let you know. Cheers On 21/04/2014, at 11:30 PM, "arun kirshna [via R]" wrote: > Hi, > > Using the example data from library(gvlma) > > library(gvlma) > data(CarMileageData) > CarMileageNew <- CarMileageData[,c(5,6,3)] > lst1 <-

Re: [R] Loops (run the same function per different columns)

2014-04-21 Thread arun
Hi, Using the example data from library(gvlma) library(gvlma) data(CarMileageData) CarMileageNew <- CarMileageData[,c(5,6,3)]  lst1 <- list()  y <- c("NumGallons", "NumDaysBetw")  for(i in seq_along(y)){  lst1[[i]] <- gvlma(lm(get(y[i])~MilesLastFill,data=CarMileageNew))  lst1} pdf("gvlmaplot.pdf