Re: [R] Passing arguments to SQL Query in R

2012-07-27 Thread guruappa
Thanks a ton, much appreciated... On 26-Jul-2012, at 7:56 PM, Michael Weylandt [via R] wrote: On Thu, Jul 26, 2012 at 3:59 AM, guruappa [hidden email] wrote: Hello all, I am a newbie at R, with some experience in PERL. I have a database table that contains the following data:

Re: [R] Passing arguments to SQL Query in R

2012-07-27 Thread guruappa
Thanks a ton, much appreciated. On 26-Jul-2012, at 8:35 PM, John Kane [via R] wrote: Let me count the ways... R supplies a number of different ways. Here is sample using basic R and some other packages. Youprobably will need to install the packages ( ?install.packages) to run any but

[R] Eleaps in package subselect crashes when using include arguement

2012-07-27 Thread Nathan Stephens
I'm using eleaps to build a forward selection algorithm iteratively, but the program unexpectedly crashes. In fact, it completely closes my session in RStudio. The first 39 steps work fine, but on the 40th step, it unexpectedly stops with no errors. I've isolated the error to the code snippit

Re: [R] Working with Numbers generated from Regression Output

2012-07-27 Thread Krunal Nanavati
Hi Jean, Thank you very much for getting back to me. I tried the solutions that you have provided. First I tried the …coef(result) statement….and I got the below output coef(result) (Intercept)X Volume -30.40275264 0.57786290 0.02594024 Then, I simply

[R] Working with quantmod chartSeries and plot.zoo

2012-07-27 Thread OTB
Hi all, I'm a newbie to R and it has been very helpful to use your website. Unfortunately I've been struggling with my code now for two days so I wanted to ask few questions. I've been trying to create nice graphs to put into a pdf sheet but I'm having little problems with all the packages I've

Re: [R] Working with Numbers generated from Regression Output

2012-07-27 Thread Jeff Newmiller
Stop posting HTML. What you see is NOT what we see. As regards to your problems... you need to learn how to get data into and out of R, so please read the R Input/Output document supplied with R. The most foolproof way is to write the data to a CSV file and read it from there into a

Re: [R] How can I access an element of a string?

2012-07-27 Thread Henrik Singmann
Dear Miao, substr() ius waht you want. substr(ABCD, 2,2) [1] B Cheers, Henrik jpm miao schrieb: Dear Daniel and Jorge, Thank you very much and it does help. If I have a string ABCD, how can I access the second element of the string B? Thanks, Miao 2012/7/27 Daniel Nordlund

Re: [R] How can I access an element of a string?

2012-07-27 Thread arun
HI, Try this:  string1-ABCD idx-1:nchar(string1)  substr(string1,2,idx[2]) [1] B substr(string1,4,idx[4]) [1] D A.K. - Original Message - From: jpm miao miao...@gmail.com To: Daniel Nordlund djnordl...@frontier.com; jorgeivanve...@gmail.com Cc: r-help r-help@r-project.org Sent:

Re: [R] Working with Numbers generated from Regression Output

2012-07-27 Thread Krunal Nanavati
Hi Jeff, Sorry for the previous email. I tried using write function, and used the following syntax write(result,file=C:\\Users\\Krunal\\Desktop\\Book1.csv) but it is giving the following error Error in cat(list(...), file, sep, fill, labels, append) : argument 1 (type 'list') cannot be

Re: [R] RGL

2012-07-27 Thread Guillaume Meurice
Dear all, Following the advice of David Winsemius, I've restarted my R session : I was able to load rgl library (rgl_0.92.892) Sorry to have bothered you. Next time, I'll include this step before submitting to R-help ;). Anyway, thanks for support. Bests, = library(rgl)

Re: [R] RGL

2012-07-27 Thread peter dalgaard
On Jul 27, 2012, at 03:48 , David Winsemius wrote: On Jul 26, 2012, at 4:46 AM, Guillaume Meurice wrote: Dear all, I was willing to use the library rgl to plot some 3D graphics, but unfortunately, I wan't able to instal the library. The error message is below. I would be very

Re: [R] Only one class shown in SVM plot?

2012-07-27 Thread Jessica Streicher
Now i'm scratching my head as well, thought it might have to do with scaling at first, so i turned it off, and also tried scaling the data for the plot instead, but to no avail, it just switches the color, but doesn't show the correct contours. And it is at least predicting the stuff right, so

Re: [R] how to plot hazard function for coxph model?

2012-07-27 Thread David Winsemius
On Jul 26, 2012, at 9:00 AM, suman kumar wrote: Dear all, I have been trying to plot hazard function in R for survival data, but in vain. Can anybody help me out in plotting hazard function in R? I'm thinking this might not be what you want, although it is one plausible guess at what

Re: [R] Error Bars ggplot2

2012-07-27 Thread ONKELINX, Thierry
How about this? Andpleasemakeusofthelargekeyatthebottomofyourkeyboard.Itmakescodemuchmorereadable. library(ggplot2) spd - factor(c(s,f,f,s,f,s,s,s,f,f,s,f)) r - c(4.9,3.2,2.1,.2,3.8,6.4,7.5,1.7,3.4,4.1,2.2,5) dataset - data.frame(spd, r) dataset - rbind(cbind(dataset, Type = DOE, delta = 2),

Re: [R] Integrate(dnorm) with different mean and standard deviation help

2012-07-27 Thread David Winsemius
On Jul 26, 2012, at 10:06 AM, FJ M wrote: It would be a useful additon to the help page to add integrate(dnorm, lower = -1.96, upper = 1.96, mean = 2, sd = 1) Wouldn't most statisticians instead use the more accurate and undoubtedly faster: pnorm(1.96, mean=2, sd=1) - pnorm(-1.96,

Re: [R] RGL

2012-07-27 Thread Prof Brian Ripley
On 27/07/2012 09:14, peter dalgaard wrote: On Jul 27, 2012, at 03:48 , David Winsemius wrote: On Jul 26, 2012, at 4:46 AM, Guillaume Meurice wrote: Dear all, I was willing to use the library rgl to plot some 3D graphics, but unfortunately, I wan't able to instal the library. The error

Re: [R] Working with Numbers generated from Regression Output

2012-07-27 Thread David Winsemius
On Jul 27, 2012, at 12:14 AM, Krunal Nanavati wrote: Hi Jeff, Sorry for the previous email. I tried using write function, and used the following syntax write(result,file=C:\\Users\\Krunal\\Desktop\\Book1.csv) but it is giving the following error Error in cat(list(...), file, sep, fill,

Re: [R] Only one class shown in SVM plot?

2012-07-27 Thread Jessica Streicher
Found it depends on what you put in in slice, since you have to define at what constant the other variables should be held. sl-list(V3=17,V4=14,V5=4,V6=0.5,V7=26,V8=10,V9=15,V10=0,V11=0.4,V12=0.3,V13=1.2,V14=2.3,V15=4.2,V16=5.2,V17=5.1,V18=4.3,V19=3.35) plot(model,data,V1~V2,slice=sl) For

Re: [R] On Reproducible Code

2012-07-27 Thread Jim Lemon
On 07/26/2012 01:50 AM, David L Carlson wrote: We often refer requesters to the Posting Guide and chide them for not reading it. ... I hesitate to sound too optimistic, but there might be some advantage in making the statement more prominent and adding a reproducible example using dput(). The

[R] eval in parent.frame or sys.frame(0)

2012-07-27 Thread Stéphane Dray
Dear list, I try to use the eval function and to understand its functionning. I tried: xy - global f1 - function(){ xy - f1 a1 - eval.parent(xy) b1 - eval(xy, sys.frame(0)) print(paste(a1 =,a1)) print(paste(b2 =,b1)) f3 - function(){ print(F3) a3 - eval.parent(xy)

Re: [R] warning message while plotting taylor diagram

2012-07-27 Thread Jim Lemon
On 07/26/2012 10:27 PM, Henrik Singmann wrote: Dear Waheed, As you correctly inferred, these are just warnings and dont need to bother you now. The maintainer/author of the taylor.diagram function should be more worried. These warnings just say that in upcoming versions of R the functions

[R] Error accessing Vegan package

2012-07-27 Thread Bob Green
Hello, I am wanting to download the Vegan package zip file. When I tried to do this I obtained the following message: Object not found! The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about

Re: [R] Solving quadratic equation in R

2012-07-27 Thread Paul Smith
On Thu, Jul 26, 2012 at 9:48 PM, Diviya Smith diviya.sm...@gmail.com wrote: Hi there, I would like to solve a simple equation in R a^2 - a = 8.313 There is no real solution to this problem but I would like to get an approximate numerical solution. Can someone suggest how I can set this up?

Re: [R] Working with quantmod chartSeries and plot.zoo

2012-07-27 Thread Gabor Grothendieck
On Fri, Jul 27, 2012 at 1:21 AM, OTB olibir...@gmail.com wrote: Hi all, I'm a newbie to R and it has been very helpful to use your website. Unfortunately I've been struggling with my code now for two days so I wanted to ask few questions. I've been trying to create nice graphs to put into a

Re: [R] network plot problem

2012-07-27 Thread Vlatka Matkovic Puljic
Thank you Rui. With matrix works better. I got plot I have expected to have. I want to be undirected. But directed = FALSE or as.undirected(graph) are not working? Where I'd gone wrong? Shouldn't it be possible to add names instead of numbers of nods with vertex.label= ? 2012/7/26 Rui

[R] Extracting results from the VAR output

2012-07-27 Thread Rmillan
Hi everyone, I'm working with the Vector Autoregressive Model (VAR), and it seems like the ur.ca package provides the best function for this purpose. My problem is, that I don't know how to extract a certain value from the output without using the variables names. I was hoping that this could

Re: [R] Working with Numbers generated from Regression Output

2012-07-27 Thread Krunal Nanavati
Hi David, Thanks for the reply. With your first alternative, I am getting the beta values in different cells in the excel file. Is there a way to get all the information generated by the summary function in different cells in a excel file, through the write function? Also, can you please

[R] dredge solely offset models in MuMIn

2012-07-27 Thread Katarzyna Kulma
hello everyone, I'm modelling in lmer an average chick weight defined as Total.brood.mass ~ offset(chick.number), with three fixed and two random effect. Next, I want to use function dredge from MuMIn package for model averaging. Not sure why, but in consequence the offset variable is treated as

[R] an optimization problem and installation of the package Rcplex

2012-07-27 Thread Shima Shahbazi
Hello, I am an R user who wants to solve an optimization problem. To do so, I tried to install the package Rcplex on my computer (Windows7-64), so I did the same as installation Instructionshttp://www.geeklog.net/docs/english/install.html and edited the file Makevars.win by adding the path

[R] shift pie chart

2012-07-27 Thread Michael Eisenring
Dear R-help members, I did the following pie chart: R:Code= plants-c(11,5,4,4,4,3,3,3,3,3,3,2,2,2,2,2,2,43) pie(plants,labels =plant_labels,cex=0.7, col=colors) par(mar=c(0,0,4,0),oma=c(0,0,0,0)) legend(1,1,cex=0.7,pt.cex=25,

Re: [R] an optimization problem and installation of the package Rcplex

2012-07-27 Thread Prof Brian Ripley
You really need to discuss this with the package maintainer (as the posting guide asked). But there are several 'optimization' packages on CRAN which do have Windows' binary versions that would therefore be easier to use. On 27/07/2012 09:38, Shima Shahbazi wrote: Hello, I am an R user

Re: [R] add leading zeros

2012-07-27 Thread Rui Barradas
Hello, Here is a function that I wrote some time ago. # pad with zeros padz - function(x, width=max(nchar(x)), fill=0) gsub( , fill, formatC(x, width=width)) ##- test padz( c(1, 10, 100) ) padz(1:10, 4) ##- non-sense padz(-5:0, 4) padz(runif(10)) Hope this helps,

Re: [R] How can I access the title of a table read via read.csv?

2012-07-27 Thread Rui Barradas
Hello, If it's the title, i.e., the header of a table read in by read.csv maybe names(fx1) is better, since data.frames are special cases of lists. The end result is of course the same. Hope this helps, Rui Barradas Em 27-07-2012 05:22, Daniel Nordlund escreveu: -Original

Re: [R] eval in parent.frame or sys.frame(0)

2012-07-27 Thread peter dalgaard
On Jul 27, 2012, at 11:23 , Stéphane Dray wrote: Dear list, I try to use the eval function and to understand its functionning. I tried: xy - global f1 - function(){ xy - f1 a1 - eval.parent(xy) b1 - eval(xy, sys.frame(0)) print(paste(a1 =,a1)) print(paste(b2 =,b1)) f3 -

[R] Understanding the intercept value in a multiple linear regression with categorical values

2012-07-27 Thread Joao Azevedo
Hi! I'm failing to understand the value of the intercept value in a multiple linear regression with categorical values. Taking the warpbreaks data set as an example, when I do: lm(breaks ~ wool, data=warpbreaks) Call: lm(formula = breaks ~ wool, data = warpbreaks) Coefficients: (Intercept)

Re: [R] Extracting results from the VAR output

2012-07-27 Thread Rui Barradas
Hello, I'm not familiar with package urca but your problem seems to be in the access of a list member. The operator '$' is an alternative to '[[', and you are right, the latter is recommended programmatically. Try something along the lines of the following. VARrow[[ varresult ]][[

Re: [R] RGL

2012-07-27 Thread peter dalgaard
On Jul 27, 2012, at 11:05 , Prof Brian Ripley wrote: On 27/07/2012 09:14, peter dalgaard wrote: I believe we have seen the R_decompress1 error before, though. If you can reproduce it, it might be worth digging deeper --- over on R-sig-Mac. It almost always indicates a corrupted lazyload

Re: [R] eval in parent.frame or sys.frame(0)

2012-07-27 Thread Stéphane Dray
Thanks Peter. Sorry for this question... I really need holidays. Cheers. On 27/07/2012 13:30, peter dalgaard wrote: On Jul 27, 2012, at 11:23 , Stéphane Dray wrote: Dear list, I try to use the eval function and to understand its functionning. I tried: xy - global f1 - function(){ xy -

Re: [R] network plot problem

2012-07-27 Thread Rui Barradas
Hello, As for the directed = FALSE, it works with me: g - graph(given, directed = FALSE) As for the label, it's easy. Create an attribute 'name' and then set the label to that attribute. For instance, using the alphabet's letters, first uppercase. V(g)$name - c(LETTERS, letters)[V(g)] #

Re: [R] Sub-Directories

2012-07-27 Thread Ista Zahn
Hi Michael, I see some confusion here. The objects() command does not list objects in the WorkingDirectory, but objects in your R environment. R environments do not have directories or sub-directories, so I'm finding your question very confusing. Can you clarify? Best, Ista On Thu, Jul 26, 2012

Re: [R] Memisc package: imported varibles from SPSS have got wrong measurement

2012-07-27 Thread Marion Wenty
Dear David and Paul, Thank you for your answers! Yes, Paul, I checked the SPSS file and the numerical variables that had no value labels assigned to them in SPSS got the right measurements in R after importing, namely interval. The two variables that had the measurement nominal in R allthough

Re: [R] Understanding the intercept value in a multiple linear regression with categorical values

2012-07-27 Thread Jean V Adams
Joao, There's a very thorough explanation at http://www.ats.ucla.edu/stat/r/library/contrast_coding.htm Jean Joao Azevedo joao.c.azev...@gmail.com wrote on 07/27/2012 06:32:31 AM: Hi! I'm failing to understand the value of the intercept value in a multiple linear regression with

Re: [R] Understanding the intercept value in a multiple linear regression with categorical values

2012-07-27 Thread Joao Azevedo
Hi! Thanks for the link. I've already stumbled upon that explanation. I'm able to understand how the coding schemes are applied in the supplied examples, but they only use a single explanatory variable. My problem is with understanding the model when there are multiple categorical explanatory

Re: [R] network plot problem

2012-07-27 Thread Vlatka Matkovic Puljic
Thank you! It works fine now! :) 2012/7/27 Rui Barradas ruipbarra...@sapo.pt Hello, As for the directed = FALSE, it works with me: g - graph(given, directed = FALSE) As for the label, it's easy. Create an attribute 'name' and then set the label to that attribute. For instance, using the

Re: [R] shift pie chart

2012-07-27 Thread Jean V Adams
Michi, The code that you shared was incomplete. Two objects (plant_labels and colors) were not defined. The pie chart would be easier to interpret by direct labeling of slices, rather than trying to decipher a color legend. If you change the initial angle of the first slice, you can rotate

[R] puzzling classical Mahalanobis distances from covMcd() {robustbase}

2012-07-27 Thread Fraser D. Neiman
Greetings, I am puzzled about why the _classical_ Mahalanobis distances that I get using the {stats} mahalanobis() function do not match the distances I get from the {robustbase} covMcd() function. Here is an example: x - matrix(rnorm(10*3), ncol = 3) #here is the {stats} result: Sx - cov(x) D2

[R] How can I use IPF function correctly?

2012-07-27 Thread Miao Zhang
Hi All, I am trying to creat a simple example byusing ipf function in R, but i could not get it succefully...I am very new to R, does anyone could help, to instruct me about this ipf fucntion? Actually, this is what I mean 50 | 50 --

Re: [R] warning message while plotting taylor diagram

2012-07-27 Thread Henrik Singmann
Dear Jim, indeed, you are right. As the OP did not include the package name I was to lazy to check where taylor.diagram actually is from. Would I have known that it is from plotrix I would have seen that it actually is not a problem of the author but of handing over the wrong object. As I

Re: [R] Understanding the intercept value in a multiple linear regression with categorical values

2012-07-27 Thread Jean V Adams
Joao, Your intuition is correct, the intercept represents the predicted value for wool A and tension L. But, you're tripping up on how to figure out that predicted value. In the model that you fit, the predicted value for wool A and tension L is not simply the mean of the observations for

Re: [R] On Reproducible Code

2012-07-27 Thread John Kane
-Original Message- From: j...@bitwrit.com.au Sent: Fri, 27 Jul 2012 19:21:36 +1000 To: dcarl...@tamu.edu Subject: Re: [R] On Reproducible Code On 07/26/2012 01:50 AM, David L Carlson wrote: We often refer requesters to the Posting Guide and chide them for not reading it. ...

[R] producing a graph with glm poisson distributed respons count data and categorical independant variables

2012-07-27 Thread babs
Hello, I am working on my thesis and can't really figure out how to produce a reasonable graph from the output from my glm., I could just give the R-output in my results and then discuss them, but it would be more interesting if I could visualise what is going on. My research is how bees react

Re: [R] add leading zeros

2012-07-27 Thread arun
HI Rui, Not sure how to place the - before the zeros. padz(-5:0,4) [1] 00-5 00-4 00-3 00-2 00-1  padz(-(5:0),4) [1] 00-5 00-4 00-3 00-2 00-1  formatC(-5:0,width=4,format=d,flag=0) [1] -005 -004 -003 -002 -001 padz(1:-10,4)  [1] 0001 00-1 00-2 00-3 00-4 00-5 00-6 00-7 00-8

Re: [R] lmer t value for 3 levels of fixed factor

2012-07-27 Thread Ben Bolker
Obermeier Andrew andrewobermeier at me.com writes: Hello, I just joined this list today, so am worried about proper protocol, but would like to post a question about lme4. You should probably join/post this question to the r-sig-mixed-models at r-project.org mailing list, which is

Re: [R] Error accessing Vegan package

2012-07-27 Thread Ben Bolker
Bob Green bgreen at dyson.brisnet.org.au writes: I am wanting to download the Vegan package zip file. When I tried to do this I obtained the following message: Object not found! The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated.

Re: [R] add leading zeros

2012-07-27 Thread arun
HI Rui, i found it.  Though, it doesn't make much sense, trying to be consistent with formatC. padz - function(x, width=max(nchar(x)), fill=0)  gsub( ,fill, formatC(x,width=width,flag=0)) padz(-5:0,4) [1] -005 -004 -003 -002 -001 A.K. - Original Message - From: Rui Barradas

[R] How to run regressions over increasing time series

2012-07-27 Thread Philippe Hensel
Hello, I would like to run a series of regressions on my data (response variable over time): 1) regression from T1 to T2 2) regressions from T1 through T3 3) regression from T1 through T4, etc. I have been struggling to find a way to do this through commands, as opposed to cutting up the data

Re: [R] producing a graph with glm poisson distributed respons count data and categorical independant variables

2012-07-27 Thread ONKELINX, Thierry
Dear Babs, This is how I would present the model, if I had enough data to support the model. The model is too complicated for your data and leads to a perfect fit. Is this the aggregated dataset, or does your design has no replicates? Best regards, Thierry dataset$combinatie -

Re: [R] On Reproducible Code

2012-07-27 Thread Bert Gunter
I agree and would like to see it placed at the **TOP** of every post. -- Bert On Fri, Jul 27, 2012 at 7:11 AM, John Kane jrkrid...@inbox.com wrote: -Original Message- From: j...@bitwrit.com.au Sent: Fri, 27 Jul 2012 19:21:36 +1000 To: dcarl...@tamu.edu Subject: Re: [R] On

[R] overlaying a set of 'grouping' lines on a plot from image()

2012-07-27 Thread Rajarshi Guha
Hi, I have a matrix that I am displaying via image. I would like to obtain an image where the columns are 'grouped' (I have a grouping variable). But I am not sure how how I can draw the lines to indicate the grouping in the margin. I realize this is essentially waht heatmap does but as I have a

Re: [R] Solving quadratic equation in R

2012-07-27 Thread Jessica Streicher
You could have googled R solve equation, and would have easily reached http://r.789695.n4.nabble.com/R-solve-equation-td882585.html and would have in there found something like this: z - matrix(c(-8.313,-1,1), ncol=1) polyroot(z) [1] 3.42626+0i -2.42626+0i p-polyroot(z) p^2-p [1] 8.313+0i

Re: [R] names function not working at the 2nd place in a program

2012-07-27 Thread zz
I just realize this: For myVar1, I used colnames to name it firstly, and then convert myVar1 to numeric; However, I forgot to use rownames to name myVar2, instead I thought as.numeric(names(myVar2)) would work. Now I name myVar2 using rownames first, as.numeric(names(myVar2)) is working.

[R] [R-pkgs] plsdof 0.2-3: Degrees of Freedom and Statistical Inference for Partial Least Squares

2012-07-27 Thread Nicole Krämer
Dear R users, we proudly announce the latest release of our R package plsdof: Degrees of Freedom and Statistical Inference for Partial Least Squares. Features include: * Degrees of Freedom estimates for Partial Least Squares (PLS) Regression * Model selection for PLS based on various

Re: [R] add leading zeros

2012-07-27 Thread ROLL Josh F
This solution was the most elegant. Thanks everyone. Josh -Original Message- From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] Sent: Thursday, July 26, 2012 9:55 PM To: ROLL Josh F Cc: r-help@r-project.org Subject: Re: [R] add leading zeros Much easier than you think:

[R] Separating Columns in Excel Export from R

2012-07-27 Thread watsonl
Hello - When I export my files using the write.table command and name the file.xls and use the sep=/t to try and separate the columns in excel, everything just stays in one column. how do i get them all into separate columns (it did this before but i can't figure out what's different between

Re: [R] On Reproducible Code

2012-07-27 Thread John Kane
I'd vote for that! It would probably bug the blazes out of experienced users but the time savings in getting a newbie to actually supply enough information so that someone can, at least, try to answer the question would be well worth it. John Kane Kingston ON Canada -Original

Re: [R] Separating Columns in Excel Export from R

2012-07-27 Thread John Kane
I think you have a type: Try \t John Kane Kingston ON Canada -Original Message- From: watson...@hotmail.com Sent: Fri, 27 Jul 2012 09:30:34 -0700 (PDT) To: r-help@r-project.org Subject: [R] Separating Columns in Excel Export from R Hello - When I export my files using the

Re: [R] Working with Numbers generated from Regression Output

2012-07-27 Thread David Winsemius
On Jul 27, 2012, at 3:10 AM, Krunal Nanavati wrote: Hi David, Thanks for the reply. With your first alternative, I am getting the beta values in different cells in the excel file. Is there a way to get all the information generated by the summary function in different cells in a excel file,

Re: [R] Extracting results from the VAR output

2012-07-27 Thread David Winsemius
On Jul 27, 2012, at 4:34 AM, Rui Barradas wrote: Hello, I'm not familiar with package urca but your problem seems to be in the access of a list member. The operator '$' is an alternative to '[[', and you are right, the latter is recommended programmatically. Try something along the

Re: [R] how to plot hazard function for coxph model?

2012-07-27 Thread Suman Pramanik
No, this is not what i wanted. Plotting of survfit object in therneu's survival package plots survival/cumulative incidence and cumulative hazard function for a given fit. What I wanted to know was that is there a way to plot hazard function of a plot? I got the reply from Dr Therneu yesterday.

Re: [R] On Reproducible Code

2012-07-27 Thread Hadley Wickham
That assumes: * Everyone reads the mailing list before making the first posting * Everyone reads every part of every email. I'd argue that both assumptions are false. People are particular well trained to skip over boilerplate text at the bottom of emails. I'd suggest an alternative approach

Re: [R] On Reproducible Code

2012-07-27 Thread Rui Barradas
Hello, I agree with you. That's why I've proposed an itemized text. I want my VCR manual to give me point by point instructions, not to give me a clear and brief discourse on exactly what to do. And, though without access to VCR manufacturers' data tables, I'm with the impression that their

[R] path-diagram wirh Rgraphvis

2012-07-27 Thread René Mayer
Dear List, how can I draw the following path diagram A B C D E F \ | / \ | / G -- H / \/ \ I JK L the problem I've got is that G and H need to be horizontally alingned but the best I've done is diagonally or vertically alingned, kind regards, Rene ## Begin: R-code

Re: [R] Separating Columns in Excel Export from R

2012-07-27 Thread Peter Ehlers
On 2012-07-27 09:30, watsonl wrote: Hello - When I export my files using the write.table command and name the file.xls and use the sep=/t to try and separate the columns in excel, everything just stays in one column. how do i get them all into separate columns (it did this before but i can't

Re: [R] On Reproducible Code

2012-07-27 Thread Jeff Newmiller
I would like to be able to refer briefly to longer explanations such as the stackoverflow article on reproducible examples rather than patiently rewrite such explanations. A posting guide with more specific recommendations would make it easier to be patient.

Re: [R] On Reproducible Code

2012-07-27 Thread Bert Gunter
On Fri, Jul 27, 2012 at 10:47 AM, Hadley Wickham had...@rice.edu wrote: That assumes: * Everyone reads the mailing list before making the first posting * Everyone reads every part of every email. I'd argue that both assumptions are false. People are particular well trained to skip

[R] why order doesn't work?

2012-07-27 Thread cowboy
hi all, I want to get a cumsum according to the order of some variable. However, it doesnt' work. For example, ** test-data.frame(cbind(x=c(3,5,2,6,7),y=c(8,1,4,9,0))) test[order(test$x),]$sumy-cumsum(test[order(test$x),]$y) ** R complians Warning message:

Re: [R] How to run regressions over increasing time series

2012-07-27 Thread Jean V Adams
Philippe, In your example, you have four unique values for Yrs (I had to change your code a little to get it to run, so I have the modified version with my code below), and those values are what you are referring to when you say T1, T2, T3, T4, right? If I follow what you want to do, the code

Re: [R] why order doesn't work?

2012-07-27 Thread William Dunlap
test-data.frame(cbind(x=c(3,5,2,6,7),y=c(8,1,4,9,0))) test[order(test$x),]$sumy-cumsum(test[order(test$x),]$y) is asking a bit too much of R. If you add the line test$sumy - numeric(nrow(test)) between those lines you get what you want. Here are the details. The nested replacement

Re: [R] why order doesn't work?

2012-07-27 Thread Berend Hasselman
cowboy wrote hi all, I want to get a cumsum according to the order of some variable. However, it doesnt' work. For example, ** test-data.frame(cbind(x=c(3,5,2,6,7),y=c(8,1,4,9,0))) test[order(test$x),]$sumy-cumsum(test[order(test$x),]$y) ** R

Re: [R] why order doesn't work?

2012-07-27 Thread Bert Gunter
This has nothing to do with order(). The following also reproduces the behavior: test - data.frame(x=letters[1:5],y = 1:5) test[1:5,]$z - 11:15 Warning message: In `[-.data.frame`(`*tmp*`, 1:5, , value = list(x = 1:5, y = 1:5, : provided 3 variables to replace 2 variables test x y 1 a 1 2

Re: [R] overlaying a set of 'grouping' lines on a plot from image()

2012-07-27 Thread Jean V Adams
Try this: # define the locations on the x axis for each cell in the image nxcells - dim(m)[2] xlocs - (seq(nxcells)-1)/(nxcells-1) # define the groupings group - rep(1:3, c(10, 20, 25)) # calculate the range of locations on the xaxis for each group group.ranges - sapply(split(xlocs, group),

Re: [R] How can I use IPF function correctly?

2012-07-27 Thread David L Carlson
It is not clear what you are trying to do. The ipf() function you are using seems to be the one included in package cat for imputing missing values for categorical variables. For ipf() you have not read the instructions carefully because you have entered the marginal values, not their dimensions

[R] Turn categorical array into matrix with dummy variables

2012-07-27 Thread xuan zhao
Hi All, I want to turn a categorical array (array with factors) into a matrix with dummy variables. like array=c(a,a,b,b,b) should be turned into: a b 1 0 1 0 0 1 0 1 0 1 Do you know any way of doing this? Thanks -- View this message in context:

[R] bivariate normal

2012-07-27 Thread Anders Holm
Dear list members I need a function that calculates the bivariate normal distribution for each observation. It is part of a likelihood function and I have 1000's of cases. As I understand it I cannot use packages like mvtnorm because it requres a covariance matrix of the same dimension as

Re: [R] odd error with rJava

2012-07-27 Thread consutes
Hi Joshua , but, how can I do this? Thanks -- View this message in context: http://r.789695.n4.nabble.com/odd-error-with-rJava-tp4462986p4638139.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Rpart query

2012-07-27 Thread vickytha...@gmail.com
Replying to quite old thread..but its awesome RWeka package is quite good in dissecting the tree in more than 2 parts. As someone said J48 which is implementation of C4.5 and thus ID3 will be helpful. Also to plot you may have to rage a war like situation. Let us knoe if you face any problem

Re: [R] Working with quantmod chartSeries and plot.zoo

2012-07-27 Thread OTB
Hi all, I'm sorry, I didn't notice this comment. Thank you Gabor for letting me know. Following is a reproducible code and a new picture. The questions are the same but I've figured little bit out how to use textplot but I would like to have the table little bit more professional, maybe better to

[R] fitting Markov Switching Model

2012-07-27 Thread cesare orsini
Dear Users, i have this time series, the tree lines means different level, i would use a Markov switching model with two states to modelling this time series. i would obtain the relative transition matrix (2X2) the first state is above the value of 23.65 (the higher line) the second state is

[R] labeling loading vectors in vegan

2012-07-27 Thread Gordon Holtgrieve
Hello, I am using vegan to do an NMDS plot and I would like to suppress the labels for the loading vectors. Is this possible? Alternatively, how can I avoid overlap? Many thanks for the help. Example code: #perform NMDS using metaMDS() function spe.nmds-metaMDS(data, distance='bray',k=2 ,

[R] Assigning a new name to object loaded with load()

2012-07-27 Thread Alireza Mahani
I would like to load a binary file into R using load(), and then assign a new name to it, regardless of the name it was saved under. Can you please provide a code sample? Thank you! -- View this message in context:

Re: [R] Separating Columns in Excel Export from R

2012-07-27 Thread watsonl
THANK YOU R is s picky :) -- View this message in context: http://r.789695.n4.nabble.com/Separating-Columns-in-Excel-Export-from-R-tp4638124p4638147.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] why order doesn't work?

2012-07-27 Thread arun
HI, I guess you want to get the cumsum of y according to the order of x, test1-test[order(test$x),]  test2-within(test1,{cumsumy-cumsum(y)})  test2 #  x y cumsumy #3 2 4   4 #1 3 8  12 #2 5 1  13 #4 6 9  22 A#5 7 0  22 A.K. - Original Message - From: cowboy

Re: [R] lme4 t value for 3 levels of fixed factor

2012-07-27 Thread Henric (Nilsson) Winell
On 2012-07-27 05:50, Obermeier Andrew wrote: Hello, I just joined this list today, so am worried about proper protocol, but would like to post a question about lme4. The R-sig-mixed-models list (https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models) may be a better place for questions

[R] R bioconductor agilent aCGH analysis

2012-07-27 Thread Preeti
Hi, I would like to analyze some agilent aCGH copy number files. As a start, I would like to normalize this data. I don't know what is the standard way to do this. Which package is the standard one that people use for this purpose? The chips that I am looking at are the agilent sure print 1M

Re: [R] Turn categorical array into matrix with dummy variables

2012-07-27 Thread ilai
?model.matrix On Fri, Jul 27, 2012 at 11:32 AM, xuan zhao xuan.z...@sentrana.com wrote: Hi All, I want to turn a categorical array (array with factors) into a matrix with dummy variables. like array=c(a,a,b,b,b) should be turned into: a b 1 0 1 0 0 1 0 1 0 1 Do you know any way of

Re: [R] Integrate(dnorm) with different mean and standard deviation help

2012-07-27 Thread Rolf Turner
On 27/07/12 20:55, David Winsemius wrote: On Jul 26, 2012, at 10:06 AM, FJ M wrote: It would be a useful additon to the help page to add integrate(dnorm, lower = -1.96, upper = 1.96, mean = 2, sd = 1) Wouldn't most statisticians instead use the more accurate and undoubtedly faster:

Re: [R] bivariate normal

2012-07-27 Thread Rolf Turner
On 28/07/12 05:45, Anders Holm wrote: Dear list members I need a function that calculates the bivariate normal distribution for each observation. It is part of a likelihood function and I have 1000's of cases. As I understand it I cannot use packages like mvtnorm because it requres a

Re: [R] Assigning a new name to object loaded with load()

2012-07-27 Thread William Dunlap
Here is one way. You seem to assume that the save file contains exactly one object and this function makes the same assumption: theObjectSavedIn - function(saveFile) { env - new.env() load(saveFile, envir=env) loadedObjects - objects(env, all=TRUE)

Re: [R] Assigning a new name to object loaded with load()

2012-07-27 Thread Rolf Turner
On 28/07/12 06:59, Alireza Mahani wrote: I would like to load a binary file into R using load(), and then assign a new name to it, regardless of the name it was saved under. Can you please provide a code sample? Thank you! Ummm, what is the antecedent of the pronoun it in the forgoing? The

Re: [R] On Reproducible Code

2012-07-27 Thread Barry Rowlingson
On Fri, Jul 27, 2012 at 6:47 PM, Hadley Wickham had...@rice.edu wrote: I'd argue that both assumptions are false. People are particular well trained to skip over boilerplate text at the bottom of emails. One day the list owner will subtly change the boilerplate text at the bottom of R-help

  1   2   >