Re: [R] How to download this data?

2013-08-03 Thread Ron Michael
Hello Duncan,   Thank you very much for your pointer.   However when I tried to run your code, I got following error:  > rawOrig = getURLContent("https://www.theice.com/productguide/ProductSpec.shtml?specId=219#expiry";) Error in function (type, msg, asError = TRUE)  :   SSL certificate problem

Re: [R] Error executing R CMD check --as-cran caused by missing Maintainer field

2013-08-03 Thread Prof Brian Ripley
On 02/08/2013 20:04, Stefano Costa wrote: Hello, while checking a small package I wrote (http://cran.r-project.org/web/packages/tipom/) before submitting a new version, I was blocked by an error in the "checking CRAN incoming feasibility" section of R CMD check --as-cran, as pasted below: steko@

[R] Accidentally replacing core R functions

2013-08-03 Thread Rguy
I sometimes find that a function I have defined has the same name as an R core function. In most cases I have no desire to redefine the core R function and would prefer to give my function a different name. The problem is that R lets users redefine its core functions without any warning. Is there

Re: [R] cannot base64decode string which is base64encode in R

2013-08-03 Thread Enrico Schumann
On Fri, 02 Aug 2013, Qiang Wang writes: > Hi, > > I'm struggling with encode/decode strings in R. Don't know why the second > example below would fail. Thanks in advance for your help. > succeed: s <- "saf" x <- base64encode(s) y <- base64decode(x, "character") > fail: s <- "safs" x <- base64enco

Re: [R] Error executing R CMD check --as-cran caused by missing Maintainer field

2013-08-03 Thread Stefano Costa
Il 03/08/2013 09:23, Prof Brian Ripley ha scritto: > > Use R CMD build to prepare a tarball. CRAN submission requires a > tarball as prepared by R CMD build ... and asks you to check the tarball > you are about to submit, not a directory. Thanks, that was my mistake. Perhaps the error message co

Re: [R] How to download this data?

2013-08-03 Thread Ron Michael
In the mean time I have this problem sorted out, hopefully I did it correctly. I have modified the line of your code as:   rawOrig = getURLContent("https://www.theice.com/productguide/ProductSpec.shtml?specId=219#expiry";, ssl.verifypeer = FALSE)   However next I faced with another problem to ex

Re: [R] Error executing R CMD check --as-cran caused by missing Maintainer field

2013-08-03 Thread Prof Brian Ripley
On 03/08/2013 09:04, Stefano Costa wrote: Il 03/08/2013 09:23, Prof Brian Ripley ha scritto: Use R CMD build to prepare a tarball. CRAN submission requires a tarball as prepared by R CMD build ... and asks you to check the tarball you are about to submit, not a directory. Thanks, that was my

[R] descriptive stats by cells in factorial design

2013-08-03 Thread Mike Miller
I'm looking for recommendations for a good way to do this. There must be a good function in some package... I have a 5-way factorial design, two levels per factor, so 32 cells, and I mostly just want the means and standard deviations for the contents of every cell. I can write a for loop, bu

Re: [R] descriptive stats by cells in factorial design

2013-08-03 Thread Søren Højsgaard
The summaryBy function in the doBy package may help you. Regards Søren Sendt fra Samsung mobil Oprindelig meddelelse Fra: Mike Miller Dato: Til: R-Help List Emne: [R] descriptive stats by cells in factorial design I'm looking for recommendations for a good way to do this

Re: [R] Accidentally replacing core R functions

2013-08-03 Thread Duncan Murdoch
On 13-08-03 3:47 AM, Rguy wrote: I sometimes find that a function I have defined has the same name as an R core function. In most cases I have no desire to redefine the core R function and would prefer to give my function a different name. The problem is that R lets users redefine its core funct

Re: [R] using "rollapply" to calculate a moving sum or running sum?

2013-08-03 Thread Enrico Schumann
On Fri, 02 Aug 2013, Anika Masters writes: > This is not critical, but I am curious to learn. Are there any > suggestions for speeding up the process to calculate a moving row sum? > (Ideally from within R, as opposed to suing C, etc.) > Using rollapply on a matrix of 45,000 rows and 400 columns

[R] Manipulations of a data frame or list -- rename or re-assign?

2013-08-03 Thread Ben Harrison
If I am to do a lot of pre-processing operations on some data, comprising many steps such as: -- despike a set of signals -- smooth a set of signals -- filter -- subset -- impute missing values etc... Should I be assigning the result of each operation to a new object, and then destroying the old

Re: [R] using "rollapply" to calculate a moving sum or running sum?

2013-08-03 Thread Gabor Grothendieck
On Sat, Aug 3, 2013 at 7:16 AM, Enrico Schumann wrote: > On Fri, 02 Aug 2013, Anika Masters writes: > >> This is not critical, but I am curious to learn. Are there any >> suggestions for speeding up the process to calculate a moving row sum? >> (Ideally from within R, as opposed to suing C, etc.)

Re: [R] Manipulations of a data frame or list -- rename or re-assign?

2013-08-03 Thread Rui Barradas
Hello, Maybe you could keep the original, and reuse only one (another) object for the intermidiate steps. That's how I would do it. Hope this helps, Rui Barradas Em 03-08-2013 12:27, Ben Harrison escreveu: If I am to do a lot of pre-processing operations on some data, comprising many steps

Re: [R] Internalization of help pages

2013-08-03 Thread Tomáš Greif
Bert, thank you for your response. I understand this would be huge task. My idea is: 1. Translation of help files is optional, driven by demand. This way (as I believe) core packages will get translated first, followed by some other CRAN packages. I don't expect that every page is translated. 2

[R] Forest plot not dispalying

2013-08-03 Thread wanjiku gichohi
Hi All, I am quite new to R so my question may seem a bit basic. I run the below syntax to create a forest plot with sub group analyses. The forest plot does not display though when I look at the console I see no error message. What could be the problem? ### to save as png file png(filename="

Re: [R] How to download this data?

2013-08-03 Thread Duncan Temple Lang
Hi Ron Yes, you can use ssl.verifypeer = FALSE. Or alternatively, you can use also use getURLContent(, cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl")) to specify where libcurl can find the certificates to verify the SSL signature. The error you are encounte

[R] Junk mail

2013-08-03 Thread Faith Shalom
Please remove my my email from the mailing list. [[alternative HTML version deleted]] __ 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

[R] Junk mail

2013-08-03 Thread Faith Shalom
Please remove my email from your mailing list. [[alternative HTML version deleted]] __ 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 an

Re: [R] Junk mail

2013-08-03 Thread John Kane
https://stat.ethz.ch/mailman/listinfo/r-help Scroll down John Kane Kingston ON Canada > -Original Message- > From: judahscep...@gmail.com > Sent: Sat, 3 Aug 2013 15:32:22 +0100 > To: r-h...@stat.math.ethz.ch > Subject: [R] Junk mail > > Please remove my my email from the mailing lis

[R] How to create a dendrogram with colored branches

2013-08-03 Thread beginner
Hi I would like to create a dendrogram in R which has colored branches, like the one shown below. So far I used following commands to create a standard dendrogram: d <- dist(as.matrix(data[,29])) # find distance matrix hc <- hcl

Re: [R] descriptive stats by cells in factorial design

2013-08-03 Thread David Winsemius
'tapply' lets one apply a function to tabulated items. There are 'describe' functions in a variety of packages. -- David Sent from my iPhone On Aug 3, 2013, at 2:27 AM, Søren Højsgaard wrote: > The summaryBy function in the doBy package may help you. > Regards Søren > > > Sendt fra Samsu

Re: [R] using "rollapply" to calculate a moving sum or running sum?

2013-08-03 Thread William Dunlap
E.g., > mymatrix <- matrix(data=sin(1:(45000*400)),nrow=45000, ncol=400) > system.time(z1 <- > rollapply(t(mymatrix),width=12,FUN=sum,by.column=TRUE,fill=NA,partial=FALSE)) user system elapsed 1592.85 1311.56 2905.99 > system.time(z2 <- filter(t(mymatrix), rep(1,12))) user system elapse

Re: [R] rms plot.Predict when type="p"

2013-08-03 Thread Mike Babyak
As always, Frank, thanks for the help. Much appreciated. Mike Babyak Department of Psychiatry and Behavioral Sciences Duke University Medical Center R version 3.01 Windows 7 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

[R] (nonparametric) Copula density estimation

2013-08-03 Thread marta Garcia
Hello community, sorry for the English, I speak Spanish ... I try to run this code install.packages("MASS") library(MASS) install.packages ("evd") library(evd) X=lossalae U=cbind(rank(X[,1])/(nrow(X)+1),rank(X[,2])/(nrow(X)+1)) The standard tool to plot nonparametric estimators of densities is

[R] Fwd: (nonparametric) Copula density estimation

2013-08-03 Thread marta Garcia
-- Forwarded message -- From: marta Garcia Date: 2013/8/3 Subject: (nonparametric) Copula density estimation To: r-help@r-project.org Hello community, sorry for the English, I speak Spanish ... I try to run this code install.packages("MASS") library(MASS) install.packages ("ev

Re: [R] How to create a dendrogram with colored branches

2013-08-03 Thread Robin Cura
Hi, You'll find a usefull post here : http://gastonsanchez.wordpress.com/2012/10/03/7-ways-to-plot-dendrograms-in-r/ For my part, I use the last method (A2R) to plot trees like the figure you posted. HTH, Robin 2013/8/3 beginner > Hi > > I would like to create a dendrogram in R which has co

Re: [R] How to download this data?

2013-08-03 Thread Ron Michael
Hi Duncan, Thank you very much for your prompt help. Now all worked very smoothly. Thank you. - Original Message - From: Duncan Temple Lang To: Ron Michael Cc: "r-help@r-project.org" Sent: Saturday, 3 August 2013 7:43 PM Subject: Re: [R] How to download this data? Hi Ron   Yes, you

[R] subselecting on Data frame

2013-08-03 Thread PQuery
Dear all, I have a data frame of features (example pasted below) from which I would like to select, say: how many triplets of features (corresponding to rows) have the same Scaff and the same "Cat" and a score >0.6 and fall in a distance of max 1 (distance defined as Start of row[i+1] - End o

Re: [R] How to create a dendrogram with colored branches

2013-08-03 Thread Gregory Jefferis
On 3 Aug 2013, at 16:47, beginner wrote: > d <- dist(as.matrix(data[,29])) # find distance matrix > hc <- hclust(d)# apply hirarchical clustering > plot(hc,labels=data[,1], main="", xlab="") # plot the dendrogram You haven't given a reproducible example (data is undefined), s

[R] add diagonal to matrix

2013-08-03 Thread Martin Batholdy
Hi, I have a 5 columns x 4 rows matrix and would like to add a diagonal of zeros so that I end up with a 5x5 matrix. x <- matrix(1:20, 4,5) what is the easiest way to accomplish this in R? thanks for any suggestions! __ R-help@r-project.org mailing

[R] Method dispatch in S4

2013-08-03 Thread Simon Zehnder
Dear R-Users and R-Devels, I am struggling with the method dispatch for S4 objects. First I will give a simple example to make clear what the general setting in my project is. Three classes will be build in the example: A is just a simple class. B contains A in a slot and C inherits from B. In

Re: [R] add diagonal to matrix

2013-08-03 Thread Richard M. Heiberger
x <- matrix(1:20, 4,5) xx <- matrix(0, nrow=dim(x)[2], ncol=dim(x)[2]) xx[upper.tri(xx)] <- x[upper.tri(x)] xx[lower.tri(xx)] <- x[lower.tri(x, diag=TRUE)] On Sat, Aug 3, 2013 at 2:54 PM, Martin Batholdy wrote: > Hi, > > I have a 5 columns x 4 rows matrix and would like to add a diagonal of > z

[R] import function without overwriting function with the same name

2013-08-03 Thread Martin Batholdy
Hi, I have to import multiple R-files. Each file consists of several functions with the same function name across the R-files. When I import all files one by one (with source()) I overwrite the function definition of the previous file until only the very last function definition lasts. However

Re: [R] import function without overwriting function with the same name

2013-08-03 Thread Ken Knoblauch
Martin Batholdy googlemail.com> writes: > I have to import multiple R-files. > Each file consists of several functions with the same function name across the R-files. > When I import all files one by one (with source()) I overwrite the function definition of the previous file > until only the ve

Re: [R] import function without overwriting function with the same name

2013-08-03 Thread Martin Batholdy
> env.lst <- lapply(1:5, new.env) > > seems to work just fine ok, as far as I understand I would create 5 new environments by this. But how do I access and change the environment? What is the name of the environment? Here is a more concrete example and the general problem: source('functions1.R

Re: [R] import function without overwriting function with the same name

2013-08-03 Thread Jeff Newmiller
This kind of thing gets dealt with as part of building packages. You can patch together your own namespace management (?attachNamespace) but you are better served to start developing your functions into packages once your projects get large enough that you start worrying about name collisions. -

Re: [R] import function without overwriting function with the same name

2013-08-03 Thread Bert Gunter
Martrin: It sounds like you have some homework to do. Moreover, you have not provided sufficient information (for me, anyway) to give a definitive answer: why/how are the functions different? How are they used? 1) "Import" is not the same as "source." "Import" is something one does with packages

Re: [R] import function without overwriting function with the same name

2013-08-03 Thread William Dunlap
Here is an example of making a list of environments, each containing a function called 'f' that was defined in an R script file. First I make examples of the sort of files I think you are thinking of; each defines 'f'. The file names are in the character vector 'tfs'. > tfs <- vapply(1:3, funct

Re: [R] Internalization of help pages

2013-08-03 Thread Jim Lemon
On 08/03/2013 05:34 PM, Tomáš Greif wrote: ... Any idea how to create proof of concept for this? ... Hi Tomas, Here is a translation of a short .Rd file for one of the packages I maintain. It took me about five minutes to translate it into Spanish using Google Translate. I am not a good enough

Re: [R] Manipulations of a data frame or list -- rename or re-assign?

2013-08-03 Thread Jim Lemon
On 08/03/2013 09:27 PM, Ben Harrison wrote: If I am to do a lot of pre-processing operations on some data, comprising many steps such as: -- despike a set of signals -- smooth a set of signals -- filter -- subset -- impute missing values etc... Should I be assigning the result of each operation

Re: [R] Internalization of help pages

2013-08-03 Thread Jim Lemon
On 08/04/2013 10:20 AM, Jim Lemon wrote: On 08/03/2013 05:34 PM, Tomáš Greif wrote: ... Any idea how to create proof of concept for this? ... Hi Tomas, Here is a translation of a short .Rd file for one of the packages I maintain. It took me about five minutes to translate it into Spanish using

Re: [R] add diagonal to matrix

2013-08-03 Thread arun
You could also try: x1<-matrix(0,5,5) indx<-which(!is.na(x1),arr.ind=TRUE) x1[indx[indx[,1]!=indx[,2],]]<- as.vector(x) #Speed comparison: set.seed(48) m1<- matrix(sample(1:40,4500*4499,replace=TRUE),ncol=4500) m2<- matrix(0,4500,4500) system.time({ indx<- which(m2==0,arr.ind=TRUE) m2[indx[indx[

Re: [R] add diagonal to matrix

2013-08-03 Thread arun
This could be a bit faster. x1<- matrix(NA,5,5) diag(x1)<-0 x1[which(is.na(x1),arr.ind=TRUE)]<- as.vector(x) #Speed comparison: set.seed(585) m1<- matrix(sample(1:40,4500*4499,replace=TRUE),ncol=4500) system.time({ m2<- matrix(0,4500,4500) indx<- which(m2==0,arr.ind=TRUE) m2[indx[indx[,1]!=indx[

Re: [R] Fwd: (nonparametric) Copula density estimation

2013-08-03 Thread David Winsemius
Sent from my iPhone On Aug 3, 2013, at 8:27 AM, marta Garcia wrote: > -- Forwarded message -- > From: marta Garcia > Date: 2013/8/3 > Subject: (nonparametric) Copula density estimation > To: r-help@r-project.org > > > Hello community, sorry for the English, I speak Spanish .

Re: [R] import function without overwriting function with the same name

2013-08-03 Thread Siraaj Khandkar
On 08/03/2013 05:32 PM, Bert Gunter wrote: 4. Or, probably the least desirable approach that may nevertheless be what you may want, is just to attach your collections of functions and access them by fully qualified names. See ?"::" for details on how to do that. Why do you feel this is least

[R] Group by a data frame with multiple columns

2013-08-03 Thread Michael Liaw
Hi I'm trying to manipulate a data frame (that has about 10 million rows) rows by "grouping" it with multiple columns. For example, say the data set looks like: Area Sex Year y Bob F 2011 1 Bob F 2011 2 Bob F 2012 3 Bob M 2012 3 Bob M 2012 2 Fred F 2011 1 Fr

Re: [R] add diagonal to matrix

2013-08-03 Thread Bin Yu
Hi, I have another method: set.seed(48) n <- 4500 m1 <- matrix(sample(1:40,n*(n-1),replace=TRUE),ncol=n) m2 <- vector("numeric",length=n^2) system.time({m2[!m2%in%seq.int(n)^2] <- as.vector(m1);m3<-array(m2,dim=c(n,n))}) # user system elapsed # 1.43 0.28 1.87 Best Regards! Fechy - Ori

Re: [R] add diagonal to matrix (sorry for having a little bug in last email)

2013-08-03 Thread Bin Yu
Hi, I have another method: set.seed(48) n <- 4500 m1 <- matrix(sample(1:40,n*(n-1),replace=TRUE),ncol=n) m2 <- vector("numeric",length=n^2) system.time({m2[!seq_along(m2)%in%seq.int(n)^2] <- as.vector(m1);m3<-array(m2,dim=c(n,n))}) # user system elapsed # 1.62 0.39 2.04 Best Regards! Fechy

Re: [R] add diagonal to matrix

2013-08-03 Thread Bin Yu
Hi, I have another method: set.seed(48) n <- 4500 m1 <- matrix(sample(1:40,n*(n-1),replace=TRUE),ncol=n) m2 <- vector("numeric",length=n^2) system.time({sqn <- seq.int(n);m2[!seq_along(m2)%in%(sqn+(sqn-1)*n)] <- as.vector(m1);m3<-array(m2,dim=c(n,n))}) # user system elapsed # 1.70 0.19 1.92

Re: [R] Group by a data frame with multiple columns

2013-08-03 Thread arun
Hi, May be you should try ?data.table().  Please use ?dput(). dat1<- read.table(text=" Area Sex Year y Bob F 2011 1 Bob F 2011 2 Bob F 2012 3 Bob M 2012 3 Bob M 2012 2 Fred F 2011 1 Fred F 2011 1 Fred F 2012 2 Fred M 2012 3 Fred M 2012 1 ",sep="",header=TRUE,stringsAsFactors=FALSE) library(dat

Re: [R] Internalization of help pages

2013-08-03 Thread Berend Hasselman
On 04-08-2013, at 02:28, Jim Lemon wrote: > On 08/04/2013 10:20 AM, Jim Lemon wrote: >> On 08/03/2013 05:34 PM, Tomáš Greif wrote: >>> ... >>> Any idea how to create proof of concept for this? >>> ... >> Hi Tomas, >> Here is a translation of a short .Rd file for one of the packages I >> maintain

Re: [R] Fwd: (nonparametric) Copula density estimation

2013-08-03 Thread marta Garcia
Dennis, David, The code I'm running is from here: http://www.r-bloggers.com/nonparametric-copula-density-estimation/ s comes from here: s {mgcv} *Defining smooths in GAM formulae* *Package: * mgcv *Version: * 1.7-24 *Description* Function used in definition of smooth terms within *ga