Re: [R] problem reading from serial connection since 2.10.0

2009-12-30 Thread Prof Brian Ripley
RTFM time: what do you think the description of 'file' in ?scan says about devices (I can see nothing that says they are supported). It does however say that As from R 2.10.0 this can be a compressed file (see ‘file’). which is a clear indication of what changed in R 2.10.0. Did

Re: [R] Ops method does not dispatch on either of two classes

2009-12-30 Thread Prof Brian Ripley
This is as documented on the help page for Ops (the page in base, not the one in Methods) which is linked from ?|. For background you should also read the reference on that help page. You are wrong in asserting that the internal method is 'for logicals': please do study the help page. It

Re: [R] Histogram/BoxPlot Panel

2009-12-30 Thread Lorenzo Isella
Dear Baptiste, Thanks a lot for the excellent example, which convinced me to start studying ggplot2. A trivial question: is there an easy way to generate a boxplot without outliers? Using R standard plotting facilities, this amounts to giving outline=FALSE within boxplot. Can I easily achieve

[R] Axis Labels for Compound Plots in ggplot2

2009-12-30 Thread Lorenzo Isella
Dear All, I am trying to stitch together multiple plots using ggplot2 Consider for instance the following snippet based on an old thread (http://tinyurl.com/ylehm2t) library(ggplot2) vplayout - function(x, y) viewport(layout.pos.row=x, layout.pos.col=y) draw4 - function(pdfname, a,b,c,d,w,h) {

[R] boot function returns the same results every time - there appears to be not resampling of the original data.

2009-12-30 Thread John Sorkin
R 2.8.1 windows XP I am trying to learn how to use the boot function to perform a bootstrap of a regression. I have written a short trial program, shown below. Clearly I have done something wrong as the output of each of the 100 bootstrap values for the regression are exactly the same - there

Re: [R] Axis Labels for Compound Plots in ggplot2

2009-12-30 Thread baptiste auguie
Hi, You can set up a Grid layout with one viewport at the bottom and another on the left and use grid.text to add your labels. An example is given below using grid.pack. The gridExtra package provides a convenient wrapper for these regular arrangements of plots, ##library(gridExtra)

[R] Negbin Error Warnings

2009-12-30 Thread Clara Brück
Hi, I ran a negative binomial regression (NBR) using the Zelig-package and the negbin model. When I then try to use the simumlation approach using the setx () and sim() functions to calculate expected values and first difference for different levels of one of my independent variables, I get

[R] Positioning plots on top of each other (aligment borders)

2009-12-30 Thread Jay
Hello, I want to place two plots on top of each other. However, the problem is that I can't figure out a simple way to align them correctly. Is there a way to specify this? Since the data is bunch of coordinates and the second layer is an outline of a map (a .ps file I import using the grImport

[R] glm error: cannot correct step size

2009-12-30 Thread John Sorkin
R 2.8.1 windows XP I am getting an error message that I don't understand when I try to run GLM. The error only occurs when I have all independent variables in the model. When I drop one independent variable, the model runs fine. Can anyone help me understand what the error means and how I can

Re: [R] boot function returns the same results every time - there appears to be not resampling of the original data.

2009-12-30 Thread Prof Brian Ripley
On Wed, 30 Dec 2009, John Sorkin wrote: R 2.8.1 Rather old: have you updated package boot since? windows XP I am trying to learn how to use the boot function to perform a bootstrap of a regression. I have written a short trial program, shown below. Clearly I have done something wrong as

Re: [R] hdf5 package

2009-12-30 Thread Mark Connolly
I am having the same issue with the HDF5 package. I installed the latest hdf5 DLLs from HDFGroup. I also installed the HDFView application from the same. This was all done on Windows. The example in ?hdf5load can be used to test. The example works fine for saving and loading the

Re: [R] Negbin Error Warnings

2009-12-30 Thread milton ruser
Dear Clara, could you, please, share the summary() of your data. bests milton 2009/12/30 Clara Brück clara_bru...@web.de Hi, I ran a negative binomial regression (NBR) using the Zelig-package and the negbin model. When I then try to use the simumlation approach using the setx () and

[R] Fwd: glm error: cannot correct step size

2009-12-30 Thread Douglas Bates
I forgot to cc: the list on this response. -- Forwarded message -- From: Douglas Bates ba...@stat.wisc.edu Date: Wed, Dec 30, 2009 at 8:05 AM Subject: Re: [R] glm error: cannot correct step size To: John Sorkin jsor...@grecc.umaryland.edu On Wed, Dec 30, 2009 at 7:50 AM, John

[R] seg-fault... but on what

2009-12-30 Thread Nick Torenvliet
I got the following after running succesfully through this loop 28 million times... the loop opens text files in a directory and inserts line by line into a database... *** caught segfault *** address 0xc010, cause 'memory not mapped' Traceback: 1: .getGeneric(f, where, package) 2:

[R] select elements and transpose

2009-12-30 Thread Muhammad Rahiz
Hi all, Given the following, xx [[1]] V1 V2 V3 [1,] 1 2 3 [2,] 4 5 6 [3,] 7 8 9 [[2]] V1 V2 V3 [1,]10 11 12 [2,]13 14 15 [3,]16 17 18 [[3]] V1 V2 V3 [1,]19 20 21 [2,]22 23 24 [3,]25 26 27 how do i extract elements in each file so that after transpose, it looks

[R] parallel computing--help

2009-12-30 Thread sayan dasgupta
Hey R Users I am trying to to implement a linux snow sockets parallelism in R, I am pretty new to parallel computing Here is the problem I am facing Whenever I am doing newSOCKnode(localhost) Its working fine But whenever I do newSOCKnode(ip to another computer on the network ) It throws up

Re: [R] seg-fault... but on what

2009-12-30 Thread Duncan Murdoch
On 30/12/2009 9:20 AM, Nick Torenvliet wrote: I got the following after running succesfully through this loop 28 million times... the loop opens text files in a directory and inserts line by line into a database... This looks like a bug in RMySql or possibly R. What versions are you

Re: [R] seg-fault... but on what

2009-12-30 Thread Nick Torenvliet
Thanks Duncan, I'll work on reproducibility and possibly getting a core dump... If I get those I'll post to R-dev or RMySQL-dev. Nick On Wed, Dec 30, 2009 at 9:36 AM, Duncan Murdoch murd...@stats.uwo.cawrote: On 30/12/2009 9:20 AM, Nick Torenvliet wrote: I got the following after running

[R] multivariate group means

2009-12-30 Thread Ondřej Mikula
Hello, I look for a simple command computing multivariate group means and returning an object of class matrix rather than list. Does any such function exist in standard packages? I'm beginning with R, so I'm sorry if the solution is trivial. Ondra Mikula

Re: [R] boot function returns the same results every time - there appears to be not resampling of the original data.

2009-12-30 Thread John Sorkin
Prof Ripley, Thank you for your advise. You recommend I consult the book for which this is support software. I would be happy to do so, but I don't know what book you are referring to. Thank you, John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland

Re: [R] Negbin Error Warnings

2009-12-30 Thread Peter Ehlers
Perhaps this will give a clue: rpois(1,-1) [1] NaN Warning message: In rpois(1, -1) : NAs produced # (lambda needs to be nonnegative) -Peter Ehlers Clara Brück wrote: Hi, I ran a negative binomial regression (NBR) using the Zelig-package and the negbin model. When I then try to use the

Re: [R] boot function returns the same results every time - there appears to be not resampling of the original data.

2009-12-30 Thread Peter Ehlers
John, packageDescription('boot') will give you a hint. -Peter Ehlers John Sorkin wrote: Prof Ripley, Thank you for your advise. You recommend I consult the book for which this is support software. I would be happy to do so, but I don't know what book you are referring to. Thank you, John

Re: [R] select elements and transpose

2009-12-30 Thread Henrique Dallazuanna
If I understand, you can try this: array(do.call(rbind, xx), c(3, 3, 3)) On Wed, Dec 30, 2009 at 11:45 AM, Muhammad Rahiz muhammad.ra...@ouce.ox.ac.uk wrote: Hi all, Given the following, xx [[1]]    V1 V2 V3 [1,]  1  2  3 [2,]  4  5  6 [3,]  7  8  9 [[2]]    V1 V2 V3 [1,]10 11  12

[R] NA or work around ??

2009-12-30 Thread L.A.
I've searched and tried several ideas (na.action. and other things), but I can't see to figure this out. I'm guessing this is so simple I'll feel foolish for asking, but here goes. Thanks, L.A. Dataset$Rcil=with(Dataset, ifelse(Rpr = .95, Dataset[,percentchgn], NA)) Dataset$LLCI-with(Dataset,

[R] Removing replicated rows

2009-12-30 Thread faridamsb
Dear All, I have a matrix like X and need to create a new matrix based on the vector m which gives the number of replicates for each unique row. The resulting matrix should look like y. x x1 x2 [1,] 2 0.5 [2,] 2 0.5 [3,] 2 0.5 [4,] 6 1.0 [5,] 6 1.0 [6,] 6 1.0 [7,] 1 1.5 [8,] 1 1.5 [9,] 1

[R] What am I doing wrong in my loops?

2009-12-30 Thread James Rome
Dear kind list people: I have the following code: hours [1] 0 1 2 4 5 6 7 8 9 10 11 12 13 14 15 [16] 16 17 18 19 20 21 22 23 alist $`0` [1] 3 10 10 6 5 6 4 8 9 3 7 5 8 3 6 7 2 6 6 1 4 8 10 4 10 [26] 13 6 2 8 4 7 3 4 7 9 6 4 7 4 4 4 3 $`1` [1] 1 1

Re: [R] Plotting power function to practice data

2009-12-30 Thread Dror D Lev
Hi, I tried to be comprehensive but Jim's comment is indeed in place. I have data of a practice experiment where people practice a certain motor task and time-to-completion was recorded. Appropriately, the time measure declines as practice goes on. And, again appropriately, the relation seems to

[R] Squared correlation error

2009-12-30 Thread Nancy Adam
Hi everyone, Thanks a lot for the explanation… I tried the following code to compute R2 for a regression system but it does not work: my_svm_model - function(myformula, mydata, mytestdata) { mymodel - svm(myformula, data=mydata) k- summary(mymodel) k$r.squared } Can anyone please

Re: [R] NA or work around ??

2009-12-30 Thread Henrique Dallazuanna
Try this: Dataset$LLCI-with(Dataset, ave(Rcil, LEAID, Property, FUN = function(x)max(x, na.rm = TRUE))) On Wed, Dec 30, 2009 at 2:44 PM, L.A. ro...@millect.com wrote: I've searched and tried several ideas (na.action. and other things), but I can't see to figure this out. I'm guessing this

Re: [R] What am I doing wrong in my loops?

2009-12-30 Thread jim holtman
First of all your expression 'i*j' is storing on top of one another. Look at what happens in the case of i=1,j=8 i=2,j=4 i=4,j=2, These are all storing to the same location. Instead make 'mn' 'li' matrices: mn - matrix(length(alist), 1000) and then within the loop: mn[i,j] - value

Re: [R] What am I doing wrong in my loops?

2009-12-30 Thread James Rome
Oops. Thank you. I guess I needed mn[i*1000 + j]. I should have known better. But I had wanted to make this into a data frame with df=data.frame(mn, il) so that I could plot it using factors. Can I do that with a matrix? And can I eliminate the loops? On 12/30/09 12:11 PM, jim holtman wrote:

Re: [R] Removing replicated rows

2009-12-30 Thread Henrique Dallazuanna
Try this: unique(x)[rep(1:nrow(unique(x)), m),] On Wed, Dec 30, 2009 at 2:35 PM, farida...@gmail.com wrote: Dear All, I have a matrix like X and need to create a new matrix based on the vector m which gives the number of replicates for each unique row. The resulting matrix should look

Re: [R] Identifying outliers in non-normally distributed data

2009-12-30 Thread Jerry Floren
Greetings: I could also use guidance on this topic. I provide manure sample proficiency sets to agricultural labs in the United States and Canada. There are about 65 labs in the program. My data sets are much smaller and typically non-symmetrical with obvious outliers. Usually, there are 30 to

Re: [R] Plotting power function to practice data

2009-12-30 Thread Peter Ehlers
Sounds like you might want to use nls() to fit the data and then use either curve() or predict() to do the plotting. -Peter Ehlers Dror D Lev wrote: Hi, I tried to be comprehensive but Jim's comment is indeed in place. I have data of a practice experiment where people practice a certain

Re: [R] What am I doing wrong in my loops?

2009-12-30 Thread jim holtman
Here is a hint as to how to replace the loops: hours - 0:5 result - lapply(hours, function(.hr){ + cbind(.hr, replicate(5, mean(sample(1:100, 1000, replace=TRUE + }) do.call(rbind, result) .hr [1,] 0 50.232 [2,] 0 51.135 [3,] 0 49.169 [4,] 0 50.264 [5,] 0 52.621

Re: [R] Squared correlation error

2009-12-30 Thread Steve Lianoglou
Hi Nancy, On Wed, Dec 30, 2009 at 12:08 PM, Nancy Adam nancyada...@hotmail.com wrote: Hi everyone, Thanks a lot for the explanation… I tried the following code to compute R2 for a regression system but it does not work: my_svm_model - function(myformula, mydata, mytestdata) { mymodel

Re: [R] Squared correlation error

2009-12-30 Thread Max Kuhn
There is a function called defaultSummay in the caret package that will compute r-squared and rmse. Max On Dec 30, 2009, at 1:30 PM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi Nancy, On Wed, Dec 30, 2009 at 12:08 PM, Nancy Adam nancyada...@hotmail.com wrote: Hi

Re: [R] Identifying outliers in non-normally distributed data

2009-12-30 Thread Bert Gunter
Gents: Whole books could be -- and have been -- written on this matter. Personally, when scientists start asking me about criteria for outlier removal, it sends shivers up my spine and I break into a cold, clammy sweat. What is an outlier anyway? Statisticians (of which I'm one) have promulgated

Re: [R] Removing replicated rows

2009-12-30 Thread Farida Mostajabi
It worked perfectly. Thank you! On Wed, Dec 30, 2009 at 12:21 PM, Henrique Dallazuanna www...@gmail.comwrote: Try this: unique(x)[rep(1:nrow(unique(x)), m),] On Wed, Dec 30, 2009 at 2:35 PM, farida...@gmail.com wrote: Dear All, I have a matrix like X and need to create a new matrix

Re: [R] Plotting power function to practice data

2009-12-30 Thread Dror D Lev
Thank you Peter. nls() predict() seems to do the job. dror - On Wed, Dec 30, 2009 at 8:10 PM, Peter Ehlers ehl...@ucalgary.ca wrote: Sounds like you might want to use nls() to fit the data and then use either curve() or predict() to do the plotting. -Peter Ehlers

[R] lm() and factors appending

2009-12-30 Thread Idgarad
How for the love of god can I prevent the lm() function from padding on to my factor variables? I start out with 2 tables: Table1 123123 124351 ... 626773 Table2 Count,IS_DEAD,IS_BURNING 1231,T,F 4521,F,T ... 3321,T,T Everything looks fine when I import the data. then we get a oh_crap -

[R] capturing stdout

2009-12-30 Thread Nick Torenvliet
I'm wondering if anyone knows of a way to capture system messages, for instance when I do the following: system(../DBScripts/getEODData.sh) .//LSE_20091230.txt: 154.80 kB 207.24 kB/s ./Fundamentals//LSE.txt: 420.58 kB 301.47 kB/s

Re: [R] capturing stdout

2009-12-30 Thread Sarah Goslee
Nick, You don't specify OS, so details might differ, but on my linux system the help for system (which should be the first place you'd look anyway) has an entire section on stdout and stderr Stdout and stderr: Error messages written to ‘stderr’ will be sent by the shell to the

Re: [R] capturing stdout

2009-12-30 Thread Jim Holtman
?capture.output ?sink What is the problem you are trying to solve? Sent from my iPhone. On Dec 30, 2009, at 15:15, Nick Torenvliet nick.torenvl...@gmail.com wrote: I'm wondering if anyone knows of a way to capture system messages, for instance when I do the following:

Re: [R] lm() and factors appending

2009-12-30 Thread Peter Ehlers
Gee, so much excitement over such a little thing. So how exactly would you prefer lm() to tell you what levels of your factors are being taken as the reference levels? Post-processing, if necessary, would seem to be pretty trivial. If you want to re-run lm() on modified sets of predictors,

Re: [R] select elements and transpose

2009-12-30 Thread Dennis Murphy
Hi: An alternative is the following: # This regenerates your dataset: xx - list(matrix(1:9, nrow = 3, byrow = TRUE), matrix(10:18, nrow = 3, byrow = TRUE), matrix(19:27, nrow = 3, byrow = TRUE)) # Flatten matrix elements of each component into vectors: xxf - lapply(xx,

[R] factorial analysis influenced by data skewness

2009-12-30 Thread julien
Hello I run a factorial analysis on 20 variables describing the behaviour of insects on 9 different resistant plants. I then biologically interpreted each of the 5 factors obtained, with respect to the variables with the highest loading value for each factor. And I run a GLM on each factor with

[R] Fwd: Negbin Error Warnings

2009-12-30 Thread milton ruser
Dear Clara, Thanks for the reply. I am forwarding your message to the list, ok. When I wrote was a way of get further information to help the helpers. happy holidays, milton -- Forwarded message -- From: Clara Brück clara_bru...@web.de Date: 2009/12/30 Subject: Re: [R] Negbin

Re: [R] Positioning plots on top of each other (aligment borders)

2009-12-30 Thread Jim Lemon
On 12/30/2009 08:32 PM, Jay wrote: Hello, I want to place two plots on top of each other. However, the problem is that I can't figure out a simple way to align them correctly. Is there a way to specify this? Since the data is bunch of coordinates and the second layer is an outline of a map (a

[R] Error: Insufficient memory. Please close the console

2009-12-30 Thread Peter_Keller
I just upgraded to R version 2.10.1 Patched (2009-12-27 r50842) on WinXP, and I'm getting this error inconsistently both on start and close of sessions. I never saw it on previous versions (from 2.6 to 2.9). Not sure what to check on, I don't believe I'm using any more resources than I

[R] Robust Bivariate Poisson

2009-12-30 Thread ryusuke
To Experts, x = x1 + x3 y = x2 + x3 x3 = cov(x1,x2) By refer to package bivpois, I'ld like to downweight previous x,y in my data based on date, I am wondering if lambda3 should robust as well, since lambda3 measure the co-relationship of lambda1 and lambda2, but if robust lambda3 might effect

Re: [R] Fwd: Negbin Error Warnings

2009-12-30 Thread Peter Ehlers
Clara, The most likely problem is that theta==0 for some of the calculations. Or mu is NA, I suppose. -Peter Ehlers milton ruser wrote: Dear Clara, Thanks for the reply. I am forwarding your message to the list, ok. When I wrote was a way of get further information to help the helpers.

Re: [R] Error: Insufficient memory. Please close the console

2009-12-30 Thread Peter Ehlers
peter_kel...@fws.gov wrote: I just upgraded to R version 2.10.1 Patched (2009-12-27 r50842) on WinXP, and I'm getting this error inconsistently both on start and close of sessions. I never saw it on previous versions (from 2.6 to 2.9). Not sure what to check on, I don't believe I'm using any

[R] what don't I get about numeric/double comparisons in R way?

2009-12-30 Thread donahchoo
Hi, I'm pretty much an R noob and I'm missing some paradigm in R I think. I can't figure our how to compare numerics. here's a transcript of my tests. Any pointers? print(range_sd) [1] 34.40783 is.numeric(range_sd) [1] TRUE is.numeric(foo) [1] TRUE is.double(range_sd) [1] TRUE

Re: [R] what don't I get about numeric/double comparisons in R way?

2009-12-30 Thread Jim Lemon
On 12/31/2009 02:41 PM, donahc...@me.com wrote: Hi, I'm pretty much an R noob and I'm missing some paradigm in R I think. I can't figure our how to compare numerics. here's a transcript of my tests. Any pointers? Hi donahchoo, You're comparing the printed value of range_sd, which has been

Re: [R] what don't I get about numeric/double comparisons in R way?

2009-12-30 Thread donahchoo
On Dec 30, 2009, at 10:10 PM, Jim Lemon wrote: On 12/31/2009 02:41 PM, donahc...@me.com wrote: Hi, I'm pretty much an R noob and I'm missing some paradigm in R I think. I can't figure our how to compare numerics. here's a transcript of my tests. Any pointers? Hi donahchoo, You're

[R] cross validation for species distribution

2009-12-30 Thread elaine kuo
Dear, I wanna make cross-validation for the species data of species distribution models. Please kindly suggest any package containing cross validation suiting the purpose. Thank you. Elaine [[alternative HTML version deleted]] __

Re: [R] what don't I get about numeric/double comparisons in R way?

2009-12-30 Thread Peter Ehlers
donahc...@me.com wrote: On Dec 30, 2009, at 10:10 PM, Jim Lemon wrote: On 12/31/2009 02:41 PM, donahc...@me.com wrote: Hi, I'm pretty much an R noob and I'm missing some paradigm in R I think. I can't figure our how to compare numerics. here's a transcript of my tests. Any pointers?