Re: [R] Submit a R job to a server

2009-08-26 Thread Noah Silverman
Deb, I generally run my larger R tasks on a server. Here is my workflow. 1) Write an R script using a text editor. (There are many popular ones.) 2) FTP the R script to your server. 3) SSH into the server 4) Run R 5) Run the script that you uploaded from the R process you just started. On 8/2

Re: [R] Help on efficiency/vectorization

2009-08-26 Thread Moshe Olshansky
You can do for (i in 1:ncol(x)) {names <- rownames(x)[which(x[,i]==1)];eval(parse(text=paste("V",i,".ind<-names",sep="")));} --- On Thu, 27/8/09, Steven Kang wrote: > From: Steven Kang > Subject: [R] Help on efficiency/vectorization > To: r-help@r-project.org > Received: Thursday, 27 August

Re: [R] Help on efficiency/vectorization

2009-08-26 Thread Gerrit Eichner
Hi, Steven, try lapply( x, function( v) rownames(x)[ v == 1]) or lapply( x, function( v, rn) rn[ v == 1], rn = rownames( x))) which is faster. Regards -- Gerrit - AOR Dr. Gerrit Eichner Mathematical Institute

[R] Help on efficiency/vectorization

2009-08-26 Thread Steven Kang
Dear R users, I am trying to extract the rownames of a data set for which each columns meet a certain criteria. (condition - elements of each column to be equal 1) I have the correct result, however I am seeking for more efficient (desire vectorization) way in implementing such problem as it can

[R] Multiple correspondence analysis and extended Burt table

2009-08-26 Thread Ana Kolar
Hi there, Does anyone know how to create extended Burt table that includes rows and columns totals and further more how to create Burt table of relative frequencies and conditional relative frequencies. Hope to hear from some of you soon! Ana [[alternative HTML version delete

Re: [R] how to index a list with a string?

2009-08-26 Thread Peter Alspach
Tena koe Try either L[foo()] or L[[foo()]] These return subtly (or not so subtly depending on your point of view) different results. HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Ning Ma > Sent: Th

Re: [R] Submit a R job to a server

2009-08-26 Thread Moshe Olshansky
Hi Deb, Based on your last note (and after briefly looking at Rserve) I believe that you should install R with all the packages you need on the server and then use it like you are using any workstation, i.e. log in to it and do whatever you need. Regards, Moshe. --- On Thu, 27/8/09, Debabrat

Re: [R] how to index a list with a string?

2009-08-26 Thread David Winsemius
On Aug 26, 2009, at 11:35 PM, Ning Ma wrote: Hi, everybody. I have a list obj L, sth like $`aaa` [1] "5753" if the string 'aaa' is a returned value of a function foo(). what is the right syntax form of L$foo() What do you really want to achieve or to learn? Pretty much anything ending in

Re: [R] Does split() preserve order?

2009-08-26 Thread Charles C. Berry
On Wed, 26 Aug 2009, Alistair Gee wrote: If x is a vector (or data frame) that is in a particular order, and I call split(x, f) to partition x, will the elements of each partition remain in order? They must for example( split ) to work as advertised, viz. ### Calculate z-scores by gr

Re: [R] Submit a R job to a server

2009-08-26 Thread Debabrata Midya
Cedrick / Moshe, Thank you very much for such a quick response. My objective is to do the faster calculations by submitting a R job from my desktop to this server. Oracle 8i Enterprise Edition is currently running on this server. My objective is not only limited to access various oracle ta

Re: [R] set pdf.options() encoding to UTF-8

2009-08-26 Thread David Winsemius
On Aug 26, 2009, at 10:55 PM, Liviu Andronic wrote: Dear all Can anyone point to a list of valid pdf.options() encodings? I checked ?pdf and ?postscript, but they do not quite answer my questions. I would like to try UTF-8 instead of the default "ISOLatin1.enc" for Sweave plots (I have issues w

[R] how to index a list with a string?

2009-08-26 Thread Ning Ma
Hi, everybody. I have a list obj L, sth like $`aaa` [1] "5753" if the string 'aaa' is a returned value of a function foo(). what is the right syntax form of L$foo() I'm new to R, thanks in advance. __ R-help@r-project.org mailing list https://stat.eth

Re: [R] R package install problem

2009-08-26 Thread Martin Morgan
Hi Mark -- Your attachment didn't come through; I'd suggest inlining the output. This is a Bioconductor package so ask on the bioconductor mailing list https://stat.ethz.ch/mailman/listinfo/bioconductor Bioconductor packages are usually installed from within R, using source('http://biocondu

Re: [R] Winsorized mean and variance

2009-08-26 Thread David Winsemius
On Aug 26, 2009, at 8:58 PM, Roberto Perdisci wrote: Hello everybody, after searching around for quite some time, I haven't been able to find a package that provides a function to compute the Windorized mean and variance. Also I haven't found a function that computes the trimmed variance. Is t

[R] R package install problem

2009-08-26 Thread mark . edwards
Dear R-Help, I would be most grateful if you could inspect the attached install file. I would like to be able to use ShortRead to generate QA reports for Genome Analyzer output data. OS: Linux CentOS 5.3 on HP Proliant server . In process of installing "R" package after configuration flagging

[R] set pdf.options() encoding to UTF-8

2009-08-26 Thread Liviu Andronic
Dear all Can anyone point to a list of valid pdf.options() encodings? I checked ?pdf and ?postscript, but they do not quite answer my questions. I would like to try UTF-8 instead of the default "ISOLatin1.enc" for Sweave plots (I have issues with Greek characters in labels). Thank you Liviu --

Re: [R] Scripting - sort of

2009-08-26 Thread Charles Annis, P.E.
Thanks to Gabor Grothendieck and to David Huffer for suggesting autoit and autohotkey, neither of which I had heard of. I'll take a look. Thanks! Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Or

Re: [R] tweedie and lmer

2009-08-26 Thread Mohammad AlMarzouq
This is the link that gave me the indication: https://stat.ethz.ch/pipermail/r-help/2007-March/127261.html Are there alternative ways to deal with a high count of zeros for count data with lmer? __ R-help@r-project.org mailing list https://stat.eth

Re: [R] Submit a R job to a server

2009-08-26 Thread Cedrick W. Johnson
Good Morning Deb- It's unclear (to me at least) what you are trying to do.. What is the "server" running? Is it running RServe for which you have a userid and pwd or is it just a plain "server" running some OS? *IF* this is the case (RServe): on the windows machine you will need to: install

Re: [R] tweedie and lmer

2009-08-26 Thread Ben Bolker
Mohammad AlMarzouq gmail.com> writes: > > Hello all, > > I have count data with about 36% of observations being zeros. I found > in some of the examples of the r-help mail archives that a tweedie > family of distributions could be used to fit a model with random > effects. Upon installing

[R] Submit a R job to a server

2009-08-26 Thread Debabrata Midya
Dear R users, Thanks in advance. I am Deb, Statistician at NSW Department of Commerce, Sydney. I am using R 2.9.1 on Windows XP. May I request you to provide me information on the following: 1. I have access to a server ( I have userid and pwd) 2. What are the packages I need to submit

Re: [R] Problem merging two data frames

2009-08-26 Thread Mehdi Khan
Note: even if I say by=c("LON", "LAT"), it doesn't work, suggesting that number storage isn't the problem On Wed, Aug 26, 2009 at 6:19 PM, Mehdi Khan wrote: > Hello everyone, > > Merging two dataframes should be easy. However when I try to merge, R > doesn't recognize identical values, even if

[R] Problem merging two data frames

2009-08-26 Thread Mehdi Khan
Hello everyone, Merging two dataframes should be easy. However when I try to merge, R doesn't recognize identical values, even if I am doing it by values that have no decimals. willclayong: vs30 LON LAT Net X wills.cat wills.vs30 clahan.cat clahanvs30 PolyID.wills PolyID.clahan tif

[R] Winsorized mean and variance

2009-08-26 Thread Roberto Perdisci
Hello everybody, after searching around for quite some time, I haven't been able to find a package that provides a function to compute the Windorized mean and variance. Also I haven't found a function that computes the trimmed variance. Is there any such package around? thanks, Roberto

Re: [R] specify a model in differential equations (nlme)

2009-08-26 Thread spencerg
You might also try library(RSiteSearch) de <- RSiteSearch.function("differential equation") # This is different from des <- RSiteSearch.function("differential equations") # Combine as de. <- de | des # display: HTML(de.) Hope this helps. Spencer Graves Bert Gunter wrote: For n

Re: [R] Does split() preserve order?

2009-08-26 Thread Bert Gunter
Well, it depends on what you mean by "order". Split() (and most other R functions that group things by factor levels, to my knowledge) use the ordering of the factor levels -- which you can control via ordered(), for example -- but which is by default lexicographic, which may or may not be what you

[R] Does split() preserve order?

2009-08-26 Thread Alistair Gee
If x is a vector (or data frame) that is in a particular order, and I call split(x, f) to partition x, will the elements of each partition remain in order? That is, is the following assertion always TRUE? for(i in split(x, f)) { stopifnot(!is.unsorted(i)) } I suspect that this is the case, but

Re: [R] Managing output

2009-08-26 Thread Don MacQueen
See minor comment below -Don At 8:07 PM + 8/26/09, Oliver Bandel wrote: <- first part of email omitted -> < For many entries, it would be faster, if you just allocate the array that should be written, by just writing 0 into it, or empty strings or something like this... mydat[1:100] <-

Re: [R] find numbers in a line with letters

2009-08-26 Thread Bert Gunter
Re-using Gabor's suggestion from yesterday, I think the regex incantation gsub("[^[:digit:].]+"," ",x) also will do, where x is a your vector of strings. It says to replace runs of everything but digits and . with a single space. > x [1] "this Item costs 3.32 Dollars or maybe 10.00 cents" > gsub

Re: [R] find numbers in a line with letters

2009-08-26 Thread Steve Lianoglou
Hi, On Aug 26, 2009, at 6:38 PM, Martin Batholdy wrote: hi, is there an easy way to extract numbers from a string? for example I have; "this Item costs 3.32 Dollars" is there an easy way to extract the 3.32 as a number? Regular expressions to the rescue? Perhaps you'll need to fine tune i

Re: [R] Managing output

2009-08-26 Thread Phil Spector
Noah - Just allocate the maximum length that you'd ever need, and then change the length of the vector at the end of the program. By the way, here's a little demonstration of what a difference pre-allocation makes: system.time({x <- NULL;for(i in 1:1)x <- c(x,rnorm(1))}) user syste

Re: [R] find numbers in a line with letters

2009-08-26 Thread Gabor Grothendieck
Try this: library(gsubfn) s <- "this item costs 3.32 Dollars" strapply(s, "[0-9][0-9.]*", as.numeric)[[1]] See http://gsubfn.googlecode.com for more info. On Wed, Aug 26, 2009 at 6:38 PM, Martin Batholdy wrote: > hi, > > is there an easy way to extract numbers from a string? > > for example I ha

[R] find numbers in a line with letters

2009-08-26 Thread Martin Batholdy
hi, is there an easy way to extract numbers from a string? for example I have; "this Item costs 3.32 Dollars" is there an easy way to extract the 3.32 as a number? thanks! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Managing output

2009-08-26 Thread Rolf Turner
On 27/08/2009, at 10:06 AM, Noah Silverman wrote: Phil, Pre-allocation makes sense. However, I don't know the size of my resulting vector when starting. In my loop, I only pull off results that meet a certain threshold. -N I already basically told you how to handle this:

Re: [R] Managing output

2009-08-26 Thread Noah Silverman
Phil, Pre-allocation makes sense. However, I don't know the size of my resulting vector when starting. In my loop, I only pull off results that meet a certain threshold. -N On 8/26/09 2:07 PM, Phil Spector wrote: > Noah - >I would strongly advise you to preallocate the result vector > us

Re: [R] contourLines() documentation

2009-08-26 Thread Ben Bolker
Derek Lacoursiere wrote: > > Hello, > > I have searched for documentation on the function contourLines's algorithm > but cannot find a thing. I am about to submit a paper to a journal but > cannot yet do so because I need to provide some reference for this > function. Does anyone know what

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread Charles C. Berry
On Wed, 26 Aug 2009, milton ruser wrote: Hi David & all, It is me again. When I try with a sample matrix (10x10) it appears to be good. But when I apply to a real 512x512 landscape, with values ranging from 1 to 10,000 It is still time expensive (please, see below): If the values are integers

[R] Invitation to connect on LinkedIn

2009-08-26 Thread Neelima Aitha
LinkedIn I'd like to add you to my professional network on LinkedIn. - Neelima Learn more: https://www.linkedin.com/e/isd/703337211/jOXgh_jv/ -- (c) 2009, LinkedIn Corporation [[alternative HTML version deleted]] _

[R] as.ltraj error: date should be of the same length as xy

2009-08-26 Thread Mako13
Hello! Im really not a whiz at this stuff so please bear with me I have radio tracking data involving relocations of raccoons over the course of a night (locations every 20 minutes). I have the date and time of each location. I am trying to convert the data into an type II ltraj so I can

Re: [R] lm coefficients output confusing

2009-08-26 Thread Ross Culloch
Hi Daniel, Sorry for the late reply - thank you very much for your reply, it's much appreciated. I think you make a very valid point, I'm capable in R to a reasonable extent, but i am indeed unfamiliar with regression analyses but i'm certainly learning fast. Your reply has been very helpful in

Re: [R] lm coefficients output confusing

2009-08-26 Thread Ross Culloch
Hi Ted, Firstly, so sorry for the late reply - thank you very much for your detailed and patient answer. It was a big help for me and gave me a big step forward in understanding the lm function! I really appreciate the time you took (and everyone on here takes!), Best wishes, Ross -- View t

Re: [R] MSM package and qmatrix

2009-08-26 Thread Ross Culloch
Hi Peter, Thanks for the advice! That has done the trick, much appreciated. Ross Peter Adamson wrote: > > Hi Ross, > > For an eleven state model you could define transitions as follows: > > transitions_allowed <- matrix(c( > 0,1,1,1,1,1,1,1,1,1,1, >

[R] Dendrogram orientation

2009-08-26 Thread Jopi Harri
Besides the facility to plot dendrograms vertically and horizontally, is there any chance to plot them mirrored, i.e., instead of shaping them like ,-, and E have them like '-' and 3 (I hope that my minimalistic visualization is legible)? If there is, how might that be accomplished (other than mir

Re: [R] Applying do.call to a data.frame using function arguments

2009-08-26 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of miller_2555 > Sent: Wednesday, August 26, 2009 9:32 AM > To: r-help@r-project.org > Subject: Re: [R] Applying do.call to a data.frame using > function arguments > > > > mille

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
Hi william, Now it is very fast. Thanks for you and also for David for your time. cheers milton On Wed, Aug 26, 2009 at 3:48 PM, William Dunlap wrote: > > > Bill Dunlap > TIBCO Software Inc - Spotfire Division > wdunlap tibco.com > > > -Original Message- > > From: r-help-boun...@r-pr

Re: [R] Managing output

2009-08-26 Thread Oliver Bandel
Oliver Bandel first.in-berlin.de> writes: [...] > For many entries, it would be faster, if you just allocate > the array that should be written, by just writing 0 into it, > or empty strings or something like this... > > mydat[1:100] <- 0 > > mydat > [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Re: [R] Managing output

2009-08-26 Thread Duncan Murdoch
On 26/08/2009 4:06 PM, Rolf Turner wrote: On 27/08/2009, at 8:00 AM, Duncan Murdoch wrote: On 26/08/2009 3:20 PM, Noah Silverman wrote: Hi, Is there a way to build up a vector, item by item. In perl, we can "push" an item onto an array. How can we can do this in R? I have a loop that gener

Re: [R] Managing output

2009-08-26 Thread Oliver Bandel
Noah Silverman smartmediacorp.com> writes: > > Hi, > > Is there a way to build up a vector, item by item. In perl, we can > "push" an item onto an array. How can we can do this in R? > I have a loop that generates values as it goes. I want to end up with a > vector of all the loop results.

Re: [R] Managing output

2009-08-26 Thread Rolf Turner
On 27/08/2009, at 8:00 AM, Duncan Murdoch wrote: On 26/08/2009 3:20 PM, Noah Silverman wrote: Hi, Is there a way to build up a vector, item by item. In perl, we can "push" an item onto an array. How can we can do this in R? I have a loop that generates values as it goes. I want to end up

Re: [R] Managing output

2009-08-26 Thread Duncan Murdoch
On 26/08/2009 3:20 PM, Noah Silverman wrote: Hi, Is there a way to build up a vector, item by item. In perl, we can "push" an item onto an array. How can we can do this in R? I have a loop that generates values as it goes. I want to end up with a vector of all the loop results. In perl i

[R] contourLines() documentation

2009-08-26 Thread Derek Lacoursiere
Hello, I have searched for documentation on the function contourLines's algorithm but cannot find a thing. I am about to submit a paper to a journal but cannot yet do so because I need to provide some reference for this function. Does anyone know what algorithm is used for this function? Than

[R] Plotting to stdout

2009-08-26 Thread Oliver Bandel
Hello, is there a way to write the result of a plot to stdout? I mean even a binary thingy like a png-file, written to stdout?! I tried with the file-argument of png() and jpeg(), but did not get working results. Ciao, Oliver __ R-help@r-project.or

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread William Dunlap
Bill Dunlap TIBCO Software Inc - Spotfire Division wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of milton ruser > Sent: Wednesday, August 26, 2009 9:54 AM > To: r-help@r-project.org > Subject: [R] changin

Re: [R] Managing output

2009-08-26 Thread Noah Silverman
The actually process is REALLY complicate, I just gave a simple example for the list. I have a lot of steps to process the data before I get a final "score". (nested loops, conditional statements, etc.) Right now, I'm just printing the scores to the screen. I'd like to accumulate them in so

Re: [R] Managing output

2009-08-26 Thread Erik Iverson
How about ?append, but R is vectorized, so why not just result_list <- 2*item^2 , or for more complicated tasks, the apply/sapply/lapply/mapply family of functions? In general, the "for" loop construct can be avoided so you don't have to think about messy indexing. What exactly are you trying

[R] Managing output

2009-08-26 Thread Noah Silverman
Hi, Is there a way to build up a vector, item by item. In perl, we can "push" an item onto an array. How can we can do this in R? I have a loop that generates values as it goes. I want to end up with a vector of all the loop results. In perl it woud be: for(item in list){ result <- 2

[R] Trying to make Nas 0

2009-08-26 Thread Dumblauskas, Jerry
I have an lm object called mro A summary gives > summary(mro) Call: lm(formula = REGRESSIONSTRING, data = wData) Residuals: Min 1Q Median 3Q Max -8.18077 -1.06867 -0.09387 1.03153 11.20201 Coefficients: (1 not defined because of singularities) Estimat

Re: [R] specify a model in differential equations (nlme)

2009-08-26 Thread Bert Gunter
For nlme, no. However, take a look at the CRAN Task View for pharmokinetics and packages recommended there, especially nlmeODE . You might also try R's search capabilities: RSiteSearch("differential equations") ?RSiteSearch of other non-R search engines Bert Gunter Genentech Nonclinical Biostat

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
Hi David & all, It is me again. When I try with a sample matrix (10x10) it appears to be good. But when I apply to a real 512x512 landscape, with values ranging from 1 to 10,000 It is still time expensive (please, see below): mymat <- matrix ( c ( 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0

Re: [R] ggplot2: geom_smooth and legend

2009-08-26 Thread hadley wickham
Hi Benoit, You could turn the standard errors off with se = F. Then they'll be removed from the legend as well. Hadley On Tue, Aug 18, 2009 at 7:43 AM, Benoit Boulinguiez wrote: > Sorry I forgot the code that goes with > > **CODE > desorb_plot<-ggplot() + > >        geom_smooth(data=DATA.B1

[R] specify a model in differential equations (nlme)

2009-08-26 Thread Jun Shen
Dear all, I wonder if there is a way to specify a model in differential equations for nlme(). Or in other packages? Appreciate any comment. Thanks. Jun Shen [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat

Re: [R] rJava error for large XML object return in StatET plugin

2009-08-26 Thread Steve Lianoglou
Hi, On Aug 26, 2009, at 1:31 PM, Harsh wrote: Hi R List, I get this error using StatET R plugin in Eclipse. You might have more luck asking the StatET user mailing list: https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/statet-user -steve -- Steve Lianoglou Graduate Student: Com

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
Hi David, Now is perfect!! Thanks a lot milton On Wed, Aug 26, 2009 at 1:30 PM, David Huffer wrote: > You could try either of the two examples below. They both assume that min > and max are invariant: > > mymat <- matrix ( > c ( >1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,

Re: [R] Batch replacement, by factor, of values in a data frame

2009-08-26 Thread Gavin Simpson
On Wed, 2009-08-26 at 08:06 -0700, Phil Spector wrote: > The ave function is very handy for things like this: > > mins = ave(D$Var,D$Site,FUN=function(x)min(x[x>0],na.rm=TRUE)) > D$Var = ifelse(is.na(D$Var) | D$Var == 0,mins,D$Var) > > should do the required replacements. Thanks Phil, that's gre

[R] rJava error for large XML object return in StatET plugin

2009-08-26 Thread Harsh
Hi R List, I get this error using StatET R plugin in Eclipse. >sessionInfo() R version 2.9.0 (2009-04-17) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 I am

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread David Huffer
You could try either of the two examples below. They both assume that min and max are invariant: mymat <- matrix ( c ( 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 2 , 2 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 2 , 2 , 2 , 0 , 0 , 0 , 0 , 3 , 3 , 0 , 0 , 0 , 0 , 0 , 0 ,

Re: [R] Applying do.call to a data.frame using function arguments (nabble: message 8 of 20)

2009-08-26 Thread nabble . 30 . miller_2555
On Wed, Aug 26, 2009 at 12:47 PM, hadley wickham - > I think you're missing some quotes: > cat(do.call("paste",c(x2,sep='","'))[1], "\n") Thanks - the strings are actually substrings of larger strings (specifically, SQL statements), which will wrap with the leading and trailing quotes (though I sh

Re: [R] access to source code of a website ..?

2009-08-26 Thread Duncan Murdoch
On 8/26/2009 12:44 PM, Martin Batholdy wrote: hi, is it possible to read the source code of a website within R? url("http://example.com";) creates a connection that you can do what you like with. For example, readLines(url("http://www.r-project.org";)) Duncan Murdoch

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
Hi David, Thanks for the reply. This is what I need: > mymat[mymat==1] <- runif(1,min=0.4,max=0.7) > mymat [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 0.457316100200000 3 0 [2,] 0.457316100202000

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread David Winsemius
On Aug 26, 2009, at 12:53 PM, milton ruser wrote: Dear all, I have about 30,000 matrix (512x512), with values from 1 to N. Each value on a matrix represent a habitat patch on my matrix (i.e. my landscape). Non-habitat are stored as ZERO. No I need to change each 1-to-N values for the same rand

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread David Huffer
You want to replace all 1s each with the same random nuumber from the uniform distribution, then all 2s each with the same random nuumber from the uniform distribution, and so forth? Are the arguments (i.e., the min and max of the distribution) to each call to runif identical? -- David   ---

[R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
Dear all, I have about 30,000 matrix (512x512), with values from 1 to N. Each value on a matrix represent a habitat patch on my matrix (i.e. my landscape). Non-habitat are stored as ZERO. No I need to change each 1-to-N values for the same random number. Just supose my matrix is: mymat<-matrix(c(

Re: [R] GLMs

2009-08-26 Thread Ben Bolker
Letizia Campioni wrote: > > > Hi, > > I am starting to work with R. > > I need to performe a General linear model and a Generalized mixed model, > what are the package I have to use for? > > what is the difference between them? > > General linear models (called GLM mostly by SAS users)

Re: [R] Applying do.call to a data.frame using function arguments

2009-08-26 Thread hadley wickham
On Wed, Aug 26, 2009 at 11:31 AM, miller_2555 wrote: > > > miller_2555 wrote: >> >> I'm trying to convert a data.frame to a series of strings (row-wise). >> There was a very good discussion awhile back (2002) entitled "[R] string >> concatenate across rows of a matrix??" where Tony Plate recommende

[R] access to source code of a website ..?

2009-08-26 Thread Martin Batholdy
hi, is it possible to read the source code of a website within R? __ 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 and provide commented, mini

Re: [R] Applying do.call to a data.frame using function arguments

2009-08-26 Thread miller_2555
miller_2555 wrote: > > I'm trying to convert a data.frame to a series of strings (row-wise). > There was a very good discussion awhile back (2002) entitled "[R] string > concatenate across rows of a matrix??" where Tony Plate recommended the > following two alternatives (x2 is an R object of typ

Re: [R] Scripting - sort of

2009-08-26 Thread Gabor Grothendieck
autoit and autohotkey are two free Windows utilities based on the basic language that can be used for GUI scripting. On Wed, Aug 26, 2009 at 12:22 PM, Charles Annis, P.E. wrote: > Dear R-ians: > > > > I'm running R2.9.2 on a 6 year old Windows XP DELL with 2 Gig RAM and a 3MHz > Pentium 4 chip. >

[R] tweedie and lmer

2009-08-26 Thread Mohammad AlMarzouq
Hello all, I have count data with about 36% of observations being zeros. I found in some of the examples of the r-help mail archives that a tweedie family of distributions could be used to fit a model with random effects. Upon installing the tweedie package and attempting to fit the follo

[R] Applying do.call to a data.frame using function arguments

2009-08-26 Thread miller_2555
I'm trying to convert a data.frame to a series of strings (row-wise). There was a very good discussion awhile back (2002) entitled "[R] string concatenate across rows of a matrix??" where Tony Plate recommended the following two alternatives (x2 is an R object of type data frame -- a matrix also w

[R] Scripting - sort of

2009-08-26 Thread Charles Annis, P.E.
Dear R-ians: I'm running R2.9.2 on a 6 year old Windows XP DELL with 2 Gig RAM and a 3MHz Pentium 4 chip. I've written a package using the User Menus Under Windows commands (winMenuAdd, etc). It works very well. I have 6 test cases and running any one of them requires many selections

Re: [R] Problem with RHEL 5 repo and the latest R RPMs

2009-08-26 Thread Hugh Brown
Martyn Plummer wrote: > It turns out that the default checksum for "createrepo", the command > that creates repository metadata, has changed from sha1 to sha256, > whereas Enterprise Linux 5 still requires sha1. I have modified the > scripts to use the older checksum for EL4 and EL5. > > Sorry for

Re: [R] GLMs

2009-08-26 Thread Steve Lianoglou
Hi, On Aug 26, 2009, at 6:53 AM, Letizia Campioni wrote: Hi, I am starting to work with R. I need to performe a General linear model and a Generalized mixed model, what are the package I have to use for? R> RSiteSearch("general linear model") R> RSiteSearch("Generalized mixed model") W

Re: [R] Help regarding frequency distribution Graphs

2009-08-26 Thread milton ruser
Google "R gallery" :-) On Wed, Aug 26, 2009 at 7:32 AM, anupam sinha wrote: > Hi all, >I am trying to construct a frequency distribution graph i.e. > suppose there is a variable *"k"* and it takes a range of values. What I > want to do is to plot *"P(k)" *(probability/frequency of fin

Re: [R] Select top three values from data frame

2009-08-26 Thread Don MacQueen
Do you want just the values (i.e., a vector), or do you also want the corresponding rows of the data frame? What if there is a tie, or do you know in advance that within any particular subset the values of B are unique? What if the subset that meets the constraints has fewer than 3 unique va

Re: [R] mann whitney u

2009-08-26 Thread Stefan Grosse
On Wed, 26 Aug 2009 12:18:53 +0100 "Mcdonald, Grant" wrote: MG> is the wilcox.test function equivalent to mann-whitney u? Is there Yes, the test is the same. It is also called wilcoxon mann whitney test because the authors created the test independently. MG> a way to gain the U-value as appose

Re: [R] increasing significant digits in smooth.spline function

2009-08-26 Thread David Winsemius
On Aug 26, 2009, at 9:26 AM, Sergii, Ivakhno wrote: Hello All I have a very long vector of unique predictor values and 6 significant digits setting for the smooth.spline rounds them off. Is there any way of increasing the significant digits withour recompiling a lot if code (simple editing and

Re: [R] Installing rJava RJDBC bad interpreter: Permission denied

2009-08-26 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Matias Silva > Sent: Wednesday, August 26, 2009 7:37 AM > To: r-help@r-project.org > Subject: [R] Installing rJava RJDBC bad interpreter: Permission denied > > Trying to install

Re: [R] Help regarding frequency distribution Graphs

2009-08-26 Thread David Winsemius
On Aug 26, 2009, at 7:32 AM, anupam sinha wrote: Hi all, I am trying to construct a frequency distribution graph i.e. suppose there is a variable *"k"* and it takes a range of values. What I want to do is to plot *"P(k)" *(probability/frequency of finding a specific value of *

Re: [R] mann whitney u

2009-08-26 Thread David Winsemius
On Aug 26, 2009, at 7:18 AM, Mcdonald, Grant wrote: Dear Sir, I am comparing two samples using wilcox.test in R. Literature appears to describe mann whitney u test as the most appropriate test to use on my data. is the wilcox.test function equivalent to mann-whitney u? When used in it

Re: [R] faulty formatting of toLatex(sessionInfo())

2009-08-26 Thread Liviu Andronic
On 8/26/09, Frank E Harrell Jr wrote: > G. Jay Kerns wrote: > > There was a closely related discussion last April: > > > > > https://stat.ethz.ch/pipermail/r-devel/2009-April/053094.html > > > > and IIRC this was fixed for R version 2.10. > > > If you still have trouble just do > > s <- toLatex(

Re: [R] lme: how to nest a random factor in a fixed factor?

2009-08-26 Thread ONKELINX, Thierry
Dear Robert, Since you have only 4 sites, a random effect is not so good. You would need at least 6 sites for a good estimate of the variance. You have enough data to treat site as a fixed effects. It only costs 2 extra degrees of freedom. Therefore I would model this like: lm(response ~ (area/s

Re: [R] glmmPQL model selection

2009-08-26 Thread stephenb
Sorry for the late reply. Just use the first 90% of your data to fit and then predict the last 10% and see which one is better. If the random effects are not good it will become very obvious. If the concern is with fixed effects then just use gls which puts the random effects in the error and s

Re: [R] Statistical question about logistic regression simulation

2009-08-26 Thread Ravi Varadhan
Your exposure variable has very large values, so all your probabilities are 1. You also get a bunch of NaN's because the `expit' (inverse logit) function to calculate the probabilities cannot be evaluated. You need to use values of exposure that will yield some 0's and 1's so that the binomial mode

Re: [R] glmmPQL and variance structure

2009-08-26 Thread stephenb
this is very late, but I saw this now as I am dealing with it now: I think varPower should not be needed here. The family should be one of the quasi families eg quasibinomial and that will automatically allow variance/dispersion to become a function of the fit. This is a feature of glm inherently

Re: [R] Batch replacement, by factor, of values in a data frame

2009-08-26 Thread Phil Spector
The ave function is very handy for things like this: mins = ave(D$Var,D$Site,FUN=function(x)min(x[x>0],na.rm=TRUE)) D$Var = ifelse(is.na(D$Var) | D$Var == 0,mins,D$Var) should do the required replacements. - Phil Spector

Re: [R] Statistical question about logistic regression simulatio

2009-08-26 Thread Ted Harding
On 26-Aug-09 14:17:40, Denis Aydin wrote: > Hi R help list > I'm simulating logistic regression data with a specified odds ratio > (beta) and have a problem/unexpected behaviour that occurs. > > The datasets includes a lognormal exposure and diseased and healthy > subjects. > > Here is my loop:

Re: [R] attach package

2009-08-26 Thread Duncan Murdoch
On 8/26/2009 8:17 AM, Jeremy MAZET wrote: Hello, Is there a solution to attach a package without run the hook function .onAttach() You could modify the source code to remove the hook, but why you'd want to do this, I don't know. Presumably the author of the package had a reason to put the

[R] Batch replacement, by factor, of values in a data frame

2009-08-26 Thread Gavin Simpson
Dear List, I'm wondering if there is a better/cleaner/more efficient way of replacing 0 values in a variable with the minimum of the non-missing and non-zero values of that same variable, but doing it within the levels of a factor? Consider the dummy example data presented at the end of my messag

[R] increasing significant digits in smooth.spline function

2009-08-26 Thread Sergii, Ivakhno
Hello All I have a very long vector of unique predictor values and 6 significant digits setting for the smooth.spline rounds them off. Is there any way of increasing the significant digits withour recompiling a lot if code (simple editing and tham sourcing of "smooth.spline.r" function does not wo

[R] mann whitney u

2009-08-26 Thread Mcdonald, Grant
Dear Sir, I am comparing two samples using wilcox.test in R. Literature appears to describe mann whitney u test as the most appropriate test to use on my data. is the wilcox.test function equivalent to mann-whitney u? Is there a way to gain the U-value as apposed to the W-value in R? Thank y

  1   2   >