search for: mynewdata

Displaying 7 results from an estimated 7 matches for "mynewdata".

2012 Jan 22
1
how to load R data file into a structure?
...all, I have already some important variables in the current R session; and I wanted to load some rData file which was saved during the last R session using "save.image"... But how do I avoid the newly loaded data/variables messing with my existing data/variables? In Matlab, I can do: mynewdata=load("imagefromlastRsession.rData") and then I can access the variables therein as follows: mynewdata.variable1 mynewdata.variable2 mynewdata.variable3 ... ... ... As you can see, this way, these variables won't interfere with my existing variables in the current R session... Ho...
2011 Feb 12
2
Predictions with missing inputs
...Here's my attempt but, of course, didn't work. #fit some linear model to random data x=matrix(rnorm(100*3),100,3) y=sample(1:2,100,replace=TRUE) mydata <- data.frame(y,x) mymodel <- lm(y ~ ns(X1, df=3) + X2 + X3, data=mydata) summary(mymodel) #create new data with 1 missing input mynewdata <- data.frame(matrix(rnorm(100*2),100,2)) mypred <- predict(mymodel, mynewdata) Thanks in advance for your help! Axel. [[alternative HTML version deleted]]
2009 Apr 26
2
RWeka prediction
Dear All,I encountered a problem when I use RWeka for prediction. Specifically, I use the following: res=J48(X1~.,data=mydata); predict(res), #it worked fine but when I tried to use a different data set, i.e. predict(res,newdata=mynewdata); all the predictions I get is 0, which apparently is problematic. What is weird is, if I use the old data, but use the newdata option, i.e. predict(res,newdata=mydata), all prediction is 0; Can anyone hint me what is wrong? Thanks a lot. Regards, Dajiang [[alternative HTML version deleted]]
2011 Aug 18
1
Loop trouble with Excel Serial Numbers!
Hi All! I'm trying to convert serial numbers in Excel to dates in R. For each single "thedate" entry, I get a correct answer. But if I try using the for loop, I get bizarre numbers in "mynewdata". thedate<-as.matrix(40548:40759,ncol=1) exdate<-function(){ mynewdate<-NULL for(i in 1:nrow(thedate)){ mynewdate[i]<-as.Date(thedate[i,1],origin="1899-12-30") } print(mynewdate) } exdate() Thank you very much! Anna [[alternative HTML version deleted]]
2010 Mar 11
1
Group by
...chosed time bars. i.e. So I would like to group by hour or day or 5 days, and have all my columns be summed or averaged or counted.. mydata: V1,V2,V3 10:03:13,3.4,1002 10:03:14,5.6,1001 10:05:27,7.2,999 10:05:33,8.2,998 I want to convert this into say 5 minutes "bars" and sum columns mynewdata: V1,V2,V3 10:00:00,9.0,2003 10:05:00,15.4,1997 How can I do this? -- View this message in context: http://n4.nabble.com/Group-by-tp1588694p1588694.html Sent from the R help mailing list archive at Nabble.com.
2009 May 06
1
Add trend line to XYPlot using a subset of the original data
I've created an xyplot that I want to add a trend line to using a subset of the data. The xyplot is xyplot(X9444500~WY,data=mynewdata,xlim=c(1900,2020),ylab="TEST", xlab="",ylim=c(100,100000),scales=list(x=list(at=c(1900,1920,1940,1960,1980,2000,2020),axs="r",tck=-1),y=list(log=TRUE,tck=-100,at=c(100,1000,10000,100000))), panel=function(x,y,...) { panel.xyplot(x,y,col=1) panel.lines(x,exp(pr...
2007 Sep 17
1
How can I write routines and scripts in the R environment ?
*I would like to plot some semi-periodic signals as a function of the phase expressed as a value in [0,2PI]* *The problem is that the phase data is reported as the residual of the division by 2PI.* *For instance if the phase is 10.359 rd then:* *15.359 / 6.283185 = 2*6.283185 + 2.79263* *then only the residual 2.79263 is stored. * *In order to plot a number of consecutive cycles I have to add