[R] apply block of if statements with menu function

2014-09-15 Thread rl
Subscribers, apply block of if statements with menu function Subscribers, For a menu: menu(c('a','b','c','d')) How to create a function that will apply to specific menu choice objects? For example: object1<-function (menuifchoices) { menu1<-menu(c('a','b','c','d')) if (menu1==1)

[R] [R-pkgs] Announce: Lahman baseball database archive package, v 3.0

2014-09-15 Thread Michael Friendly
Dear list Version 3.0-1 of the Lahman package was recently submitted to CRAN. It contains the the tables from Sean Lahman's Baseball Database, http://www.seanlahman.com/baseball-archive/statistics/ as a set of R data.frames with examples of use. V 3.0 provides the updated data on pitching, hi

Re: [R] 8 fast or 4 very fast cores?

2014-09-15 Thread Ben Bolker
Leif Ruckman Ruckman.se> writes: > > I am going to buy a new computer ( Dell workstation T5810 - Windows 8) > to work with simulatons in R. > > Now I am asked what kind of processor I like and I was given two choices. > > 1. Intel Xeon E5-1620 v3 - 4 cores 3.7 GHz Turbo > 2. Intel Xeon E5-264

Re: [R] 8 fast or 4 very fast cores?

2014-09-15 Thread Prof Brian Ripley
On 15/09/2014 11:21, Ben Bolker wrote: Leif Ruckman Ruckman.se> writes: I am going to buy a new computer ( Dell workstation T5810 - Windows 8) to work with simulatons in R. Now I am asked what kind of processor I like and I was given two choices. 1. Intel Xeon E5-1620 v3 - 4 cores 3.7 GHz T

[R] spatstat rmh problem

2014-09-15 Thread Sebastian Schutte
Dear R and spatstat developers, Thanks so much for the time and effort that you invest into this awesome software. I have a problem simulating from a Point Process Model in spatstat. In summary, the option "new.coef" should allow me to use a fitted model and change its beta coefficients before

Re: [R] [I] Re: Installing nloptr in UNIX environ

2014-09-15 Thread pofigster
Thanks - I ended up getting our linux admin to let the server connect to the internet and got it working. Mark Ewing From: ray48 [via R] [mailto:ml-node+s789695n4696884...@n4.nabble.com] Sent: Friday, September 12, 2014 8:51 AM To: Ewing, Mark Subject: [I] Re: Installing nloptr in UNIX environ

[R] Fwd: CoxME: Family relatedness

2014-09-15 Thread Marie Dogherty
Hello all, I have a table like this, with ~300 individuals: Famid Id Faid Moid CohortSex Survival Event SNP1 SNP2 SNP3 11000010 1010 22001120 1000 23000025 1010 4

[R] the properties of a DATA to run DBSCAN in R

2014-09-15 Thread Maryam Heidari
hello everybody, I have been trying to run "dbscan" algorithm on my data, my data round 4 records which each of them has 3 attributes + plus the ID for each record. the interesting thing is that when I run the "dbscan just on 3 attributes" R gives me an ERROR regarding "stackoverflow" but when

Re: [R] apply block of if statements with menu function

2014-09-15 Thread David L Carlson
I think switch() should work for you here, but it is not clear how much flexibility you are trying to have (different tests based on the first response; different tests based on first, then second response; different tests based on each successive response). ?switch For the second question ju

Re: [R] apply block of if statements with menu function

2014-09-15 Thread rl
On 2014-09-15 14:22, David L Carlson wrote: I think switch() should work for you here, but it is not clear how much flexibility you are trying to have (different tests based on the first response; different tests based on first, then second response; different tests based on each successive respo

[R] chi-square test

2014-09-15 Thread eliza botto
Dear useRs of R, I have two datasets (TT and SS) and i wanted to to see if my data is uniformly distributed or not?I tested it through chi-square test and results are given at the end of it.Now apparently P-value has a significant importance but I cant interpret the results and why it says that

Re: [R] chi-square test

2014-09-15 Thread Rick Bilonick
On 09/15/2014 10:57 AM, eliza botto wrote: Dear useRs of R, I have two datasets (TT and SS) and i wanted to to see if my data is uniformly distributed or not?I tested it through chi-square test and results are given at the end of it.Now apparently P-value has a significant importance but I cant

[R] Using sqldf() to read in .fwf files

2014-09-15 Thread Doran, Harold
I am learning to use sqldf() to read in very large fixed width files that otherwise do not work efficiently with read.fwf. I found the following example online and have worked with this in various ways to read in the data cat("1 8.3 210.3 319.0 416.0 515.6 719.8 ", file = "fixed") fixed <- file

Re: [R] 8 fast or 4 very fast cores?

2014-09-15 Thread Clint Bowman
I'm in a similar situation and am looking seriously at a pair of E5-2643v3 (6 cores each-hyperthreaded). Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-

[R] spatstat rmh problem

2014-09-15 Thread Sebastian Schutte
Dear R and spatstat developers, Thanks so much for the time and effort that you invest into this awesome software. I have a problem simulating from a Point Process Model in spatstat. In summary, the option "new.coef" should allow me to use a fitted model and change its beta coefficients before

[R] Bug in rep() function

2014-09-15 Thread Samuel Knapp
Dear all, I have discovered a bug in the standard rep() function: At certain values, rep() does not replicate the element by the proper number of times: > a <- (1-0.9)*100 > a [1] 10 > length(rep(1,times=a)) [1] 9 > length(rep(1,each=a)) [1] 9 As shown, this happens as well for the times= as

Re: [R] Building R for better performance

2014-09-15 Thread Anspach, Jonathan P
All, I’ve attached the actual benchmark TACC and I used. I’ve also attached a paper I wrote covering this in a little more detail. The paper specifies the hardware configuration I used. Let me know if you have any other questions. Regards, Jonathan Anspach Sr. Software Engineer Intel Corp. j

Re: [R] Bug in rep() function

2014-09-15 Thread Sarah Goslee
No, actually you've discovered FAQ 7.31. > a <- (1-0.9)*100 > a [1] 10 > print(a, digits=20) [1] 9.9982236 In combination with the description in ?rep: Non-integer values of ‘times’ will be truncated towards zero. If ‘times’ is a computed quantity it is prudent to add a sma

Re: [R] Bug in rep() function

2014-09-15 Thread Prof Brian Ripley
On 15/09/2014 16:30, Samuel Knapp wrote: Dear all, I have discovered a bug in the standard rep() function: At certain Not so: > a <- (1-0.9)*100 > trunc(a) [1] 9 As the help says Non-integer values of ‘times’ will be truncated towards zero. If ‘times’ is a computed quantity it is

Re: [R] Using sqldf() to read in .fwf files

2014-09-15 Thread Gabor Grothendieck
On Mon, Sep 15, 2014 at 12:09 PM, Doran, Harold wrote: > I am learning to use sqldf() to read in very large fixed width files that > otherwise do not work efficiently with read.fwf. I found the following > example online and have worked with this in various ways to read in the data > > cat("1 8.

Re: [R] Using sqldf() to read in .fwf files

2014-09-15 Thread Doran, Harold
Thank you, Gabor. This has seemingly resolved the issue. Perhaps a quick follow up. Suppose I know that the 1st variable I am reading in is to be numeric and the second is character. Can that be specified in the substr() argument? sqldf("select substr(V1, 1, 1) f1, substr(V1, 2, 4) f2 from fixed

Re: [R] Using sqldf() to read in .fwf files

2014-09-15 Thread Gabor Grothendieck
On Mon, Sep 15, 2014 at 3:23 PM, Doran, Harold wrote: > Thank you, Gabor. This has seemingly resolved the issue. Perhaps a quick > follow up. Suppose I know that the 1st variable I am reading in is to be > numeric and the second is character. Can that be specified in the substr() > argument? >

Re: [R] chi-square test

2014-09-15 Thread David L Carlson
Rick's question is a good one. It is unlikely that the results will be informative, but from a technical standpoint, you can estimate the p value using the simulate.p.value=TRUE argument to chisq.test(). > chisq.test(TT, simulate.p.value=TRUE) Pearson's Chi-squared test with simulated p

Re: [R] CoxME: Family relatedness

2014-09-15 Thread Therneau, Terry M., Ph.D.
I would have caught this tomorrow (I read the digest). Some thoughts: 1. Skip the entire step of subsetting the death.kmat object. The coxme function knows how to do this on its own, and is more likely to get it correct. My version of your code would be deathdat.kmat <- 2* with(deathdat, ma

Re: [R] spatstat rmh problem

2014-09-15 Thread Rolf Turner
Your example is not reproducible. We don't have "cshape" or "im.pop" (and are possibly lacking other bits and pieces; I didn't check the details since the example fails to run from the get-go). Please provide a *reproducible* example. Also I am puzzled by the line mod <- ppm (ppp, ~ pop

Re: [R] Bug in rep() function

2014-09-15 Thread Samuel Knapp
Thank you. I got the point with non-integer values in rep(). I also red FAQ 7.3: "The only numbers that can be represented exactly in R’s numeric type are integers and fractions whose denominator is a power of 2." But then I still don't understand: > for (b in seq(0.2,0.8,0.2)) + { + a <- (1

[R] Quantile

2014-09-15 Thread Felix Dietrich
Hi, I want to use the quantile function, the example shown under "help" x <- rnorm(1001) quantile(x <- rnorm(1001)) # Extremes & Quartiles by default quantile(x, probs = c(0.1, 0.5, 1, 2, 5, 10, 50, NA)/100) I get the following error: Error in quantile(x, probs = c(0.1, 0.5, 1, 2, 5, 10, 50, NA)

[R] Updates to R Core and R Foundation Membership

2014-09-15 Thread Robert Gentleman
Hi all, It is my pleasure to announce new members to R Core and to the R Foundation whose efforts will be most appreciated as R continues to evolve and advance. There are 2 new R core members: Martin Morgan and Michael Lawrence. In addition Stefano Iacus has decided to step down from R

[R] Efficient frontier

2014-09-15 Thread Aparna
Hi I need help for plotting efficient frontier, I have expected return and covariance matrix. I am using tseries and downloaded portfolio package too. The suggestion says to use efficient.frontier, but it looks you replaces it by something in R 3.1.1 as it says this is not available. At current

[R] ncdf size error

2014-09-15 Thread Hernan A. Moreno Ramirez
Hi I am using both ncdf and ncdf4 libraries and with both I keep getting the same error: Error in R_nc_enddef: NetCDF: One or more variable sizes violate format constraints. Error in R_nc_sync: NetCDF: Operation not allowed in define mode. This happens when I try to create.ncdf() a file with more

[R] Fwd: the properties of a DATA to run DBSCAN in R

2014-09-15 Thread Maryam Heidari
hello everybody, I have been trying to run "dbscan" algorithm on my data, my data round 4 records which each of them has 3 attributes + plus the ID for each record. the interesting thing is that when I run the "dbscan just on 3 attributes" R gives me an ERROR regarding "stackoverflow" but when

Re: [R] ncdf size error

2014-09-15 Thread David W. Pierce
On Mon, Sep 15, 2014 at 4:20 PM, Hernan A. Moreno Ramirez wrote: > > Hi I am using both ncdf and ncdf4 libraries and with both I keep getting the > same error: Error in R_nc_enddef: NetCDF: One or more variable sizes violate > format constraints. Error in R_nc_sync: NetCDF: Operation not allowed i

Re: [R] Quantile

2014-09-15 Thread David Winsemius
On Sep 15, 2014, at 11:17 AM, Felix Dietrich wrote: > Hi, I want to use the quantile function, the example shown under "help" > > x <- rnorm(1001) > quantile(x <- rnorm(1001)) # Extremes & Quartiles by default > quantile(x, probs = c(0.1, 0.5, 1, 2, 5, 10, 50, NA)/100) > > I get the following

Re: [R] Bug in rep() function

2014-09-15 Thread William Dunlap
> Why are the first two yielding an integer after multiplying, and the last two > don't? > Apparently, c(0.8,0.6,0.4,0.2) can't be represented exactly. Most fractions cannot be represented exactly. Also, you cannot depend on the third element of seq(.2,.8,by=.2) being equal to .6 (it is slightly

Re: [R] Fwd: the properties of a DATA to run DBSCAN in R

2014-09-15 Thread Jeff Newmiller
Instead of repeating yourself, please do some research. There is a Posting Guide mentioned at the bottom of this message. One of the things it mentions is making a reproducible example. (You might find [1] helpful in that regard.) Another thing it mentions is posting in plain text, which does no

Re: [R] Efficient frontier

2014-09-15 Thread Bert Gunter
Please read the posting guide (link at bottom of message) to learn how to post coherently to get a useful response. I, at least, found your post to be unintelligible gibberish. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is no

Re: [R] spatstat rmh problem

2014-09-15 Thread Sebastian Schutte
Thanks so much for your comments. Sorry for not having sent a running example from the start. Here it is: library (spatstat) #Load example data data(demopat) #Generate a random point pattern within the polygon set.seed(12345) pdat <- rpoint(200,win=demopat$window) #Generate a distmap, which wi

Re: [R] spatstat rmh problem

2014-09-15 Thread Rolf Turner
OK. Two things are going wrong. (1) There is an error in your code. You are passing the new.coef argument to density() and not to rmh(). The function density() has no such argument, but has a "..." argument, so "new.coef" simply gets ignored. You should use: plot(density(rmh(mod,new.coef=