Re: [R] Growth calculation

2013-10-08 Thread mohan . radhakrishnan
Hi, I came across this type of growth rate( http://data.princeton.edu/eco572/grdt.html ) analysis. But I have the number of user sessions as a plot of numbers varying over time. There are two curves. and the second curve has more sessions but they vary over time. Users login and logo

[R] What is the difference between Reduce(…) and do.call(…) ?

2013-10-08 Thread Asis Hallab
Dear R-Experts, using both do.call(…) and Reduce(…), I wonder about the differences of both. Please consider the following example: m <- matrix( 1:9, ncol=3 ) lst <- list( m, 2*m, 3*m ) rbind( lst ) # Returns [,1] [,2] [,3] tmp.lst Integer,9 Numeric,9 Numeric,9 do.call( 'rbind

Re: [R] What is the difference between Reduce(…) and do.call(…) ?

2013-10-08 Thread Barry Rowlingson
On Tue, Oct 8, 2013 at 10:22 AM, Asis Hallab wrote: > Dear R-Experts, > So, what is the difference between Reduce and do.call and when best to > use which? >From the help: ‘Reduce’ uses a binary function to successively combine the elements of a given vector and a possibly given initial va

[R] row sum with all absence in a presence-absence matrix

2013-10-08 Thread Elaine Kuo
Dear list I have a matrix composed of islandID as rows and speciesID as columns. IslandID: Island A, B, C….O (15 islands in total) SpeciesID: D0001, D0002, D0003….D0100 (100 species in total) The cell of the matrix describes presence (1) or absence (0) of the species in an island. Now I

Re: [R] row sum with all absence in a presence-absence matrix

2013-10-08 Thread Jim Lemon
On 10/08/2013 10:21 PM, Elaine Kuo wrote: Dear list I have a matrix composed of islandID as rows and speciesID as columns. IslandID: Island A, B, C….O (15 islands in total) SpeciesID: D0001, D0002, D0003….D0100 (100 species in total) The cell of the matrix describes presence (1) or absenc

[R] na.action within glmmADMB package?

2013-10-08 Thread Marta Lomas
Hello everybody, I would like to know if within the glmmADMB package into R interface there is a way to deal with the NAs different than applying "dataformodeling= na.omit(dataframe)". This way as you may know removes all the rows of the data set with at leas 1 NA. I would rather prefer to r

Re: [R] frailtypack

2013-10-08 Thread cf2059
Hello, I am encountering very similar problems with frailtypack (only, it seems, 3 years later). I would be incredibly grateful if you would be willing to share any solutions you happened upon for the problem you mention. I have a datafile that is even longer than yours (over 15000 events). Event

[R] Lattice z colours when using formula class

2013-10-08 Thread Grace Garner
Dear all, I'm using Windows 7, R version 2.15.0 and lattice_0.20-6. I'm plotting observed data in lattice using wireframe(). I have 3 matrices of observed values (Temp,Dist,Time) and I'm using the formula method (Temp~Dist*Time). How do I instruct wireframe to colour the plot surface based o

Re: [R] na.action within glmmADMB package?

2013-10-08 Thread Ben Bolker
Marta Lomas hotmail.com> writes: > > Hello everybody, > > I would like to know if within the glmmADMB package into R interface > there is a way to deal with the NAs > different than applying "dataformodeling= na.omit(dataframe)". > This way as you may know removes all > the rows of the data

[R] Latin Hypercube Sample and transformation to uniformly distributed integers or classes

2013-10-08 Thread Johannes Radinger
Hi, I'd like to use Latin Hypercube Sampling (LHC) in the the context of uncertainty / sensitivity analysis of a complex model with approximately 10 input variables. With the LHC approach I'd like to generate parameter combinations for my model input variables. Therefore I came across an simple ex

Re: [R] Latin Hypercube Sample and transformation to uniformly distributed integers or classes

2013-10-08 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Johannes Radinger > Sent: Tuesday, October 08, 2013 3:38 PM > To: R help > Subject: [R] Latin Hypercube Sample and transformation to uniformly > distributed integers or classe

[R] how to check the accuracy for maxent ?

2013-10-08 Thread Vineet Shukla
I was going through this example of maxent use: http://cran.r-project.org/web/packages/maxent/maxent.pdf # LOAD LIBRARY library(maxent) # READ THE DATA, PREPARE THE CORPUS, and CREATE THE MATRIX data <- read.csv(system.file("data/NYTimes.csv.gz",package="maxent")) corpus <- Corpus(VectorSource(da

Re: [R] Latin Hypercube Sample and transformation to uniformly distributed integers or classes

2013-10-08 Thread Duncan Murdoch
On 08/10/2013 9:37 AM, Johannes Radinger wrote: Hi, I'd like to use Latin Hypercube Sampling (LHC) in the the context of uncertainty / sensitivity analysis of a complex model with approximately 10 input variables. With the LHC approach I'd like to generate parameter combinations for my model inp

Re: [R] row sum with all absence in a presence-absence matrix

2013-10-08 Thread arun
Hi, Try: set.seed(49) mat1<- matrix(sample(0:1,15*100,replace=TRUE),nrow=15,ncol=100,dimnames=list(LETTERS[1:15],paste0("D",sprintf("%04d",1:100  rowSums(mat1[rownames(mat1)%in% c("A","D","L"),]) # A  D  L #44 55 50 A.K. - Original Message - From: Elaine Kuo To: "r-help@r-proj

[R] rbenchmark: why is function benchmark back-quoted?

2013-10-08 Thread Prof J C Nash (U30A)
I'm wondering what the purpose of the back-quoting of the name is, since benchmark seems a valid name. The language reference does mention back-quoting names to make them syntactic names, but I found no explanation of the "why". Can someone give a concise reason? JN _

[R] matrix of mean values

2013-10-08 Thread Nico Met
Dear all, I have a data set where I want to make a matrix of the mean values using 3rd column (value). Where rows are unique “loc” and columns would be “variables”. If there is one observation or no observation just use “NA”. > dput(d1) structure(list(loc = structure(c(6L, 9L, 9L, 9L, 9L, 4L, 4

Re: [R] matrix of mean values

2013-10-08 Thread arun
To make it matrix: row.names(res)<- res[,1]  res1<- as.matrix(res[,-1]) A.K. - Original Message - From: arun To: Nico Met Cc: R help Sent: Tuesday, October 8, 2013 10:54 AM Subject: Re: [R] matrix of mean values Try: d1$value<-as.numeric(gsub(",","",as.character(d1$value))) librar

[R] problems with package COZIGAM

2013-10-08 Thread Lauria, Valentina
Dear All I am having problems to install the package COZIGAM. Despite I have the update version of R (3.0.2) when I try to load the package I cannot find it in the list of available packages. If I try to install it from a local zip file I do get this error message: Error in read.dcf(file.path(p

[R] goodness of fit for nonlinear quantile regression

2013-10-08 Thread Elsa Youngsteadt
Hello, I am having trouble obtaining AIC or pseudo R^2 for nonlinear quantile regression fits. I would like to use one of these measures to compare non-nested models (each with a single, unique predictor variable). I am trying to fit the following gaussian peak model using the quantreg package:

Re: [R] problems with package COZIGAM

2013-10-08 Thread David Winsemius
On Oct 8, 2013, at 7:03 AM, Lauria, Valentina wrote: > Dear All I am having problems to install the package COZIGAM. > > Despite I have the update version of R (3.0.2) when I try to load the package > I cannot find it in the list of available packages. > > If I try to install it from a local z

Re: [R] rbenchmark: why is function benchmark back-quoted?

2013-10-08 Thread Duncan Murdoch
On 08/10/2013 10:44 AM, Prof J C Nash (U30A) wrote: I'm wondering what the purpose of the back-quoting of the name is, since benchmark seems a valid name. The language reference does mention back-quoting names to make them syntactic names, but I found no explanation of the "why". Can someone giv

Re: [R] rbenchmark: why is function benchmark back-quoted?

2013-10-08 Thread Jeff Newmiller
Your use of the English language is failing to communicate. You mention "the name" when "name" is not a proper noun. Are you referring to some specific example? --- Jeff NewmillerThe . .

Re: [R] matrix of mean values

2013-10-08 Thread Nico Met
Dear Arun, thanks for the solution. however, for my data I am getting this warning message Warning messages: 1: In mean.default(.value[0], ...) : argument is not numeric or logical: returning NA what can be the cause of it? Regards Nico On Tue, Oct 8, 2013 at 4:56 PM, arun wrote: > To mak

Re: [R] rbenchmark: why is function benchmark back-quoted?

2013-10-08 Thread Prof J C Nash (U30A)
The function 'benchmark' which is the only one in package 'rbenchmark' has a back-quoted name in its first line `benchmark` <- function( I wondered whether this had specific importance. It appears not. JN On 13-10-08 11:15 AM, Jeff Newmiller wrote: Your use of the English language is f

[R] Summary functions in sqldf() XXXX

2013-10-08 Thread Dan Abner
Hi everyone, Is it possible to obtain the 1st & 3rd quartiles & the median in a sqldf() select statement? If so, can you please provide the summary fn code? Thanks! Dan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] goodness of fit for nonlinear quantile regression

2013-10-08 Thread Roger Koenker
Elsa, It is usual to write to package authors/maintainers about packages before trying R-help. Inference for nonlinear quantile regression is still a bit underdeveloped. To get logLik you can use: logLik.nlrq <- function (object, ...) { n <- length(object$m$resid()) p <- length(object$m

Re: [R] problems with package COZIGAM

2013-10-08 Thread David Winsemius
On Oct 8, 2013, at 8:14 AM, Lauria, Valentina wrote: > Dear David, > > Your answer does not really solve the problem as I have already downloaded > the COZIGAM zip package (see my previous message). My response was intended to raise questions that you have not yet considered. You should be as

Re: [R] Lattice z colours when using formula class

2013-10-08 Thread Grace Garner
I've found one solution, which is to transform each matrix into a 1d array. This gives me the output I wanted. Grace On 08/10/2013 09:55, Grace Garner wrote: Dear all, I'm using Windows 7, R version 2.15.0 and lattice_0.20-6. I'm plotting observed data in lattice using wireframe(). I have 3

Re: [R] Information Frequency problem calculation

2013-10-08 Thread arun
Dear Jarod, You can call me Arun.  a<- read.table(text="NAME1    NAME2    RNA mauro    francesco    E234 luca    giuseppe    E5578 luca    franco    E5569 maria    luca    E4556 maria    mauro    E4556 luisa    mara    E4755 mara    luca    E234 luigi    veronica    E234 mauro    veronica    E235

Re: [R] matrix of mean values

2013-10-08 Thread arun
Try: d1$value<-as.numeric(gsub(",","",as.character(d1$value))) library(reshape2) res <- dcast(d1,loc~variables,value.var="value",mean) A.K. - Original Message - From: Nico Met To: R help Cc: Sent: Tuesday, October 8, 2013 10:47 AM Subject: [R] matrix of mean values Dear all, I have a

Re: [R] rbenchmark: why is function benchmark back-quoted?

2013-10-08 Thread Yihui Xie
I think there are two possibilities: (1) package.skeleton() can produce this; (2) the package author prefers this style. Back-quoting is often unnecessary, unless the object name is not valid without back-quoting, e.g., > `a b` <- 1:2 > ls() [1] "a b" > a b Error: unexpected symbol in "a b" > `a b

[R] Plot with date

2013-10-08 Thread Barbara Rogo
I have to built a graphic with a time series of returns, but it have not a frequency (for example monthly in one year). On the x of the graphic I need to see only the year and not all the date (for example, "1996-01-02" , 1996). How I can do this Thank you [[alternative HTML version de

[R] tables with row sorted numerically although factors

2013-10-08 Thread Renger van Nieuwkoop
Hi I am using the package tables and want to have the rows in the numerical order and not in the alphabetical order: library(tables) Nodes <- c(1,10,20,2) Values<- c(1,2,3,4) Data <- data.frame(cbind(Nodes,Values)) data$Nodes<- as.factor(as.character(data$Nodes)) # necessary to get f

Re: [R] tables with row sorted numerically although factors

2013-10-08 Thread Rui Barradas
Hello, First of all, there's no need for data.frame(cbind(...)). data.frame() only will do the job, and it's less error prone. As for the question, since the column Nodes is to become a factor, why use as.character()? Without it the problem is solved: data <- data.frame(Nodes,Values)

Re: [R] tables with row sorted numerically although factors

2013-10-08 Thread David Winsemius
On Oct 8, 2013, at 10:29 AM, Renger van Nieuwkoop wrote: > Hi > I am using the package tables and want to have the rows in the numerical > order and not in the alphabetical order: > > library(tables) > Nodes <- c(1,10,20,2) > Values<- c(1,2,3,4) > Data <- data.frame(cbind(Nodes,Val

Re: [R] tables with row sorted numerically although factors

2013-10-08 Thread Greg Snow
The order in the table is the order of the levels in the factor, so the best thing to do is to set the order in the factor itself. You can do this using the factor function when you create the factor, or with a function like relevel after the function has been created. In your case, what happens

[R] Writing Generic (Extractor) Functions

2013-10-08 Thread Doran, Harold
The Writing R Extensions guide has a good section on writing generic functions and methods. However, has anyone generated any additional tutorials, presentations, notes, etc that extend this topic? Perhaps showing additional examples of what works well and what risks to avoid. Thanks, Harold

Re: [R] What is the difference between Reduce(…) and do.call(…) ?

2013-10-08 Thread Uwe Ligges
Reduce will rbind 2 elements and then the result with the next element of the list --- while do.call just applies rbind once on all elements of the list at the same time. Uwe Ligges On 08.10.2013 11:22, Asis Hallab wrote: Dear R-Experts, using both do.call(…) and Reduce(…), I wonder about

Re: [R] R: Re: R: Re: Information Frequency problem calculation

2013-10-08 Thread arun
Dear Jarod, How about this? a<- read.table(text="NAME1    NAME2    RNA mauro    francesco    E234 luca    giuseppe    E5578 luca    franco    E5569 maria    luca    E4556 maria    mauro    E4556 luisa    mara    E4755 mara    luca    E234 luigi    veronica    E234 mauro    veronica    E235 franc

Re: [R] Plot with date

2013-10-08 Thread Uwe Ligges
See ?axis.Date Uwe Ligges On 08.10.2013 18:34, Barbara Rogo wrote: I have to built a graphic with a time series of returns, but it have not a frequency (for example monthly in one year). On the x of the graphic I need to see only the year and not all the date (for example, "1996-01-02" , 1996)

Re: [R] Writing Generic (Extractor) Functions

2013-10-08 Thread Doran, Harold
Chapter 7 of Writing R Extensions http://cran.r-project.org/doc/manuals/R-exts.html#Generic-functions-and-methods -Original Message- From: gret...@gmail.com [mailto:gret...@gmail.com] On Behalf Of Grant Rettke Sent: Tuesday, October 08, 2013 4:31 PM To: Doran, Harold Cc: r-help@r-project.

Re: [R] Summary functions in sqldf() XXXX

2013-10-08 Thread Gabor Grothendieck
On Tue, Oct 8, 2013 at 11:46 AM, Dan Abner wrote: > Hi everyone, > > Is it possible to obtain the 1st & 3rd quartiles & the median in a sqldf() > select statement? If so, can you please provide the summary fn code? See the list of functions in Example15 on the sqldf home page: https://code.goog

Re: [R] Writing Generic (Extractor) Functions

2013-10-08 Thread Grant Rettke
What is the URL for the section that you are referencing? On Tue, Oct 8, 2013 at 2:46 PM, Doran, Harold wrote: > The Writing R Extensions guide has a good section on writing generic > functions and methods. However, has anyone generated any additional > tutorials, presentations, notes, etc that

[R] parallels package -can't create cluster

2013-10-08 Thread Carl Witthoft
I am trying to use the parallel package, and found that makeCluster hangs (and no apparent actions have taken place). This is Windows7-64, "Enterprise", R 3.0.1 . I've traced the hang to the following line in newPSOCKnode : con <- socketConnection("localhost", port = port, server = TRUE, b

[R] iconv question: SQL Server 2005 to R

2013-10-08 Thread Ira Sharenow
A colleague is sending me quite a few files that have been saved with MS SQL Server 2005. I am using R 2.15.1 on Windows 7. I am trying to read in the files using standard techniques. Although the file has a csv extension when I go to Excel or WordPad and do SAVE AS I see that it is Unicode Tex

Re: [R] R function for Bisecting K-means algorithm

2013-10-08 Thread Vivek Singh
Any help on this? Regards, Vivek On Tue, Oct 8, 2013 at 2:36 PM, Vivek Singh wrote: > Hi All, > > Can someone please tell me* R function for Bisecting K-means algorithm*. > I have used *kmeans() *function but not getting good results. > > Please help. > > -- > Thanks and Regards, > > Vivek Kum

Re: [R] R function for Bisecting K-means algorithm

2013-10-08 Thread Bert Gunter
Probably not. I would guess that most (or all) of us have no clue what "bisecting" a k-means algorithm means. You might have more luck if you explain yourself more clearly (but probably not from me in any case). Is this an R question, by the way? This is not a statistics list -- it's an R programm

[R] Fwd: how to check the accuracy for maxent ?

2013-10-08 Thread Vineet Shukla
I was going through this example of maxent (Maximun entropy package) use: http://cran.r-project.org/web/packages/maxent/maxent.pdf # LOAD LIBRARY library(maxent) # READ THE DATA, PREPARE THE CORPUS, and CREATE THE MATRIX data <- read.csv(system.file("data/NYTimes.csv.gz",package="maxent")) corpus

[R] Parsing useragent in R

2013-10-08 Thread Aviad Klein
Hello, Has any1 ever tried to parse a useragent string to get the OS and Browser information out of it? There are many Java, PHP and Python ways to do it, but I was wondering if there is a way to do it with R. Googling retrieved no help at all. A useragent string might look like this : "mozilla/