[R] Time series

2014-06-30 Thread So
Hi There! I have a time series data for 13 years with freqency of 23 per year. I have plot the curve on R. Is it possible to refer to the point inbetween the nodes... eg. say the time series ts1 has ts1[1] 0.25 and ts1[2]=0.4. is it possible to get the time when ts1 reach to 0.3?? -- View this

Re: [R] Missing index in vector assignment

2010-03-17 Thread Chaehan So
Petr - your suggestion WORKS! Thank you so much, really! happy-Chaehan On Wed, Mar 17, 2010 at 2:22 PM, Petr PIKAL wrote: > Hi > > > r-help-boun...@r-project.org napsal dne 17.03.2010 13:04:05: > > > Jim & Petr, > > Thank you for your hint - I am really gratef

Re: [R] Missing index in vector assignment

2010-03-17 Thread Chaehan So
p=FALSE] did solve the problem, so I got a data.frame with the indexes. Yet, then I turned to the call svp <- ksvm(x, y, type="nu-svc") Error in .local(x, ...) : y must be a vector or a factor. So then I followed your second advice, looking up the additional information from help fil

[R] Missing index in vector assignment

2010-03-16 Thread Chaehan So
Dear r-helpers, I am getting a mismatch error between two variables: svp <- ksvm(x, y, type="nu-svc") Error in .local(x, ...) : x and y don't match. and I suspect that it might be due to missing index in the y variable which I defined as: y <- (LVvar[,1]) I tried various methods to make

Re: [R] Unexpected output in first iteration of for-loop

2010-02-11 Thread Chaehan So
Don, that was great - thanks so much! ...and you are right rbind() being expensive, but my dataframe will always stay that small (max. twice as large). Chaehan On Thu, Feb 11, 2010 at 4:50 PM, Don MacQueen wrote: > You have a mistake in how you're setting up the object named "res

Re: [R] Unexpected output in first iteration of for-loop

2010-02-11 Thread Chaehan So
Ok, you're right - may I rephrase: How should I modify the assignment of result <- latentVariableNames so it produces the output without the first line? I thought result <- NULL should do the job, but it didn't because of the following names(result) assignment (which I understan

[R] Unexpected output in first iteration of for-loop

2010-02-10 Thread Chaehan So
Dear r-helpers, why do I get an output in the first iteration of the for-loop which contains the string values of the input vector, and how can I avoid that? Here's the output (only line 1 is wrong) latentVariable Indiv Group 1 rPlanning rIterat rTDD 2 rPlanning0.79 0.84 3

Re: [R] eval function with javascript-semantics possible in R?

2010-02-10 Thread Chaehan So
Dear Joe - that was wonderful :-) -Chaehan On Thu, Feb 11, 2010 at 12:44 AM, Joe Cheng wrote: > On Wed, Feb 10, 2010 at 3:37 PM, Chaehan So wrote: > >> how can I access currentName in my loop - evaluated as a variable although >> it is a string? >> > > I think yo

Re: [R] eval function with javascript-semantics possible in R?

2010-02-10 Thread Chaehan So
mes) { doSomethingWith(currentName) } } On Wed, Feb 10, 2010 at 11:34 PM, David Winsemius wrote: > > On Feb 10, 2010, at 5:12 PM, Chaehan So wrote: > > Thank you, it works for the first problem! >> >> Yet for the second problem, how can I solve that in one dataframe (here: >>

[R] mean calculation within dataframe corrupted

2010-02-10 Thread Chaehan So
Dear R-helpers, my little function below calculates the group score (tmpGroupMean) of an item, appends a "_mean" on its name and stores its value on this name. However, it does not calculate the mean of these scores (LVMean) in the same row correctly, as you can see in the below output which stran

Re: [R] eval function with javascript-semantics possible in R?

2010-02-10 Thread Chaehan So
;testfile%s" > lapply(sprintf(fileName, 1:2), read.csv, dec = ",") > > On Wed, Feb 10, 2010 at 5:28 PM, Chaehan So wrote: > > Dear r-helpers, > > > > I am looking for an R-equivalent for the eval-function in javascript > which > > can &

[R] eval function with javascript-semantics possible in R?

2010-02-10 Thread Chaehan So
Dear r-helpers, I am looking for an R-equivalent for the eval-function in javascript which can interpret a string as code on runtime, thereby allowing things like for (i in c(1:2)) { eval(items + "i") <- read.csv(eval(filename+ i), dec=","); } which would execute (with filename="testfile"): i