[R] converting numeric into character strings

2009-05-13 Thread Melissa2k9
Hi, Im trying to put some numbers into a dataframe , I have a list of numbers (change points in a time series) like such [1] 2 11 12 20 21 98 99 but I want R to recognise this as just a character string so it will put it in one row and column, ideally I want them seperated by commas so I would

[R] turning list into vector/dataframe

2009-04-10 Thread Melissa2k9
Hi, I have used this command : resamples<-lapply(1:1000,function(i) sample(lambs,replace=F)) resamples2<-lapply(resamples,Cusum) to get a list of 1000 samples of my data. The function Cumsum is defined as follows: Cusum<-function(x){ SUM<-cumsum(x)-(1:length(x))*mean(x) min<-min(cumsum(x)-(1:l

[R] Sequences

2009-04-07 Thread Melissa2k9
Hi, I am trying to make a sequence and am using a for loop for this. I want to start off with an initial value ie S[0]=0 then use the loop to create other values. This is what I have so far but I just keep getting error messages. #To calculate the culmulative sums: s<-rep(0,207)

Re: [R] for loop for extracting linear model info

2009-04-04 Thread Melissa2k9
Uwe Ligges-3 wrote: > > > > Melissa2k9 wrote: >> Hi, >> >> I have written a for loop as such: >> >> model<-lm(Normalised~Frame,data=All,subset=((Subject==1)&(Filmclip=="Strand"))) >> summary(model) >> >> #

[R] for loop for extracting linear model info

2009-04-03 Thread Melissa2k9
Hi, I have written a for loop as such: model<-lm(Normalised~Frame,data=All,subset=((Subject==1)&(Filmclip=="Strand"))) summary(model) ### #To extract just the Adjusted R squared ### rsq<-summary(model)[[9]] ##

[R] Linear model, finding the slope

2009-04-03 Thread Melissa2k9
Hi for some data I working on I am merely plotting time against temperature for a variable named filmclip. So for example, I have volunteers who watched various film clips and have used infared camera to monitor the temperature on their face at every second of the clip. The variable names I hav

[R] the by function

2009-03-26 Thread Melissa2k9
Hey, I have a dataframe with subjects who have watched films. The variables of interest are Pixel number and Temperature on the face. For each subject there are 8 films, for each film for each subject I need to measure the mean number of pixels then merge this vector with the data frame. I have