Re: [R] double-axis labels function of each other

2015-04-03 Thread Hurr
Yes, I keep a copy in MS Word. Would Notepad be OK? I need sleep now, will work tomorrow. -- View this message in context: http://r.789695.n4.nabble.com/double-axis-labels-function-of-each-other-tp4705457p4705463.html Sent from the R help mailing list archive at Nabble.com.

[R] RInside

2015-04-03 Thread Michel
help Hello I'm newbee with R and RInside My question is about stderr in R. Is there a way to collect R stderr in C++ program embedding R Thanks in advance Michel --- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.

[R] Package build system adds line break in DESCRIPTION URL

2015-04-03 Thread Daniel Lewandowski
Has anybody noticed that if field URL in DESCRIPTION contains a uri with 66 or more characters, then file DESCRIPTION in the resulting package includes a line break at the beginning? So this (source DESCRIPTION): URL:

[R] applying cumsum within groups

2015-04-03 Thread Morway, Eric
This small example will be applied to a problem with 1.4e6 lines of data. First, here is the dataset and a few lines of R script, followed by an explanation of what I'd like to get: dat - read.table(textConnection(ISEG IRCH val 11 265 12 260 13 234 54 39 467 54 40

Re: [R] idiom for constructing data frame

2015-04-03 Thread peter dalgaard
On 31 Mar 2015, at 20:55 , William Dunlap wdun...@tibco.com wrote: You can use structure() to attach the names to a list that is input to data.frame. E.g., dfNames - c(First, Second Name) data.frame(lapply(structure(dfNames, names=dfNames), function(name)rep(NA_real_, 5))) Yes, I

Re: [R] idiom for constructing data frame

2015-04-03 Thread William Dunlap
but wouldn't it be more to the point to do df - as.data.frame(rep(list(rep(NA_real_, 10)),3)) names(df) - names As a matter of personal style (and functional programming sensibility), I prefer not to make named objects and then modify them. Also, the names coming out of that as.data.frame

Re: [R] applying cumsum within groups

2015-04-03 Thread peter dalgaard
ave() is your friend (unfortunately named as it may be): ave(dat$seq, dat$ts, FUN=cumsum) [1] 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 1 1 1 1 1 1 1 2 2 2 2 2 2 2 1 1 1 [39] 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 On 03 Apr 2015, at 14:17 , Morway, Eric emor...@usgs.gov wrote: This small

Re: [R] Color US counties on US map using a numeric variable for color intensity

2015-04-03 Thread Adams, Jean
Dimitri, To answer your questions: The colorRamp() function creates a new function, newpal(). The value returned by newpal() is a numeric matrix of RGB color values. The rgb() function is then used to convert this numeric matrix to colors, with the argument maxColorValue giving the maximum of the

[R] question on waveletcomp plot image

2015-04-03 Thread Sudheer Joseph
Dear R experts, I have used waveletcomp package of R and was trying to get the dates formatted as month year but get below error while trying it with the example provided in http://www.hs-stat.com/projects/WaveletComp/WaveletComp_guided_tour.pdf Kindly help me with the

[R] Cut breaks in descending order

2015-04-03 Thread Wing Keong Lew
Hi, Is it a requirement to provide the break intervals of the cut function in ascending order? The help documentation for cut didn't specify this but the labels returned are reversed if I indicate the break intervals in a descending order. Here is an example tbl-data.frame(x=c(0:10))

Re: [R] applying cumsum within groups

2015-04-03 Thread David Winsemius
On Apr 3, 2015, at 5:17 AM, Morway, Eric wrote: This small example will be applied to a problem with 1.4e6 lines of data. First, here is the dataset and a few lines of R script, followed by an explanation of what I'd like to get: dat - read.table(textConnection(ISEG IRCH val 11

[R] open xlsx file using read.xls function of gdata package

2015-04-03 Thread Luigi Marongiu
Dear all, I am trying to open excel files using the gdata package. I can do that using a .xls file, but the same file, containing the same data, formatted in .xlsx gives error (R does not recognize the pattern from where to start reading the data). Doen anybody knows whether it is possible to read

Re: [R] Cut breaks in descending order

2015-04-03 Thread David Winsemius
On Apr 3, 2015, at 5:09 AM, Wing Keong Lew wrote: Hi, Is it a requirement to provide the break intervals of the cut function in ascending order? Apparently not. I get teh sam splits even with random permutations. It is apparently a requirement to make sure you labels match the sorted

Re: [R] open xlsx file using read.xls function of gdata package

2015-04-03 Thread Jeff Newmiller
I had poor luck with gdata. I have had better luck with XLConnect. There is no single best package for this, since each seems to leverage efforts made in other languages (so there are non-R configuration requirements to keep working) and Excel is a proprietary moving target. In general YMMV

Re: [R] Kruskal-Wallace power calculations.

2015-04-03 Thread Collin Lynch
Thank you very much Greg, I will give that a try. Best, Collin. On Fri, Apr 3, 2015 at 1:43 PM, Greg Snow 538...@gmail.com wrote: Here is some sample code: ## Simulation function to create data, analyze it using ## kruskal.test, and return the p-value ## change rexp to change the

Re: [R] Repeated failures to install caret package (of Max Kuhn)

2015-04-03 Thread Sarah Goslee
Hi Ron, Without knowing more it's really hard to help. What error messages are you getting? failed and no success are utterly uninformative - there are many things that could be wrong. The first thing, though, is always to check whether you have the necessary dependencies installed, eg devel

Re: [R] WEIBULL or EXPONENTIAL?

2015-04-03 Thread varin sacha
Hi Xavier, I use the fitdistrplus and logspline packages to know which distribution fits better my data. Here is an example : install.packages(fitdistrplus) library(fitdistrplus) instal.packages(logspline) library(logspline)

[R] Repeated failures to install caret package (of Max Kuhn)

2015-04-03 Thread Ronald Wyllys
For an edx course, MIT's The Analtics Edge, I need to install the caret package that was originated and is maintained by Dr. Max Kuhn of Pfizer. So far, every effort I've made to try to install.packages(caret) has failed. (I'm using R v. 3.1.3 and RStudio v. 0.98.1103 in LinuxMint 17.1)

Re: [R] Repeated failures to install caret package (of Max Kuhn)

2015-04-03 Thread Uwe Ligges
What is the error message? Best, Uwe Ligges On 03.04.2015 23:07, Ronald Wyllys wrote: For an edx course, MIT's The Analtics Edge, I need to install the caret package that was originated and is maintained by Dr. Max Kuhn of Pfizer. So far, every effort I've made to try to

[R] species names on a RDA plot

2015-04-03 Thread Antonio Silva
Dear R users I'm trying to do a RDA analysis based on Borcard et al. 2011 Numerical Ecology with R examples. What I cannot understand is why when I run the script (RDA.R) using the dataset from book (dataset1.rar) RDA triplot shows species names and when I use my dataset (dataset2.rar) species

[R] command help

2015-04-03 Thread ali alRubaiee
Dear colleagues, I wanted to run a command to do iteration for the following equation: Pj+1=TT11+FtransposeTT22F-FtransposeTT21-TT12 F+y[(Atranspose-FtransposeBtranspose)P(A-BF)] where TT11, TT22,TT12, TT21, F transpose, A, B and F are matrices and y is a scalar we want to find the iteration for

Re: [R] open xlsx file using read.xls function of gdata package

2015-04-03 Thread Hadley Wickham
You might try the readxl package - it's only available on github but it reads both xlsx and xls. All going well, it should be on its way to CRAN next week. Hadley On Friday, April 3, 2015, Luigi Marongiu marongiu.lu...@gmail.com wrote: Dear all, I am trying to open excel files using the gdata

Re: [R] glmnet: converting coefficients back to original scale

2015-04-03 Thread Suzen, Mehmet
This is interesting, can you post your lm.ridge solution as well? I suspect in glmnet, you need to use model.matrix with intercept, that could be the reason. -m __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] command help

2015-04-03 Thread Jeff Newmiller
I cannot make sense of your email. This is partly due to your use of HTML, which the Posting Guidelines warn you not to do. The symbolic language used on this mailing list is R. The linear algebra operations available in R are rather straightforward. Please read the documentation and convey

Re: [R] Kruskal-Wallace power calculations.

2015-04-03 Thread Greg Snow
Here is some sample code: ## Simulation function to create data, analyze it using ## kruskal.test, and return the p-value ## change rexp to change the simulation distribution simfun - function(means, k=length(means), n=rep(50,k)) { mydata - lapply( seq_len(k), function(i) { rexp(n[i], 1) -

Re: [R] Package build system adds line break in DESCRIPTION URL

2015-04-03 Thread Ben Bolker
Daniel Lewandowski daniel at nextpagesoft.net writes: Has anybody noticed that if field URL in DESCRIPTION contains a uri with 66 or more characters, then file DESCRIPTION in the resulting package includes a line break at the beginning? So this (source DESCRIPTION): URL:

[R] WEIBULL or EXPONENTIAL?

2015-04-03 Thread CHIRIBOGA Xavier
Dear members, I am doing a survival analysis wiith the function coxph...however I am wondering how can I know if my data follows a EXPONENTIAL or WEIBULL distribution? I have 3 censored datum. Using R studio. Thanks for the suggestions, Xavier

Re: [R-es] Mapas con spplot

2015-04-03 Thread Oscar Perpiñan
Hola, Yo lo resuelvo usando grid.rect. Tienes una posible solución aquí: https://github.com/oscarperpinan/spacetime-vis/blob/master/choropleth.R#L216 (que es una versión actualizada de este artículo https://procomun.wordpress.com/2012/02/18/maps_with_r_1/) Saludos. Oscar.

Re: [R] idiom for constructing data frame

2015-04-03 Thread Hadley Wickham
On Tue, Mar 31, 2015 at 6:42 PM, Sarah Goslee sarah.gos...@gmail.com wrote: On Tue, Mar 31, 2015 at 6:35 PM, Richard M. Heiberger r...@temple.edu wrote: I got rid of the extra column. data.frame(r=seq(8), foo=NA, bar=NA, row.names=r) Brilliant! After much fussing, including a disturbing

Re: [R] WEIBULL or EXPONENTIAL?

2015-04-03 Thread JLucke
As a start you can use an exploratory approach. Standard survival analysis texts show you how to use a log-log plot to assess whether a distribution is Weibull. Of course, the exponential is a special case of the Weibull. CHIRIBOGA Xavier xavier.chirib...@unine.ch Sent by: R-help

Re: [R] idiom for constructing data frame

2015-04-03 Thread peter dalgaard
On 03 Apr 2015, at 16:46 , William Dunlap wdun...@tibco.com wrote: df - as.data.frame(rep(list(rep(NA_real_, 10)),3)) names(df) - names As a matter of personal style (and functional programming sensibility), I prefer not to make named objects and then modify them. Also, the names

Re: [R] double-axis labels function of each other

2015-04-03 Thread John Kane
Notepad should be fine but you will, I think, still have to correct the apostrophes if you are copying from Word. Any code written in Notepad should be fine. There are several dedicated editors or IDE's for use with R that you might want to look into. RStudio, Tinn-R and EMACs with ESS