Re: [R] Optimisation and NaN Errors using clm() and clmm()

2013-04-16 Thread Rune Haubo
On 15 April 2013 13:18, Thomas thomasfox...@aol.com wrote: Dear List, I am using both the clm() and clmm() functions from the R package 'ordinal'. I am fitting an ordinal dependent variable with 5 categories to 9 continuous predictors, all of which have been normalised (mean subtracted

Re: [R] Sorting data.frame and again sorting within data.frame

2013-04-16 Thread Katherine Gobin
Dear Sir, Thanks a lot for your valuable input and guidance. Regards Katherine --- On Mon, 15/4/13, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: From: Jeff Newmiller jdnew...@dcn.davis.ca.us Subject: Re: [R] Sorting data.frame and again sorting within data.frame To: David Winsemius

Re: [R] Overlay two stat_ecdf() plots

2013-04-16 Thread PIKAL Petr
Hi Do you mean ecdf? If yes just ose add option in plot. plot(ecdf(rnorm(100, 1,2))) plot(ecdf(rnorm(100, 2,2)), add=TRUE, col=2) If not please specify from where is ecdf_stat or stat_ecdf which, as you indicate, are the same functions. Regrdas Petr -Original Message- From:

[R] Create function from string

2013-04-16 Thread Jon Olav Skoien
Dear list, I am trying to create a function from a string, and have so far solved it with eval(parse()). This works well also when using the newly created function as an argument to another function. The trouble starts when I want to use it with parLapply. Below is a much simplified example:

Re: [R] Create function from string

2013-04-16 Thread peter dalgaard
Is this what you are looking for? FUN = eval(bquote(function(x) .(parse(text = fstring)[[1]]))) FUN function (x) x + 2 FUN(3) [1] 5 On Apr 16, 2013, at 09:50 , Jon Olav Skoien wrote: Dear list, I am trying to create a function from a string, and have so far solved it with

Re: [R] Create function from string

2013-04-16 Thread Jon Olav Skoien
Thanks a lot, that seems to do exactly what I need! Best wishes, Jon On 16-Apr-13 10:21, peter dalgaard wrote: Is this what you are looking for? FUN = eval(bquote(function(x) .(parse(text = fstring)[[1]]))) FUN function (x) x + 2 FUN(3) [1] 5 On Apr 16, 2013, at 09:50 , Jon Olav Skoien

Re: [R] HMM Package parameter estimation

2013-04-16 Thread Rolf Turner
I think it's your starting values for the initial state probability distribution, i.e. c(1,1,1)/3 that cause the problem. They seem to drop you into some sort of local maximum/stationary point, a long way from the global maximum. Try, e.g. c(4,2,1)/7; this gives me:

Re: [R] ZA unit root test lag order selection

2013-04-16 Thread Matthieu Stigler
Hi Anonymous There are different methods to select lags in unit roots tests, the two you mention are not fundamentally wrong, and belong to the standard methods used, even if the IC selection is maybe now the prefered solution. Note there is some work from Perron and Ng with a refined selection

[R] assistant

2013-04-16 Thread Adelabu Ahmmed
Dear Sir/Ma, I Adelabu.A.A, one of the R-users from Nigeria. When am running a coxph command the below error was generated, and have try some idea but not going through. kindly please assist: cox1 - coxph(Surv(tmonth,status) ~ sex + age + marital + sumassure, X) Warning message: In

Re: [R] HMM Package parameter estimation

2013-04-16 Thread Ingmar Visser
It seems that indeed providing other starting values initiates iterations to take place. However, more worrisome is that the does not seem to converge, even when upping the number of iterations. Below I run a 2 state model on the same as well for comparison (I have added set.seed statements to

Re: [R] assistant

2013-04-16 Thread peter dalgaard
Looks like sumassure is treated as categorical. This sort of thing is usually a data error; it happens if one of the values can not be converted to numeric, O instead of 0, comma instead of period, etc. Check summary(X), or, to investigate more specifically, things like x - X$sumassure

[R] Splitting the Elements of character vector

2013-04-16 Thread Katherine Gobin
Dear R forum I have a data.frame df = data.frame(currency_type = c(EURO_o_n, EURO_o_n, EURO_1w, EURO_1w, USD_o_n, USD_o_n, USD_1w, USD_1w), rates = c(0.47, 0.475, 0.461, 0.464, 1.21, 1.19, 1.41, 1.43))   currency_type rates 1  EURO_o_n   0.470 2  EURO_o_n   0.475 3   EURO_1w  

Re: [R] Splitting the Elements of character vector

2013-04-16 Thread Gabor Grothendieck
On Tue, Apr 16, 2013 at 8:38 AM, Katherine Gobin katherine_go...@yahoo.com wrote: Dear R forum I have a data.frame df = data.frame(currency_type = c(EURO_o_n, EURO_o_n, EURO_1w, EURO_1w, USD_o_n, USD_o_n, USD_1w, USD_1w), rates = c(0.47, 0.475, 0.461, 0.464, 1.21, 1.19, 1.41, 1.43))

Re: [R] Splitting the Elements of character vector

2013-04-16 Thread arun
Hi, Try: df = data.frame(currency_type = c(EURO_o_n, EURO_o_n, EURO_1w, EURO_1w, USD_o_n, USD_o_n, USD_1w, USD_1w), rates = c(0.47, 0.475, 0.461, 0.464, 1.21, 1.19, 1.41, 1.43),stringsAsFactors=FALSE)  df$currency-unlist(lapply(str_split(df[,1],_),`[`,1))  

Re: [R] Splitting the Elements of character vector

2013-04-16 Thread arun
HI, You can also do this by: library(stringr) df2-data.frame(currency=word(str_replace(df[,1],_, ),1), temor=word(str_replace(df[,1],_, ),2), rates=df$rates,stringsAsFactors=FALSE)  df2 #  currency temor rates #1 EURO   o_n 0.470 #2 EURO   o_n 0.475 #3 EURO    1w 0.461 #4 EURO   

Re: [R] converting blank cells to NAs

2013-04-16 Thread arun
Hi, I am not sure about the problem. If your non-numeric vector is like: a,b,,d,e,,f vec1-unlist(str_split(readLines(textConnection(a,b,,d,e,,f)),,))  vec1[vec1==]- NA  vec1 #[1] a b NA  d e NA  f If this doesn't work, please provide an example vector. A.K. Thanks for the response.  That

[R] R process slow down after a amount of time

2013-04-16 Thread Chris82
Hi R users, I have mentioned that R is getting slower if a process with a loop runs for a while. Is that normal? Let's say, I have a code which produce an output file after one loop run. Now after 10, 15 or 20 loop runs the time between the created files is stongly increasing. Is there maybe any

Re: [R] R process slow down after a amount of time

2013-04-16 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Apr 16, 2013, at 9:52 AM, Chris82 rubenba...@gmx.de wrote: Hi R users, I have mentioned that R is getting slower if a process with a loop runs for a while. Is that normal? Let's say, I have a code which produce an output file after one loop run. Now after 10, 15 or 20 loop runs the

Re: [R] use of simulate.Arima (forecast package)

2013-04-16 Thread Rui Barradas
Hello, The help page is pretty clear, I think. You have to pass an object of class 'Arima', 'ar' or 'ets' to simulate.Arima. See, for instance the second example in the help page for ?Arima. And extend it like this: set.seed(6816) lines(simulate(air.model, nsim = 48), col = red) Hope this

Re: [R] ZA unit root test lag order selection

2013-04-16 Thread londonphd
Dear Matthieu, Many thanks for your reply. I was not sure what the best way forward in selecting lag length. Eventually I wrote a function that carries out serial correl test and AIC based lag length selections. I used urca package. Here is what I come up with in the end: zamod.A=ur.za(x,

[R] 10% off Intro R training from RStudio: NYC May 13-14, SF May 20-21

2013-04-16 Thread Hadley Wickham
Hi all, At RStudio, we're hosting our Introduction to R Workshop this May in two locations. As an R-help subscriber, we're offering 10% off! * Intro to data science with R (http://goo.gl/bplg3) May 13-14 New York City * Intro to data science with R (http://goo.gl/VCUFL) May 20-21 San

[R] varSelRF help

2013-04-16 Thread Thabungba Meetei
#this is my data set. data_set-data.frame(x0=c(1,1,0,0), x1=c(1,1,0,0),x2=c(1,1,0,0),x3=c(1,1,0,0),x4=c(1,1,0,0)) #this is my target target-c(1,1,0,0) rf.vs1 - varSelRF(data_set, as.factor(target), ntree = 500, ntreeIterat = 300, vars.drop.frac = 0.2) rf.vs1 rf.vs1[[3]] It

[R] Spatial Ananlysis: zero.policy=TRUE doesn't work for no neighbour regions??

2013-04-16 Thread Molo
Hello, I'm new to R and to Spatial Analysis and got a problem trying to create a Spatial Weights Matrix. *I us the following code to create the Neighbourslist:* library(maptools) library(spdep) library(rgdal) location_County- readShapePoly() proj4string(location_County)- CRS(+proj=longlat

[R] Help needed with data format required for package VIF

2013-04-16 Thread Jaap van Wyk
Hallo Could somebody perhaps assist with my dilemma, Package: VIF. The examples are not very clear (data is stored internally). I wish to read a .csv file (header=TRUE) and run VIF. But I get nonsensical output. I have downloaded the boston.csv file (from the referring website). How do I

Re: [R] matching multiple fields from a matrix

2013-04-16 Thread jercrowley
Hi Arun, This is excellent and elegant. I thought there had to be a relatively simple way to do this. Thank you very much. Jeremy From: arun kirshna [via R] [mailto:ml-node+s789695n4664328...@n4.nabble.com] Sent: Monday, April 15, 2013 10:34 PM To: Crowley, Jeremy Subject: Re: matching

Re: [R] 10% off Intro R training from RStudio: NYC May 13-14, SF May 20-21

2013-04-16 Thread Bert Gunter
Hadley: I don't think this is appropriate. Think of what it would be like if everyone shilled their R training and consulting wares here. Bert Sent from my iPhone -- please excuse typos. On Apr 16, 2013, at 8:09 AM, Hadley Wickham h.wick...@gmail.com wrote: Hi all, At RStudio, we're

Re: [R] Overlay two stat_ecdf() plots

2013-04-16 Thread David Winsemius
On Apr 16, 2013, at 12:45 AM, PIKAL Petr wrote: Hi Do you mean ecdf? If yes just ose add option in plot. plot(ecdf(rnorm(100, 1,2))) plot(ecdf(rnorm(100, 2,2)), add=TRUE, col=2) If not please specify from where is ecdf_stat or stat_ecdf which, as you indicate, are the same

Re: [R] odfWeave: Some questions about potential formatting options

2013-04-16 Thread Paul Miller
Hi Milan and Max, Thanks to each of you for your reply to my post. Thus far, I've managed to find answers to some of the questions I asked initially. I am now able to control the justification of the leftmost column in my tables, as well as to add borders to the top and bottom. I also

[R] Strange error with log-normal models

2013-04-16 Thread Noah Silverman
Hi, I have some data, that when plotted looks very close to a log-normal distribution. My goal is to build a regression model to test how this variable responds to several independent variables. To do this, I want to use the fitdistr tool from the MASS package to see how well my data fits

[R] the joy of spreadsheets (off-topic)

2013-04-16 Thread Sarah Goslee
Given that we occasionally run into problems with comparing Excel results to R results, and other spreadsheet-induced errors, I thought this might be of interest. http://www.nextnewdeal.net/rortybomb/researchers-finally-replicated-reinhart-rogoff-and-there-are-serious-problems The punchline: If

Re: [R] Strange error with log-normal models

2013-04-16 Thread Duncan Murdoch
On 16/04/2013 1:19 PM, Noah Silverman wrote: Hi, I have some data, that when plotted looks very close to a log-normal distribution. My goal is to build a regression model to test how this variable responds to several independent variables. To do this, I want to use the fitdistr tool from

[R] efficiently diff two data frames

2013-04-16 Thread Liviu Andronic
Dear all, What is the quickest and most efficient way to diff two data frames, so as to obtain a vector of indices (or logical) for rows/columns that differ in the two data frames? For example, Xe - head(mtcars) Xf - head(mtcars) Xf[2:4,3:5] - 55 all.equal(Xe, Xf) [1] Component 3: Mean

Re: [R] how to change the date into an interval of date?

2013-04-16 Thread arun
Hi, Please check your dput(). By using your dput() output, I am getting: $patient_id [1] 2 2 2 2 3 3 3 3 $responsed_at [1] 14755 14797 14835 14883 14755 14789 14826 14857 $number [1] 1 2 3 4 1 2 3 4 $score [1] 1 1 2 3 1 5 4 5 $.Names [1] patient_id   responsed_at number   scores 

[R] Path Diagram

2013-04-16 Thread Laura Thomas
Hi All, Apologies if this has been answered somewhere else, but I have been searching for an answer all day and not been able to find one. I am trying to plot a path diagram for a CFA I have run, I have installed Rgraphviz and run the following: pathDiagram(cfa, min.rank='item1, item2, item3,

[R] I don't understand the 'order' function

2013-04-16 Thread Julio Sergio
I thought I've understood the 'order' function, using simple examples like: order(c(5,4,-2)) [1] 3 2 1 However, I arrived to the following example: order(c(2465, 2255, 2085, 1545, 1335, 1210, 920, 210, 210, 505, 1045)) [1] 8 9 10 7 11 6 5 4 3 2 1 and I was completely

Re: [R] testInstalledBasic / testInstalledPackages

2013-04-16 Thread Marc Schwartz
On Apr 16, 2013, at 11:44 AM, Trina Patel trinarpa...@gmail.com wrote: Hi, I installed R 3.0.0 on a Windows 2008 Server. When I submitted the following code in R64, library(tools) testInstalledBasic(scope=devel) I get the following message in the R Console: library(tools)

Re: [R] I don't understand the 'order' function

2013-04-16 Thread Sarah Goslee
Hi Julio, On Tue, Apr 16, 2013 at 1:51 PM, Julio Sergio julioser...@gmail.com wrote: I thought I've understood the 'order' function, using simple examples like: order(c(5,4,-2)) [1] 3 2 1 However, I arrived to the following example: order(c(2465, 2255, 2085, 1545, 1335, 1210,

Re: [R] I don't understand the 'order' function

2013-04-16 Thread Rui Barradas
Hello, Inline. Em 16-04-2013 18:51, Julio Sergio escreveu: I thought I've understood the 'order' function, using simple examples like: order(c(5,4,-2)) [1] 3 2 1 However, I arrived to the following example: order(c(2465, 2255, 2085, 1545, 1335, 1210, 920, 210, 210, 505, 1045))

Re: [R] I don't understand the 'order' function

2013-04-16 Thread arun
Hi, vec1- c(2465, 2255, 2085, 1545, 1335, 1210, 920, 210, 210, 505, 1045) vec1[order(vec1)]  #[1]  210  210  505  920 1045 1210 1335 1545 2085 2255 2465 order(vec1)  #[1]  8  9 10  7 11  6  5  4  3  2  1 sort(vec1,index.return=TRUE) #$x  #[1]  210  210  505  920 1045 1210 1335 1545 2085 2255 2465

Re: [R] I don't understand the 'order' function

2013-04-16 Thread Duncan Murdoch
On 16/04/2013 1:51 PM, Julio Sergio wrote: I thought I've understood the 'order' function, using simple examples like: order(c(5,4,-2)) [1] 3 2 1 However, I arrived to the following example: order(c(2465, 2255, 2085, 1545, 1335, 1210, 920, 210, 210, 505, 1045)) [1] 8 9 10 7

Re: [R] the joy of spreadsheets (off-topic)

2013-04-16 Thread John Kane
When in doubt, assume the spreadsheet is wrong. I suggested this to someone have a problem with R vs Excel results a while ago. When I checked back with him -- there was a spreadsheet error. I think a t-shirt with the motto Friends don't let friends use spreadsheets[1] sounds like a good

Re: [R] 10% off Intro R training from RStudio: NYC May 13-14, SF May 20-21

2013-04-16 Thread John Kane
-Original Message- From: gunter.ber...@gene.com Sent: Tue, 16 Apr 2013 09:43:14 -0700 To: h.wick...@gmail.com Subject: Re: [R] 10% off Intro R training from RStudio: NYC May 13-14, SF May 20-21 Hadley: I don't think this is appropriate. Think of what it would be like if

Re: [R] I don't understand the 'order' function

2013-04-16 Thread Julio Sergio
Julio Sergio juliosergio at gmail.com writes: I thought I've understood the 'order' function, using simple examples like: Thanks to you all!... As Sarah said, what was damaged was my understanding ( ;-) )... and as Duncan said, I was confusing 'order' with 'rank', thanks! Now I understand

Re: [R] 10% off Intro R training from RStudio: NYC May 13-14, SF May 20-21

2013-04-16 Thread Barry Rowlingson
On Tue, Apr 16, 2013 at 5:43 PM, Bert Gunter gunter.ber...@gene.com wrote: Hadley: I don't think this is appropriate. Think of what it would be like if everyone shilled their R training and consulting wares here. Everyone does, don't they? A search on Nabble shows up regular postings from

Re: [R] I don't understand the 'order' function

2013-04-16 Thread Ted Harding
[See in-line below[ On 16-Apr-2013 17:51:41 Julio Sergio wrote: I thought I've understood the 'order' function, using simple examples like: order(c(5,4,-2)) [1] 3 2 1 However, I arrived to the following example: order(c(2465, 2255, 2085, 1545, 1335, 1210, 920, 210, 210, 505,

Re: [R] efficiently diff two data frames

2013-04-16 Thread Rui Barradas
Hello, Maybe Petr Savicky's answer in the link https://stat.ethz.ch/pipermail/r-help/2012-February/304830.html can lead you to what you want. I've changed his function a bit in order to return a logical vector into the rows where different rows return TRUE. setdiffDF2 - function(A, B){

Re: [R] 10% off Intro R training from RStudio: NYC May 13-14, SF May 20-21

2013-04-16 Thread Mark Leeds
Hi Bert: given what Hadley and Rstudio have provided to the R-community, what's the big deal of letting people know about a class. It's the ideal place to send the notice. and yes, as Barry and John said, every other commercial entity does send to the R-list. Mark On Tue, Apr 16, 2013 at

Re: [R] the joy of spreadsheets (off-topic)

2013-04-16 Thread Frank Harrell
What a terrific article. Thanks for sharing! The more we critically examine how research is actually done the more frightened we become. Frank -- Frank E Harrell Jr Professor and Chairman School of Medicine Department of Biostatistics Vanderbilt University

Re: [R] 10% off Intro R training from RStudio: NYC May 13-14, SF May 20-21

2013-04-16 Thread Hadley Wickham
Hi Bert, We are following the mailing list guidelines to the best of our knowledge (e.g. http://r.789695.n4.nabble.com/R-development-master-class-NYC-Dec-12-13-td4037031.html#a4038699). It's our belief (as shared by others) that advertising our courses falls under the general aegis of helping

[R] avoid losing data.frame attributes on cbind()

2013-04-16 Thread Liviu Andronic
Dear all, How should I add several variables to a data frame without losing the attributes of the df? Consider the following: require(Hmisc) Xa - iris label(Xa, self=T) - Some df label str(Xa) 'data.frame': 150 obs. of 5 variables: $ Sepal.Length: num 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9

Re: [R] the joy of spreadsheets (off-topic)

2013-04-16 Thread John Kane
I tend to live in fear that some spreadsheet calculating a drug dose for me will use my telephone number rather than my weight. John Kane Kingston ON Canada -Original Message- From: f.harr...@vanderbilt.edu Sent: Tue, 16 Apr 2013 13:20:46 -0500 To: r-h...@stat.math.ethz.ch

[R] Model ranking (AICc, BIC, QIC) with coxme regression

2013-04-16 Thread Rémi Lesmerises
Hi, I'm actually trying to rank a set of candidate models with an information criterion (AICc, QIC, BIC). The problem I have is that I use mixed-effect cox regression only available with the package {coxme} (see the example below). #Model1 spring.cox - coxme (Surv(start, stop, Real_rand) ~

Re: [R] I don't understand the 'order' function

2013-04-16 Thread William Dunlap
I think Duncan said that order and rank were inverses (if there are no ties). order() has period 2 so order(order(x)) is also rank(x) if there are no ties. E.g., data.frame(x, o1=order(x), o2=order(order(x)), o3=order(order(order(x))), o4=order(order(order(order(x, rank=rank(x)) x

Re: [R] need help with R

2013-04-16 Thread John Kane
Of course but you should carefully read the guidelines (see bottom of post and it is a good idea to read Reproducibility https://github.com/hadley/devtools/wiki/Reproducibility http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example for some useful suggestions on

Re: [R] avoid losing data.frame attributes on cbind()

2013-04-16 Thread arun
HI, Not sure if this helps: library(plyr) res-mutate(Xa,var1=round(Sepal.Length),var2=round(Sepal.Width)) str(res) #'data.frame':    150 obs. of  7 variables: # $ Sepal.Length: num  5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ... # $ Sepal.Width : num  3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ... # $

Re: [R] Path Diagram

2013-04-16 Thread John Fox
Dear Laura, This works for me. Is dot on your system path? Best, John --- John Fox Senator McMaster Professor of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada -Original Message- From:

Re: [R] Problem with handling of attributes in xmlToList in XML package

2013-04-16 Thread santiago gil
Are my emails getting through? 2013/4/14 santiago gil sg.c...@gmail.com: Hello all, I have a problem with the way attributes are dealt with in the function xmlToList(), and I haven't been able to figure it out for days now. Say I have a document (produced by nmap) like this: mydoc -

Re: [R] 10% off Intro R training from RStudio: NYC May 13-14, SF May 20-21

2013-04-16 Thread Michael Weylandt
On Apr 16, 2013, at 12:43, Bert Gunter gunter.ber...@gene.com wrote: Hadley: I don't think this is appropriate. Think of what it would be like if everyone shilled their R training and consulting wares here. Echoing others, this seems an accepted practice on the lists, endorsed at least

Re: [R] Problem with handling of attributes in xmlToList in XML package

2013-04-16 Thread David Winsemius
Yes. This is the third such copy. You can view them all in the Archive, starting with the first one: https://stat.ethz.ch/pipermail/r-help/2013-April/351504.html On Apr 16, 2013, at 11:49 AM, santiago gil wrote: Are my emails getting through? 2013/4/14 santiago gil sg.c...@gmail.com:

Re: [R] Problem with handling of attributes in xmlToList in XML package

2013-04-16 Thread Eva Prieto Castro
Hi, Santiago: Yes, your e-mail has been received. I'm sorry, I can't solve your question. Regards. Eva --- El mar, 16/4/13, santiago gil sg.c...@gmail.com escribió: De: santiago gil sg.c...@gmail.com Asunto: Re: [R] Problem with handling of attributes in xmlToList in XML package Para:

Re: [R] Strange error with log-normal models

2013-04-16 Thread Thomas Lumley
On Wed, Apr 17, 2013 at 5:19 AM, Noah Silverman noahsilver...@ucla.eduwrote: Hi, I have some data, that when plotted looks very close to a log-normal distribution. My goal is to build a regression model to test how this variable responds to several independent variables. [snip] When I

Re: [R] converting blank cells to NAs

2013-04-16 Thread David Winsemius
On Apr 16, 2013, at 6:38 AM, arun wrote: Hi, I am not sure about the problem. If your non-numeric vector is like: a,b,,d,e,,f vec1-unlist(str_split(readLines(textConnection(a,b,,d,e,,f)),,)) vec1[vec1==]- NA vec1 #[1] a b NA d e NA f If this doesn't work, please provide an

[R] Singular design matrix in rq

2013-04-16 Thread Jonathan Greenberg
Quantreggers: I'm trying to run rq() on a dataset I posted at: https://docs.google.com/file/d/0B8Kij67bij_ASUpfcmJ4LTFEUUk/edit?usp=sharing (it's a 1500kb csv file named singular.csv) and am getting the following error: mydata - read.csv(singular.csv) fit_spl - rq(raw_data[,1] ~

Re: [R] Problem with handling of attributes in xmlToList in XML package

2013-04-16 Thread Ben Tupper
Hi, On Apr 16, 2013, at 2:49 PM, santiago gil wrote: 2013/4/14 santiago gil sg.c...@gmail.com: Hello all, I have a problem with the way attributes are dealt with in the function xmlToList(), and I haven't been able to figure it out for days now. I have not used xmlToList(), but I find

Re: [R] Strange error with log-normal models

2013-04-16 Thread Noah Silverman
@Duncan, You make a very good point. Somehow I overlooked that 0 is not positive. I guess that rules out the log normal model. My challenge here is finding the right model for this data. Originally it was a nice count of students. Relatively easy to model with a zero inflated Poisson

Re: [R] R process slow down after a amount of time

2013-04-16 Thread Marc Girondot
Le 16/04/13 15:52, Chris82 a écrit : Hi R users, I have mentioned that R is getting slower if a process with a loop runs for a while. Is that normal? Let's say, I have a code which produce an output file after one loop run. Now after 10, 15 or 20 loop runs the time between the created files is

Re: [R] Strange error with log-normal models

2013-04-16 Thread Marc Schwartz
Noah, You might want to look at beta regression, using the betareg package on CRAN. There is a JSS paper here that you might find helpful: http://www.jstatsoft.org/v34/i02/paper along with the vignettes for the package: http://cran.r-project.org/web/packages/betareg/vignettes/betareg.pdf

Re: [R] avoid losing data.frame attributes on cbind()

2013-04-16 Thread arun
Hi, Another method would be: Xc- Xa  Xc$var1-NA; Xc$var2- NA Xc[]- append(as.list(Xa),as.list(Xb)) str(Xc) #'data.frame':    150 obs. of  7 variables: # $ Sepal.Length: num  5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ... # $ Sepal.Width : num  3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ... # $ Petal.Length:

Re: [R] avoid losing data.frame attributes on cbind()

2013-04-16 Thread arun
Just to add:  Xc[]- append(Xa,Xb) #should also work str(Xc) #'data.frame':    150 obs. of  7 variables: # $ Sepal.Length: num  5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ... # $ Sepal.Width : num  3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ... # $ Petal.Length: num  1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...

Re: [R] Strange error with log-normal models

2013-04-16 Thread peter dalgaard
On Apr 16, 2013, at 22:20 , Noah Silverman wrote: @Duncan, You make a very good point. Somehow I overlooked that 0 is not positive. I guess that rules out the log normal model. My challenge here is finding the right model for this data. Originally it was a nice count of students.

Re: [R] testInstalledBasic / testInstalledPackages

2013-04-16 Thread Trina Patel
Hi Marc, Thank you for the links to all the resources, I will be sure to review them in detail. As for running, Sys.setenv(LC_COLLATE = C, LANGUAGE = en) I'm sorry that I forgot to mention that I did set the above enviornmental variables as specified. Both within R, as suggested in your email,

Re: [R] the joy of spreadsheets (off-topic)

2013-04-16 Thread Jim Lemon
On 04/17/2013 03:25 AM, Sarah Goslee wrote: ... Ouch. (Note: I know nothing about the site, the author of the article, or the study in question. I was pointed to it by someone else. But if true: highly problematic.) Sarah There seem to be three major problems described here, and only one is

[R] Understanding why a GAM can't suppress an intercept

2013-04-16 Thread Andrew Crane-Droesch
Dear List, I've just tried to specify a GAM without an intercept -- I've got one of the (rare) cases where it is appropriate for E(y) - 0 as X -0. Naively running a GAM with the -1 appended to the formula and the calling predict.gam, I see that the model isn't behaving as expected. I

[R] Understanding why a GAM can't have an intercept

2013-04-16 Thread Andrew Crane-Droesch
Dear List, I've just tried to specify a GAM without an intercept -- I've got one of the (rare) cases where it is appropriate for E(y) - 0 as X -0. Naively running a GAM with the -1 appended to the formula and the calling predict.gam, I see that the model isn't behaving as expected. I don't

Re: [R] I don't understand the 'order' function

2013-04-16 Thread Julio Sergio
William Dunlap wdunlap at tibco.com writes: I think Duncan said that order and rank were inverses (if there are no ties). order() has period 2 so order(order(x)) is also rank(x) if there are no ties. E.g., Thanks William! This is very interesting. So, applying order two times I can

Re: [R] Understanding why a GAM can't have an intercept

2013-04-16 Thread Andrew Crane-Droesch
please deleter this thread -- wrong title On 04/16/2013 02:35 PM, Andrew Crane-Droesch wrote: Dear List, I've just tried to specify a GAM without an intercept -- I've got one of the (rare) cases where it is appropriate for E(y) - 0 as X -0. Naively running a GAM with the -1 appended to the

Re: [R] Singular design matrix in rq

2013-04-16 Thread William Dunlap
Have you looked at the result of bs(raw_data[,i], df=15) ? If there are not many unique values in the input there will be a lot of NaN's in the output (because there are repeated knots) and those NaN's will cause rq() to give that message. E.g., d - data.frame(y=sin(1:100),

[R] plot 2 y axis

2013-04-16 Thread Ye Lin
Hi, I want to plot two variables on the same graph but with two y axis just like what you can do in Excel. I searched online that seems like you can not achieve that in ggplot. So is there anyway I can do it in a nice way in basic plot? Suppose my data looks like this: WeightHeight Date

Re: [R] Problem with handling of attributes in xmlToList in XML package

2013-04-16 Thread santiago gil
I apologize for the multiple posting then, it's just that I received those emails saying that my post was awaiting approval and more than four days went by without news. Sorry for the lack of patience. Thank you very much, Ben. Indeed that's how I've been doing it so far, but I have accrued too

Re: [R] plot 2 y axis

2013-04-16 Thread Jim Lemon
On 04/17/2013 08:35 AM, Ye Lin wrote: Hi, I want to plot two variables on the same graph but with two y axis just like what you can do in Excel. I searched online that seems like you can not achieve that in ggplot. So is there anyway I can do it in a nice way in basic plot? Suppose my data

Re: [R] Strange error with log-normal models

2013-04-16 Thread Ben Bolker
peter dalgaard pdalgd at gmail.com writes: On Apr 16, 2013, at 22:20 , Noah Silverman wrote: My challenge here is finding the right model for this data. Originally it was a nice count of students. Relatively easy to model with a zero inflated Poisson model. The resulting residuals

[R] Q-Q Plot for comparing two unequal data sets

2013-04-16 Thread Janh Anni
Hello All, Would anyone be able to help me understand how R computes a quantile-quantile plot for comparing two data samples with unequal sample sizes? Normally, the procedure should be to rearrange the larger data sample into n equally-spaced parts using interpolation, where n is the sample

[R] failed to download vegan

2013-04-16 Thread Elaine Kuo
Hello, This is Elaine. I am using R 3.0 to download package vegan but failed. The warning message is package ‘vegan’ successfully unpacked and MD5 sums checked Warning: unable to move temporary installation ‘C:\Users\elaine\Documents\R\win-library\3.0\file16c82da53b1b\vegan’ to

Re: [R] Q-Q Plot for comparing two unequal data sets

2013-04-16 Thread Michael Weylandt
On Apr 16, 2013, at 20:12, Janh Anni annij...@gmail.com wrote: Hello All, Would anyone be able to help me understand how R computes a quantile-quantile plot for comparing two data samples with unequal sample sizes? Normally, the procedure should be to rearrange the larger data sample

Re: [R] failed to download vegan

2013-04-16 Thread Elaine Kuo
Hello All, I manually moved the vegan.zip to ‘C:\Users\elaine\Documents\R\ win-library\3.0\vegan’. Then unzipping the file. It worked to require vegan Elaine On Wed, Apr 17, 2013 at 8:56 AM, Elaine Kuo elaine.kuo...@gmail.com wrote: Hello, This is Elaine. I am using R 3.0 to download

Re: [R] Problem with handling of attributes in xmlToList in XML package

2013-04-16 Thread Ben Tupper
Hi, On Apr 16, 2013, at 6:39 PM, santiago gil wrote: Thank you very much, Ben. Indeed that's how I've been doing it so far, but I have accrued too many reasons not to work with the XML object any more and move all my coding to a list formulation. I wonder what you mean with [...] but I

Re: [R] Q-Q Plot for comparing two unequal data sets

2013-04-16 Thread Janh Anni
Hello Michael, Thanks for that information. Regards Janh On Tue, Apr 16, 2013 at 9:13 PM, Michael Weylandt michael.weyla...@gmail.com wrote: On Apr 16, 2013, at 20:12, Janh Anni annij...@gmail.com wrote: Hello All, Would anyone be able to help me understand how R computes a

Re: [R] R question

2013-04-16 Thread arun
HI Philippos, Try this: dat1- read.csv(Validation_data_set3.csv,sep=,,stringsAsFactors=FALSE) #converted to csv str(dat1) #'data.frame':    12573 obs. of  17 variables: # $ Removed.AGC  : num  65.67 46.17 41.26 14.09 5.38 ... # $ Removed.SST   

[R] Unsubscribe please

2013-04-16 Thread Bert Verleysen (beverconsult)
Verstuurd vanaf mijn iPad Bert Verleysen 00 32 (0)477 874 272 www.beverconsult.be __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

[R] Change the default resolution for plotting figures?

2013-04-16 Thread jtang
Hi, I want to save a plot in the windows device as png and the default resolution is 72dpi. Is it possible to increase the default resolution to for example 300 dpi? I have thought of using function png(..., res=300), but the problem is that the figure produced this way looks different than

Re: [R] normalizePath

2013-04-16 Thread yvonne young
maybe something wrong with your R_LIBS(it should be R_LIBS=dir/R- 3.0.0/lib64/) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] Change the default resolution for plotting figures?

2013-04-16 Thread Janesh Devkota
I have been using the following so far without having any problems: dev.copy(png,sample.png,width=8, height=10, units=in,res=500) dev.off() On Tue, Apr 16, 2013 at 6:32 PM, jt...@mappi.helsinki.fi wrote: Hi, I want to save a plot in the windows device as png and the default resolution is

Re: [R] Unsubscribe please

2013-04-16 Thread Pascal Oettli
Hi, Do it yourself: https://stat.ethz.ch/mailman/listinfo/r-help Hint: Bbottom of the page (To unsubscribe from R-help) Regards, Pascal On 04/17/2013 06:33 AM, Bert Verleysen (beverconsult) wrote: Verstuurd vanaf mijn iPad Bert Verleysen 00 32 (0)477 874 272 www.beverconsult.be

Re: [R] Merge

2013-04-16 Thread arun
Hi Farnoosh, YOu can use either ?merge() or ?join() DataA- read.table(text= ID     v1     1     10 2     1 3     22 4     15 5     3 6     6 7     8 ,sep=,header=TRUE) DataB- read.table(text= ID v2 2 yes 5 no 7 yes ,sep=,header=TRUE,stringsAsFactors=FALSE)

[R] Transformation of a variable in a dataframe

2013-04-16 Thread jpm miao
HI, I have a dataframe with two variable A, B. I transform the two variable and name them as C, D and save it in a dataframe dfcd. However, I wonder why can't I call them by dfcd$C and dfcd$D? Thanks, Miao A=c(1,2,3) B=c(4,6,7) dfab-data.frame(A,B) C=dfab[A]*2 D=dfab[B]*3

Re: [R] Transformation of a variable in a dataframe

2013-04-16 Thread Pascal Oettli
Hi, Because a column name exists for C and D: colnames(C) [1] A colnames(D) [1] B One possibility: A=c(1,2,3) B=c(4,6,7) dfab-data.frame(A,B) C=dfab$A*2 D=dfab$B*3 dfcd-data.frame(C,D) dfcd C D 1 2 12 2 4 18 3 6 21 dfcd$C [1] 2 4 6 HTH, Pascal On 04/17/2013 02:33 PM, jpm miao