Re: [R] Calculation of r squared from a linear regression

2010-06-15 Thread kMan
Dear Sandra, R^2 is just a ratio between the amount of error explained between two models. PRE (proportional reduction in error) = R^2 = (SSE model C - SSE model A)/SSE model C. This is sometimes expressed as (SSEc-SSEa)/SSEc = SSR/SSEc |SSR=sum squared reduced Given your example with some

[R] summary stats on continuous data

2010-06-15 Thread Matthew Finkbeiner
I'm sorry for what I'm sure is a terribly simple question. I have a large dataframe along these lines: S- 1:3 d- data.frame(cbind(S=rep(paste('S',S,sep=),each=30), trial=rep(1:3,each=10), FactorA=rep(paste('L',1,sep=),each=30), Acc= c(rep(1,each=20),rep(0,each=10)), Sample=rep(1:10,3),

[R] lme, spline

2010-06-15 Thread Farhad Shokoohi
Dear All, I have a problem running this program on R. Z is a matrix of spline which is random fit-lme(anc~X,random=pdIdent(~Z)) Error in getGroups.data.frame(dataMix, groups) : Invalid formula for groups What I have done wrong? __

Re: [R] summary stats on continuous data

2010-06-15 Thread Daniel Malter
Hi, you should be able to do most of your summaries using tapply() or aggregate(). for your example, tapply(d$Acc,list(d$Sample),table) Here tapply takes Acc, splits it by Sample, and then tables Acc (which returns how many 0s/1s were observed in variable Acc for each stratum of Sample).

[R] dendrogram

2010-06-15 Thread elyakhlifi mustapha
Hello. I have a small problem when I want to display a dendrogram for about 450 varieties. The label of theses varieties is too big and we can not see thems well. How can I do to resize the label smaller? Can you help me please? Thanks. [[alternative HTML version deleted]]

Re: [R] Calculation of r squared from a linear regression

2010-06-15 Thread Daniel Malter
Hi, as pointed out previously, the problem is in using the canned routine (lm) without including an intercept term. Here is a working, generic example with commented code. #Simulate data x=rnorm(100) e=rnorm(100) y=x+e #Create X matrix with intercept X=cbind(1,x) #Projection matrix

Re: [R] shifted window of string

2010-06-15 Thread Gabor Grothendieck
Try this: v - letters; windows - 5; shift - 2 e - embed(v, window) e[seq(1, nrow(e), shift), window:1] On Mon, Jun 14, 2010 at 11:46 PM, david hilton shanabrook davidshanabr...@me.com wrote: basically I need to create a sliding window in a string.  a way to explain this is: v -

Re: [R] dendrogram

2010-06-15 Thread Tal Galili
Hi Elyakhlifi, You can try this: hc - hclust(dist(USArrests), ave) plot(hc, cex = .5) Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il

[R] merge

2010-06-15 Thread n.via...@libero.it
Dear list I have two different data frame the first one is like this CLUSTER year variablevalue m1 2006 EC01 4 m1 2007 EC01 5 m2 2006 EC01

Re: [R] merge

2010-06-15 Thread Claudia Beleites
apropos (merge) Cheers, Claudia n.via...@libero.it wrote: Dear list I have two different data frame the first one is like this CLUSTER year variablevalue m1 2006 EC01 4 m1 2007 EC01

[R] Graphics question: How to create a changing smudge factor for overlapping lines?

2010-06-15 Thread Tal Galili
Hello all, I am trying to create a Clustergram in R. (More about it here: http://www.schonlau.net/clustergram.html) And to produce a picture similar to what is seen here: http://www.schonlau.net/images/clustergramexample.gif I was able (more or less) to write the R code for creating the image,

[R] Simple 3D Plot Question

2010-06-15 Thread Nick Torenvliet
Hi all, I've got a simple 3D plot as follows... xx - seq(-20,20,.5) yy - seq(-20,20,.5) zFunc - function(x,y){3*x^2*y} z - outer(xx,yy,zFunc) persp(xx,yy,z,theta=30,phi=30,ticktype=detailed) Just beautiful! My question is how do I constrain the plot to only display x^2 = y = 1? Thanks in

Re: [R] Simple 3D Plot Question

2010-06-15 Thread Duncan Murdoch
Nick Torenvliet wrote: Hi all, I've got a simple 3D plot as follows... xx - seq(-20,20,.5) yy - seq(-20,20,.5) zFunc - function(x,y){3*x^2*y} z - outer(xx,yy,zFunc) persp(xx,yy,z,theta=30,phi=30,ticktype=detailed) Just beautiful! My question is how do I constrain the plot to only

[R] How to see how a function is written

2010-06-15 Thread Sergey Goriatchev
Hello, If I want to see how, say, apply function is written, how would I be able to do that? Just typing apply at the prompt does not work. Thank you for help! Sergey __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] How to see how a function is written

2010-06-15 Thread Erik Iverson
Sergey Goriatchev wrote: Hello, If I want to see how, say, apply function is written, how would I be able to do that? Just typing apply at the prompt does not work. Well, it is supposed to work, and it works for me. So you need to tell us what does not work means, and all the info the

Re: [R] How to see how a function is written

2010-06-15 Thread Gavin Simpson
On Tue, 2010-06-15 at 14:20 +0200, Sergey Goriatchev wrote: Hello, If I want to see how, say, apply function is written, how would I be able to do that? Just typing apply at the prompt does not work. In what sense does it not work? If I do this, I get: apply function (X, MARGIN, FUN, ...)

[R] how to make JAVA available for R use?

2010-06-15 Thread yi li
i've just installed the packagexlsx,which is used for read,write,format Excel 2007 files, as i loaded the package ,i was told to intall the package rJava, the problem was that i didn't have a JAVA platform on my computer, so i have to install JAVA JDK first, my problem is ,after i 've installed

Re: [R] How to see how a function is written

2010-06-15 Thread Sergey Goriatchev
Erik, I see the following when I type apply at the prompt: apply standardGeneric for apply defined from package base function (X, MARGIN, FUN, ...) standardGeneric(apply) environment: 0x03cad7d0 Methods may be defined for arguments: X, MARGIN, FUN Use showMethods(apply) for currently

Re: [R] lme, spline

2010-06-15 Thread Joris Meys
On Tue, Jun 15, 2010 at 9:47 AM, Farhad Shokoohi stat...@gmail.com wrote: Dear All, I have a problem running this program on R. Z is a  matrix of spline which is random fit-lme(anc~X,random=pdIdent(~Z)) Error in getGroups.data.frame(dataMix, groups) :  Invalid formula for groups What I

Re: [R] Graphics question: How to create a changing smudge factor for overlapping lines?

2010-06-15 Thread Hadley Wickham
My current solution is to use a constant jitter (based on seq) on all the k number of clusters, but that causes glitches in the produced image (run my code to see). What are the glitches? It looks pretty good to me. (I'm not sure if the colour does anything apart from make it pretty though).

Re: [R] How to see how a function is written

2010-06-15 Thread Erik Iverson
Sergey Goriatchev wrote: Erik, I see the following when I type apply at the prompt: apply standardGeneric for apply defined from package base function (X, MARGIN, FUN, ...) standardGeneric(apply) environment: 0x03cad7d0 Methods may be defined for arguments: X, MARGIN, FUN Use

Re: [R] How to see how a function is written

2010-06-15 Thread Gavin Simpson
On Tue, 2010-06-15 at 14:38 +0200, Sergey Goriatchev wrote: Erik, I see the following when I type apply at the prompt: apply standardGeneric for apply defined from package base Looks like you have something loaded in your workspace (or have created something) that has altered the usual

Re: [R] Prime Numbers Pkgs

2010-06-15 Thread Joris Meys
This is also an interesting discussion to read in this respect : http://tolstoy.newcastle.edu.au/R/e8/help/09/10/1228.html Cheers Joris On Mon, Jun 14, 2010 at 5:55 PM, Karl-Dieter Crisman kcris...@gmail.com wrote: Looking for a recommended package that handles prime number computations. I'm

Re: [R] How to see how a function is written

2010-06-15 Thread Sergey Goriatchev
Maybe I have to much stuff loaded in the workspace, Gavin, you are right: sessionInfo() R version 2.10.1 (2009-12-14) i386-pc-mingw32 locale: [1] LC_COLLATE=German_Switzerland.1252 LC_CTYPE=German_Switzerland.1252 LC_MONETARY=German_Switzerland.1252 [4] LC_NUMERIC=C

[R] working with zoo time index ??

2010-06-15 Thread skan
Hello Where could I find examples on how to work with the time index in a timeseries or zoo series? Let say I've got this series DATA 1990-01-01 10:00:00 0.900 1990-01-01 10:01:00 0.910 1990-01-01 10:03:00 0.905 1990-01-01 10:04:00 0.905 1990-01-01 10:05:00 0.890

Re: [R] how to use 'points' function to plot two curves with errbar

2010-06-15 Thread Yogesh Tiwari
Dear John, Great thanks, I would appreciate if any expert can throw more light on it. Thanks in advance, Best Regards, Yogesh On 6/14/10, John Kane jrkrid...@yahoo.ca wrote: Hi Yogesh, I think you accidentelly replied only to me and not to the mailing list. I'd suggest that you copy your

Re: [R] summary stats on continuous data

2010-06-15 Thread Matthew Finkbeiner
Hi Daniel, thanks for your reply. Unfortunately, that is not doing what I need. In the example I sent, there are three subjects (S1, S2 S3). Each subject has 3 trials worth of data and each trial has 10 samples. What I want to return is the accuracy rate for each subject. The answer is

[R] Problem with as.POSIXlt$hour

2010-06-15 Thread PtitBleu
Hello, In one of my functions, I need to extract the hour from a date. For example: as.POSIXlt(2010-03-27 02:00:00)$hour gives 2 as expected. It works for all the dates I've tested except the following one which is in my list of dates: as.POSIXlt(2010-03-28 02:00:00)$hour which gives 0. I don't

Re: [R] NPMC

2010-06-15 Thread Moimt
Yes I had a data.frame but did not named the categorical variable class and the numerical one var. It is working now. However I would like to do a comparison with several classes and variables. Is there a way of doing this? Or do I have to do a Wilcox.test for every variable? Thanks Marie. --

Re: [R] How to see how a function is written

2010-06-15 Thread Gavin Simpson
On Tue, 2010-06-15 at 14:56 +0200, Sergey Goriatchev wrote: Maybe I have to much stuff loaded in the workspace, Gavin, you are right: OK, so now do showMethods(apply) And R should list out the available methods. See which package (re)defines apply. But it is likely going to be simpler to

Re: [R] How to see how a function is written

2010-06-15 Thread Sergey Goriatchev
showMethods(apply) Function: apply (package base) X=ANY X=missing (inherited from: X=ANY) X=timeSeries On Tue, Jun 15, 2010 at 15:10, Gavin Simpson gavin.simp...@ucl.ac.uk wrote: On Tue, 2010-06-15 at 14:56 +0200, Sergey Goriatchev wrote: Maybe I have to much stuff loaded in the workspace,

[R] Integration problem: error in invoking an outside function

2010-06-15 Thread Frankvb
Dear all, Currently I am trying to integrate a function which depends on four variables, two of which are given, one is given in the integrate function, so there is one variable to integrate on. The code is as follows: Pmatrix = function(th) { P = matrix(nrow=6, ncol=6, data=0)

Re: [R] Graphics question: How to create a changing smudge factor for overlapping lines?

2010-06-15 Thread Tal Galili
Hi Hadley, Thanks for replying. The glitches are the cases where you would have a bundle of lines belonging to a specific cluster, but had spaces between them (because the place of one of the lines was saved for another line that in the meantime moved to another cluster). I just came up with a

[R] lme, spline (revised question)

2010-06-15 Thread Farhad Shokoohi
Dear All, I revise my question about the problem I have. Take a look at the article http://www.jstatsoft.org/v09/i01 and download the attached code. try to run one of the codes for example section 2.1 in R here is the code fossil - read.table(fossil.dat,header=T) x - fossil$age y -

Re: [R] Problem with as.POSIXlt$hour

2010-06-15 Thread Uwe Ligges
On 15.06.2010 13:45, PtitBleu wrote: Hello, In one of my functions, I need to extract the hour from a date. For example: as.POSIXlt(2010-03-27 02:00:00)$hour gives 2 as expected. It works for all the dates I've tested except the following one which is in my list of dates:

Re: [R] working with zoo time index ??

2010-06-15 Thread Gabor Grothendieck
On Tue, Jun 15, 2010 at 8:27 AM, skan juanp...@gmail.com wrote: Hello Where could I find examples on how to work with the time index in a timeseries  or zoo series? Let say I've got this series DATA 1990-01-01 10:00:00   0.900 1990-01-01 10:01:00   0.910 1990-01-01 10:03:00   0.905

[R] Package testing

2010-06-15 Thread Gábor Csárdi
Dear all, I would like to write some tests for my R package, and the usual 'tests' directory seemed like a good solution, but there is something I cannot understand. It is possible to supply .Rout.save files with the expected output for the tests, which is great. But since the tests are not run

Re: [R] Graphics question: How to create a changing smudge factor for overlapping lines?

2010-06-15 Thread Hadley Wickham
The glitches are the cases where you would have a bundle of lines belonging to a specific cluster, but had spaces between them (because the place of one of the lines was saved for another line that in the meantime moved to another cluster). I think that display looked just fine! I just came

Re: [R] how to use 'points' function to plot two curves with errbar

2010-06-15 Thread David Winsemius
In context below: On Jun 15, 2010, at 4:20 AM, Yogesh Tiwari wrote: Dear John, Great thanks, I would appreciate if any expert can throw more light on it. Thanks in advance, Best Regards, Yogesh On 6/14/10, John Kane jrkrid...@yahoo.ca wrote: Hi Yogesh, I think you accidentelly replied

Re: [R] Integration problem: error in invoking an outside function

2010-06-15 Thread Ravi Varadhan
Frank, The trouble is that your integrand function `int' is not vectorized. You can use `Vectorize' or `sapply' to rectify this. int.vec = function(theta, s, a, lambda) { sapply(theta, function(t,s,a,lambda) int(t,s,a,lambda), s=s, a=a, lambda=lambda) }

[R] Slightly OT: how to save Tinn-R files to open in linux

2010-06-15 Thread Bos, Roger
I use two PCs for my R programming, one Win32 and one Linux (Ubuntu 10). In Windows I use Tinn-R to save my code and occasionally I am unable to open a Tinn-R saved file in Ubuntu. If I try to open in gedit I get a message that gedit has not been able to detect the character encoding. To correct

Re: [R] Problem with as.POSIXlt$hour

2010-06-15 Thread David Winsemius
On Jun 15, 2010, at 7:45 AM, PtitBleu wrote: Hello, In one of my functions, I need to extract the hour from a date. For example: as.POSIXlt(2010-03-27 02:00:00)$hour gives 2 as expected. It works for all the dates I've tested except the following one which is in my list of dates:

Re: [R] Graphics question: How to create a changing smudge factor for overlapping lines?

2010-06-15 Thread Tal Galili
Hi Hadley, I wrapped the code into a function. I made it so all the lines would always start from the cluster mean. And I tried to give more meaning to the colors by giving the color according the the order of the first principal component of that observation. What do you think ? Tal #

Re: [R] Integration problem: error in invoking an outside function

2010-06-15 Thread David Winsemius
On Jun 15, 2010, at 9:05 AM, Frankvb wrote: Dear all, Currently I am trying to integrate a function which depends on four variables, two of which are given, one is given in the integrate function, so there is one variable to integrate on. The code is as follows: Pmatrix = function(th) {

[R] strange error message from freedesktop.org in the R window!

2010-06-15 Thread Kjetil Halvorsen
Almost continuously I get some variant of the following message fillingb up my R console: bubble(data1, logvol) ?variogram ** (evince:2799): WARNING **: DBus error org.freedesktop.DBus.Error.Failed: Unable to set metadata key ** (evince:2799): WARNING **: DBus error

[R] Problem with the recode function

2010-06-15 Thread Alain Guillet
Hello, I am using the recode() function in Rcmdr and the result is not what I expect so I am almost sure I did something wrong but what... test - data.frame(x=1:10) library(car) recode(test$x,'1:5=0 ; else=1', as.factor.result=TRUE) [1] 0 0 0 0 0 1 1 1 1 1 Levels: 0 1 BUT

[R] Parallel computing on Windows (foreach)

2010-06-15 Thread Sergey Goriatchev
Hello, I am reading Using The foreach Package document and I have tried the following: - sessionInfo() R version 2.10.1 (2009-12-14) i386-pc-mingw32 locale: [1] LC_COLLATE=German_Switzerland.1252

[R] Unspecified [upper] xlim/ylim?

2010-06-15 Thread Ted Harding
Greetings! I would like to be able to specify a fixed (say) lower limit for plotting, while leaving the upper limit floating, when plotting. The context is that the maximum in the data to be plotted is unpredictable, being the consequence of a simulation, whereas I know that it cannot be less than

Re: [R] Problem with the recode function

2010-06-15 Thread John Fox
Dear Alain, I'm afraid that I can't duplicate your problem. First, there is no recode function in the Rcmdr package; it uses recode from car. Here's a record of my Rcmdr session, using the recode dialog to generate the recode command: test$variable - recode(test$x, '1:5=0; else=1; ',

Re: [R] Problem with the recode function

2010-06-15 Thread Natalie Van Zuydam
Dear Alain, Taking a stab in the dark here but I find that if my original column is a factor then recode won't work for me. Would a simple ifelse statement not do the same thing? test$variable - ifelse(test$x=1 test$x=5,0,1) On 15/06/2010 16:53, John Fox wrote: Dear Alain, I'm afraid

Re: [R] Unspecified [upper] xlim/ylim?

2010-06-15 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ted.hard...@manchester.ac.uk Sent: Tuesday, June 15, 2010 8:49 AM To: r-h...@stat.math.ethz.ch Subject: [R] Unspecified [upper] xlim/ylim? Greetings! I would like to be

Re: [R] Odp: question about mean

2010-06-15 Thread Allan Engelhardt
This solution also seems to be the fastest of the proposed options for this data set: library(rbenchmark) benchmark(columns = c(test, elapsed, relative), order = elapsed, apply =apply(iris[, -5], 2, tapply, iris$Species, mean), with = with(iris, rowsum(iris[, -5],

Re: [R] shifted window of string

2010-06-15 Thread Charles C. Berry
On Mon, 14 Jun 2010, david hilton shanabrook wrote: basically I need to create a sliding window in a string. a way to explain this is: v - c(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) window - 5 shift - 2 I want a matrix of characters with window columns filled with v by filling

Re: [R] Problem with the recode function

2010-06-15 Thread John Fox
Dear Natalie, recode() does work for factors; is it possible that you haven't put the level names in quotes? Example: (f - factor(rep(letters[1:3], 3))) [1] a b c a b c a b c Levels: a b c recode(f, c('a', 'b') = 'A'; else='B' ) [1] A A B A A B A A B Levels: A B Best, John

Re: [R] Problem with the recode function

2010-06-15 Thread Alain Guillet
I found out what the problem is: when I start R Commander, some plug-ins are automatically loaded and it seems that the problem comes from the RcmdrPlugin.Export, more precisely from the Hmisc package (the plug-in depends on it) which contains a recode() function too with the following

Re: [R] Graphics question: How to create a changing smudge factor for overlapping lines?

2010-06-15 Thread Tal Galili
Hello Hadley, Tormod and every one else. I just published a post on my blog, giving the code and presenting an example of it's use (on the Iris data set) http://www.r-statistics.com/2010/06/clustergram-a-graph-for-visualizing-cluster-analyses-r-code/ I welcome any comments (pitfalls, suggestions

Re: [R] Unspecified [upper] xlim/ylim?

2010-06-15 Thread Ted Harding
On 15-Jun-10 16:01:24, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ted.hard...@manchester.ac.uk Sent: Tuesday, June 15, 2010 8:49 AM To: r-h...@stat.math.ethz.ch Subject: [R] Unspecified [upper]

Re: [R] Package testing

2010-06-15 Thread Duncan Murdoch
Gábor Csárdi wrote: Dear all, I would like to write some tests for my R package, and the usual 'tests' directory seemed like a good solution, but there is something I cannot understand. It is possible to supply .Rout.save files with the expected output for the tests, which is great. But since

Re: [R] Problem with the recode function

2010-06-15 Thread Dave Freedman
I find that sometimes the recode function in car is easier to use, while at other times it's easier to use the recode in Hmisc. If both packages are loaded, you can always use car::recode or Hmisc::recode to specify which function you want. hth, David Freedman, CDC -- View this message in

[R] nlm is

2010-06-15 Thread Hiba Baroud
Hello, I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]). So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter. My function

[R] Error in nlm : non-finite value supplied by 'nlm'

2010-06-15 Thread Hiba Baroud
Hello, I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]). So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter. My function is

[R] coxph and remaing events

2010-06-15 Thread Federico Calboli
Hi everyone, I'm running a cox ph model on a dataset with a number of variables. Each variable has a different number of missing data, so that coxph() drops the individuals who are missing data at one or more variables. Because of this dropping (totally fine btw) I want to know how many events

Re: [R] how to make JAVA available for R use?

2010-06-15 Thread Cedrick W. Johnson
I can't resist http://www.lmgtfy.com/?q=set+windows+PATH+variable On 6/15/2010 8:37 AM, yi li wrote: i've just installed the packagexlsx,which is used for read,write,format Excel 2007 files, as i loaded the package ,i was told to intall the package rJava, the problem was that i didn't

Re: [R] working with zoo time index ??

2010-06-15 Thread Gabor Grothendieck
On Tue, Jun 15, 2010 at 1:54 PM, steven mosher mosherste...@gmail.com wrote: Hi Gabor,  Not sure where to report this, but Mac 10.5.8 R: 11.1 When you examine the zoo vignette and hit the back button, you get a hang. I havent tested with other vignettes and cant imagine that is is specific

Re: [R] coxph and remaing events

2010-06-15 Thread Federico Calboli
On 15 Jun 2010, at 18:34, Federico Calboli wrote: I'm running a cox ph model on a dataset with a number of variables. Each variable has a different number of missing data, so that coxph() drops the individuals who are missing data at one or more variables. Because of this dropping (totally

[R] output from the gbm package

2010-06-15 Thread Changbin Du
HI, Dear Greg and R community, I have one question about the output of gbm package. the output of Boosting should be f(x), from it , how to calculate the probability for each observations in data set? SInce it is stochastic, how can guarantee that each observation in training data are selected

Re: [R] coxph and remaing events

2010-06-15 Thread David Winsemius
On Jun 15, 2010, at 1:34 PM, Federico Calboli wrote: Hi everyone, I'm running a cox ph model on a dataset with a number of variables. Each variable has a different number of missing data, so that coxph() drops the individuals who are missing data at one or more variables. Because of

Re: [R] summary stats on continuous data

2010-06-15 Thread Daniel Malter
You can define a function that does just that: sum the 1s in Acc and divide by the length of Acc. Then use tapply to apply the function for each subject. f=function(x){sum(as.numeric(as.character(x)))/length(x)} tapply(d$Acc,list(d$S),f) HTH, Daniel -- View this message in context:

Re: [R] lme, spline

2010-06-15 Thread Farhad Shokoohi
Dear All, I revise my question about the problem I have. Take a look at the article http://www.jstatsoft.org/v09/i01 and download the attached code. try to run one of the codes for example section 2.1 in R here is the code fossil - read.table(fossil.dat,header=T) x - fossil$age y -

[R] TS Forecasting/Prediction

2010-06-15 Thread Lars Bergemann
Hey. Looking at EuStockMarkets[1:1860] -- the DAX. ar() estimates an AR(1) model with \alpha_1 ~= 1 and high \sigma^2. But forecasting from a given X_t_0 according to an AR(1) model with \alpha_1 = 1 should be X_t_0 for all X_t, t t_0 . ? How do you do this forecasting in R?

[R] Help with error

2010-06-15 Thread Gretchen Heavner
Hi. I am trying to do a nonlinear regression on a set of data with Monod kinetics and Haldane inhibition. I am using the following commands to do the nonlinear regression: dce-read.delim(data.txt, header = TRUE, sep = \t, quote=\, dec=., fill = TRUE, comment.char=)

Re: [R] Problem with as.POSIXlt$hour

2010-06-15 Thread PtitBleu
Hello again, You are right: it corresponds to the DST time transition in France (I think you have guessed it was France from my Frenglish style - sorry about it). To get around this problem, I now use : as.numeric(format(strptime(2010-03-28 02:00:00, format=%Y-%m-%d %H:%M:%S), format=%H))

[R] help biglm.big.matrix; problem with weights

2010-06-15 Thread Rahim Hajji
Hello colleagues, I have tried to use the package biglm. I want to specify a multivariate regression with a weight. I have imported a large dataset with the library(bigmemory). I load the library (biglm) and specified a regression with a weight. But I get everytime a error message like “object

[R] Plotting two ellipses in one graph

2010-06-15 Thread Ali Zanaty
Dear R Users: What I need to do is to plot two ellipses in the same graph (one for each group). You can use either X1 or X2 as the X-axis and the other variable as the Y-axis. Also I need to show the 95% C.I. or P.I. of the overlapping part of the two ellipses, and for each ellipse separately.

[R] Fastest way to merge matrix columns into a comma delimited string?

2010-06-15 Thread Jonathan Greenberg
Folks: Say I have a matrix: test=matrix(c(1,2,3),nrow=10,ncol=3) I would like to have an output character vector where each line is row's values delimited by commas, e.g.: 1,2,3 2,3,1 3,1,2 ... 1,2,3 What is the fastest way of doing this? I can paste() row-by-row but this seems an

[R] Matrix to Vector

2010-06-15 Thread George Coyle
Hi All, I am trying to turn a Matrix into a vector for analysis purposes. I need to select only certain columns from the entire matrix for the vector (intraday time intervals). Also I need to transpose the Matrix (so times are in rows) stack each successive new column on top of each other

Re: [R] working with zoo time index ??

2010-06-15 Thread steven mosher
Hi Gabor, Not sure where to report this, but Mac 10.5.8 R: 11.1 When you examine the zoo vignette and hit the back button, you get a hang. I havent tested with other vignettes and cant imagine that is is specific to yours FWIW. Did I mention that zoo is great. Thx for your work on it. On

[R] building 2.11.1 on solaris 10

2010-06-15 Thread Coons, Don W
Trying to get 2.11.1 built on a solaris 10 machine. This particular machine I do not have root access so I have just created an area under my home to use. I am currently having issues in the src/library area most specifically with getting the datasets area built. Here is the output form my most

Re: [R] Fastest way to merge matrix columns into a comma delimited string?

2010-06-15 Thread Sarah Goslee
apply(test, 1, paste, collapse=,) [1] 1,2,3 2,3,1 3,1,2 1,2,3 2,3,1 3,1,2 1,2,3 2,3,1 3,1,2 [10] 1,2,3 On Tue, Jun 15, 2010 at 2:27 PM, Jonathan Greenberg greenb...@ucdavis.edu wrote: Folks: Say I have a matrix: test=matrix(c(1,2,3),nrow=10,ncol=3) I would like to have an output

Re: [R] Fastest way to merge matrix columns into a comma delimited string?

2010-06-15 Thread Peter Langfelder
apply(test, 1, paste, collapse = ,) On Tue, Jun 15, 2010 at 11:27 AM, Jonathan Greenberg greenb...@ucdavis.edu wrote: Folks: Say I have a matrix: test=matrix(c(1,2,3),nrow=10,ncol=3) I would like to have an output character vector where each line is row's values delimited by commas,

Re: [R] Matrix to Vector

2010-06-15 Thread Sarah Goslee
How about: ?subset ?t ?as.vector I'm not sure transposing is really needed, but without a workable example as requested in the posting guide (hint, hint), it's hard to say for certain. Sarah On Tue, Jun 15, 2010 at 1:51 PM, George Coyle gcoy...@gmail.com wrote: Hi All, I am trying to turn a

Re: [R] Matrix to Vector

2010-06-15 Thread Erik Iverson
George Coyle wrote: Hi All, I am trying to turn a Matrix into a vector for analysis purposes. I need to select only certain columns from the entire matrix for the vector (intraday time intervals). Also I need to transpose the Matrix (so times are in rows) stack each successive new column on

Re: [R] Unspecified [upper] xlim/ylim?

2010-06-15 Thread Marc Schwartz
On Jun 15, 2010, at 12:11 PM, Ted Harding wrote: On 15-Jun-10 16:01:24, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ted.hard...@manchester.ac.uk Sent: Tuesday, June 15, 2010 8:49 AM To:

Re: [R] Problem with the recode function

2010-06-15 Thread John Fox
Dear Alain, -Original Message- From: Alain Guillet [mailto:alain.guil...@uclouvain.be] Sent: June-15-10 12:25 PM To: John Fox Cc: r-help@r-project.org Subject: Re: [R] Problem with the recode function I found out what the problem is: when I start R Commander, some plug-ins are

Re: [R] Unspecified [upper] xlim/ylim?

2010-06-15 Thread Ted Harding
On 15-Jun-10 19:35:54, Marc Schwartz wrote: On Jun 15, 2010, at 12:11 PM, Ted Harding wrote: On 15-Jun-10 16:01:24, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ted.hard...@manchester.ac.uk Sent:

Re: [R] Error in nlm : non-finite value supplied by 'nlm'

2010-06-15 Thread Ravi Varadhan
You need to constrain your parameters such that 0 vector[1] 1 and vector[2] 0. You could try the `spg' function in package BB or the `L-BFGS-B' function in optim to perform this box-constrained optimization. There are other options as well including the `nlminb' function. Ravi. -Original

[R] Question about user define function

2010-06-15 Thread GL
Have the following function that is called by the statement below. Trying to return the two dataframes, but instead get one large list including both tables. ReadInputDataFrames - function() { dbs.this= read.delim(this.txt, header = TRUE, sep = \t, quote=\, dec=.) dbs.that=

Re: [R] Question about user define function

2010-06-15 Thread David Winsemius
On Jun 15, 2010, at 4:39 PM, GL wrote: Have the following function that is called by the statement below. Trying to return the two dataframes, but instead get one large list including both tables. ReadInputDataFrames - function() { dbs.this= read.delim(this.txt, header = TRUE, sep =

[R] list of variables of an expression

2010-06-15 Thread Alberto Lusiani
I would like to get the list of variables of an expression: is that possible?  I searched the help and the web without success.  In practice, given an expression like expr = parse(text=x^2+y^3) I would like to have a function such as: vars(expr) returns c(x, y) or a list like the one returned

[R] Problem about zero

2010-06-15 Thread Yen Lee
Hello, everyone, There's a problem about zero in R and I really need your help. I have a vector shown as x=c(0.1819711,0.4811463,0.1935151,0.1433675), The sum of this vector is shown as 1 in R, but when I type 1-sum(x), the value is not zero, but -2.220446e-16. I can accept that this value

Re: [R] Problem about zero

2010-06-15 Thread Jorge Ivan Velez
Hi Yen, See http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f HTH, Jorge On Tue, Jun 15, 2010 at 6:00 PM, Yen Lee wrote: Hello, everyone, There's a problem about zero in R and I really need your help. I have a vector shown as

Re: [R] list of variables of an expression

2010-06-15 Thread David Winsemius
On Jun 15, 2010, at 5:45 PM, Alberto Lusiani wrote: I would like to get the list of variables of an expression: is that possible? I searched the help and the web without success. In practice, given an expression like expr = parse(text=x^2+y^3) I would like to have a function such as:

Re: [R] Problem about zero

2010-06-15 Thread Joshua Wiley
Hello Yen, You may find ?zapsmall helpful. If your algorithm expects 1-sum(x) to have a lower bound of zero, then also simply setting a cutoff point seems reasonable. Josh On Tue, Jun 15, 2010 at 3:00 PM, Yen Lee b88207...@ntu.edu.tw wrote: Hello, everyone, There's a problem about zero in R

Re: [R] lme, spline

2010-06-15 Thread Gavin Simpson
On Tue, 2010-06-15 at 06:28 -0700, Farhad Shokoohi wrote: Dear All, I revise my question about the problem I have. Take a look at the article http://www.jstatsoft.org/v09/i01 and download the attached code. try to run one of the codes for example section 2.1 in R here is the code That is

Re: [R] list of variables of an expression

2010-06-15 Thread Marc Schwartz
On Jun 15, 2010, at 5:07 PM, David Winsemius wrote: On Jun 15, 2010, at 5:45 PM, Alberto Lusiani wrote: I would like to get the list of variables of an expression: is that possible? I searched the help and the web without success. In practice, given an expression like expr =

Re: [R] Problem about zero

2010-06-15 Thread Gabor Grothendieck
On Tue, Jun 15, 2010 at 6:00 PM, Yen Lee b88207...@ntu.edu.tw wrote: Hello, everyone, There's a problem about zero in R and I really need your help. I have a vector shown as x=c(0.1819711,0.4811463,0.1935151,0.1433675), The sum of this vector is shown as 1 in R, but when I type 1-sum(x),

Re: [R] Problem about zero

2010-06-15 Thread Yen Lee
Hello, everyone, Thank you for all your kindness. I've solved the problem through your help with the function all.equal. Thank you very much! Yen -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Wednesday, June 16, 2010 6:40 AM To: Yen Lee Cc:

Re: [R] Problem about zero

2010-06-15 Thread Jorge Ivan Velez
Same for me on Mac OS X: x - c(0.1819711,0.4811463,0.1935151,0.1433675) 1-sum(x) [1] 0 version$version.string [1] R version 2.11.1 Patched (2010-05-31 r52180) Regards, Jorge On Tue, Jun 15, 2010 at 6:40 PM, Gabor Grothendieck wrote: On Tue, Jun 15, 2010 at 6:00 PM, Yen Lee wrote:

[R] cross validation of SVM

2010-06-15 Thread Amy Hessen
hi, could you please tell me what kind of cross validation that SVM of e1071 uses? Cheers, Amy _ View photos of singles in your area! Looking for a hot date? [[alternative

[R] regression analysis p value

2010-06-15 Thread Liang Cheng
Hello:) I have 4 points in a 2-dimension coordinate. how can I do the regression analysis and calculate the p-value£¿ thanks a lot, Liang [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

  1   2   >