Re: [R] substitute, expression and factors

2010-05-18 Thread baptiste auguie
Thank you for the explanation, and the fortune-ish quote, “As the documentation for substitute() says, there is no guarantee that the result makes sense.” Best, baptiste On 19 May 2010 02:59, Duncan Murdoch wrote: > On 18/05/2010 4:36 PM, baptiste auguie wrote: >> >> Dear list, >> >> I am puzz

Re: [R] avoiding reinstall already installed *package*

2010-05-18 Thread Henrik Bengtsson
On Wed, May 19, 2010 at 7:20 AM, milton ruser wrote: > *but* going back to my question, is not true > that already installed packages will not be > reinstaled. I ran: > > install.packages(c("ggplot2"),dependencies=T) > install.packages(c("mgcv","bbmle","akima","drc","sensitivity","tgp"),dependenci

Re: [R] avoiding reinstall already installed *package*

2010-05-18 Thread milton ruser
*but* going back to my question, is not true that already installed packages will not be reinstaled. I ran: install.packages(c("ggplot2"),dependencies=T) install.packages(c("mgcv","bbmle","akima","drc","sensitivity","tgp"),dependencies=T) and several packages installed during the first install.pa

Re: [R] scaling with relative units in plots or retrieving axes limits in plots

2010-05-18 Thread Greg Snow
Look at the grconvertX and grconvertY functions for a built in solution with much more flexibility. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] Text positioning in pixel coordinates?

2010-05-18 Thread Greg Snow
?grconvertX -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Oliver > Sent: Monday, May 17, 2010 8:24 AM > To

Re: [R] GUI commands to call for a protein from protein data bank

2010-05-18 Thread Amitoj S. Chopra
Thank you it worked perfectly. I just needed to close the window that was the problem. Do you know how to close the window automatically and why does that matter? Thanks! Amitoj On Tue, May 18, 2010 at 12:10 PM, Amitoj Chopra wrote: > I tried doing that and this is what I go: > > > dlg <-

Re: [R] issues with R Library on a Server

2010-05-18 Thread Daisy Englert Duursma
Hello, Thanks for your help so far, I am still having the same problem but I think I am getting closer. Just to recap, since setting up R on my server, so that everyone shares a common Library, I have had issues getting packages to load. Here is an example with the package survival. I have the sur

Re: [R] Query on linear mixed model

2010-05-18 Thread Vijayan Padmanabhan
Thanks Ista.. I will take your suggestion. Regards Vijayan Padmanabhan "What is expressed without proof can be denied without proof" - Euclide. Ista Zahn

Re: [R] Query on linear mixed model

2010-05-18 Thread Vijayan Padmanabhan
Thanks Joshua.. It really helped in polishing my coding essentials in R. Thanks & Regards Vijayan Padmanabhan "What is expressed without proof can be denied without proof" - Euclide. Joshua

Re: [R] Box-Cox Transformation: Drastic differences when varying added constants

2010-05-18 Thread Frank E Harrell Jr
On 05/18/2010 10:41 PM, Greg Snow wrote: Have you read the BoxCox paper? It has the theory in there for dealing with an offset parameter (though I don't know of any existing functions that help in estimating both lambdas at the same time). Though another important point (in the paper as well

Re: [R] Box-Cox Transformation: Drastic differences when varying added constants

2010-05-18 Thread Greg Snow
Have you read the BoxCox paper? It has the theory in there for dealing with an offset parameter (though I don't know of any existing functions that help in estimating both lambdas at the same time). Though another important point (in the paper as well) is that the lambda values used should be

Re: [R] p value

2010-05-18 Thread Greg Snow
An option similar to Bert's but looking more like a standard hypothesis test output is to use the function: SnowsCorrectlySizedButOtherwiseUselessTestOfAnything from the TeachingDemos package. If you want a more useful result then you will need to be less general and more specific. -- Gregory

Re: [R] abline limit constrain x-range how?

2010-05-18 Thread Greg Snow
The clip function will limit the area that other functions (including abline) plot to, so that is one option. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mai

Re: [R] Maximization of quadratic forms

2010-05-18 Thread Ravi Varadhan
Hi Taki, This should be doable with "gnls" by properly specifying the `weights' argument, although I cannot figure out how to do it without spending much time (someone like Doug Bates would know for sure). But let me ask you: did you try the straightforward nonlinear optimization (e.g. optim)

Re: [R] automate curve drawing on nls() object

2010-05-18 Thread Shi, Tao
In this case, Ben's approach is the way to go. I'm curious how you fit nls without knowing the model formula beforehand? ...Tao - Original Message > From: array chip > To: r-help@r-project.org; TaoShi > Sent: Tue, May 18, 2010 5:22:47 PM > Subject: Re: [R] automate curve drawing

Re: [R] substitute, expression and factors

2010-05-18 Thread Duncan Murdoch
On 18/05/2010 4:36 PM, baptiste auguie wrote: Dear list, I am puzzled by this, substitute(expression(x), list(x = factor(letters[1:2]))) # expression(1:2) Why do I get back the factor levels inside the expression and not the labels? As the documentation for substitute() says, there is no gu

Re: [R] automate curve drawing on nls() object

2010-05-18 Thread array chip
Sorry that I forgot to attach the data file. Indeed, this is a much simpler way to do this. Thanks --- On Tue, 5/18/10, Ben Bolker wrote: > From: Ben Bolker > Subject: Re: [R] automate curve drawing on nls() object > To: r-h...@stat.math.ethz.ch > Date: Tuesday, May 18, 2010, 7:33 PM > arra

Re: [R] automate curve drawing on nls() object

2010-05-18 Thread array chip
well, this is not going automate enough because you have to know how the model (formula) looks like, and how many parameters there are in the model beforehand to do what you are suggesting. Thanks --- On Tue, 5/18/10, Shi, Tao wrote: > From: Shi, Tao > Subject: Re: [R] automate curve drawin

Re: [R] automate curve drawing on nls() object

2010-05-18 Thread Shi, Tao
I can't directly answer your question regarding 'expression', but can you just replace b, c,d, and e with coef(obj)[1], coef(obj)[2], ... etc. You still can automate the whole process this way, right? - Original Message > From: array chip > To: r-help@r-project.org > Sent: Tue, M

Re: [R] How to display data values for points in a plot?

2010-05-18 Thread Greg Snow
It depends on what you mean by display values. In addition to the other suggestions also look at the identify function as well as TkIdentify and HTKidentify in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.40

Re: [R] automate curve drawing on nls() object

2010-05-18 Thread Ben Bolker
array chip yahoo.com> writes: > Hi, I would like to use the curve() function to draw the > predicted curve from an nls() object. for example: > Is there a reason you don't want to use plot() and predict() ??? > dd<-read.table("dd.txt",sep='\t',header=T,row.names=1) note that this is no

Re: [R] Function that is giving me a headache- any help appreciated (automatic read )

2010-05-18 Thread Hadley Wickham
> precip.1 <- subset(DF, precipitation!="NA") > b <- ddply(precip.1$precipitation, .(precip.1$gauge_name), cumsum) > DF.precip <- precip.1 > DF.precip$precipitation <- b$.data I suspect what you want here is ddply(precip.1, "gauge_name", transform, precipitation = cumsum(precipitation)) Hadley

Re: [R] A problem in allocation of vector of size

2010-05-18 Thread jim holtman
You have run out of memory. What OS are you using, how much physical memory do you have? how large are the objects you already have in your data space? Have you removed all extraneous objects and done 'gc()'? The solution is to get better control of your data space and understand what is using i

[R] automate curve drawing on nls() object

2010-05-18 Thread array chip
Hi, I would like to use the curve() function to draw the predicted curve from an nls() object. for example: dd<-read.table("dd.txt",sep='\t',header=T,row.names=1) obj<-nls(y~c+(d-c)/(1+(x/e)^b),data=dd,start=list(b=-1, c=0, d=100, e=150)) coef(obj) b c d e

Re: [R] Dealing with 1000+ sequentially named vectors

2010-05-18 Thread jim holtman
This sounds like a perfect use of "list" and the 'sapply/lapply' functions: > # list with 100 dataframes > df.list <- lapply(1:100,function(x) data.frame(a=1:10, b=1:10)) > # create a new list with a random value of 'a' > new.list <- sapply(df.list, function(x) sample(x$a, 1)) > > > new.list [1]

[R] Dealing with 1000+ sequentially named vectors

2010-05-18 Thread Q
Hello! I'm having trouble figuring out how to apply a function to a set of vectors or data frames, when that set is over 1000 large. I've created 1891 vectors named as follows: vector.names <- paste("vector",1:1891,sep="") These can be referred to easily by using get as follows: vector <

Re: [R] sem error "no variance or error-variance parameter"

2010-05-18 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Jan Schubert > Sent: Tuesday, May 18, 2010 12:51 PM > To: r-help@r-project.org > Subject: [R] sem error "no variance or error-variance parameter" > > > Hi, > I am sorry to post

Re: [R] best polynomial approximation

2010-05-18 Thread Patrizio Frederic
Dear colleagues, thank you so much for your help. Hans, I think the Remez algorithm is what I need. I will brush up on fortran language. Ravi, thanks anyway, I appreciated. All the best, Patrizio On Tue, May 18, 2010 at 12:10 PM, Hans W Borchers wrote: > > I guess you may be looking for the R

Re: [R] Function that is giving me a headache- any help appreciated (automatic read )

2010-05-18 Thread Peter Ehlers
On 2010-05-18 11:00, John Kane wrote: I don't think you can do this precipitation!="NA") Actually, that will work here, although it should always be avoided. Do use is.na(). The main problem seems to be that the ddply() call doesn't work. I would just use tapply() and unlist(): b <- with(pr

Re: [R] get the row sums

2010-05-18 Thread Joshua Wiley
Hello, Can you run str() on your data and report the results? str(en.id.pr) I suspect that one of your variables that you are trying to sum over is a factor. HTH, Josh 2010/5/18 Changbin Du : >> head(en.id.pr) >     valid.gene_id b.pred rf.pred svm.pred > 1521    2500151211      0       0    

Re: [R] get the row sums

2010-05-18 Thread Changbin Du
Thanks, David! Yes, I found it just as you said. It works now after change to numeric. On Tue, May 18, 2010 at 1:53 PM, David Winsemius wrote: > > On May 18, 2010, at 4:32 PM, Changbin Du wrote: > > head(en.id.pr) >>> >>valid.gene_id b.pred rf.pred svm.pred >> 15212500151211 0

[R] [R-pkgs] The npRmpi package (parallel np package for multi-core environments)

2010-05-18 Thread Jeffrey Racine
Dear R users, A parallel implementation of the np package titled `npRmpi' is now available on CRAN. This package can take advantage of multiple core computing environments to reduce the run time associated with the methods contained in the np package. Kindly see the vignette for details and ex

Re: [R] get the row sums

2010-05-18 Thread David Winsemius
On May 18, 2010, at 4:32 PM, Changbin Du wrote: head(en.id.pr) valid.gene_id b.pred rf.pred svm.pred 15212500151211 0 00 366 639679745 0 00 19652502081603 1 11 1420 644148030 1 11 1565250062648

[R] Problem getting characters into a dataframe

2010-05-18 Thread Chris Strachan
Hi, I am having a problem getting character (string) variables into a dataframe. I seem to have no problem with numeric fields, but character fields are appearing as a "1". In my problem I need to retrieve some information from an SQL database using RODBC one line at a time and then update

Re: [R] Res: Using the zero-inflated binomial in experimental designs

2010-05-18 Thread Ben Bolker
Ivan Allaman yahoo.com.br> writes: > > > Hi Ben! > > First I thank you for your attention. Unfortunately, the ANOVA does not work with vglm. In > another email, Rafael warned me that actually a lot of zeros does not > necessarily imply a distribution of zeros binomail inflated. So how could I

Re: [R] avoiding reinstall already installed *package*

2010-05-18 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Martin Maechler > Sent: Tuesday, May 18, 2010 1:25 PM > To: milton ruser > Cc: r-help@r-project.org > Subject: Re: [R] avoiding reinstall already installed *package* > > On Tue,

[R] substitute, expression and factors

2010-05-18 Thread baptiste auguie
Dear list, I am puzzled by this, substitute(expression(x), list(x = factor(letters[1:2]))) # expression(1:2) Why do I get back the factor levels inside the expression and not the labels? The following work as I expected, substitute(expression(x), list(x = letters[1:2])) # expression(c("a", "b")

[R] get the row sums

2010-05-18 Thread Changbin Du
> head(en.id.pr) valid.gene_id b.pred rf.pred svm.pred 15212500151211 0 00 366 639679745 0 00 19652502081603 1 11 1420 644148030 1 11 15652500626489 1 11 18162501711016

Re: [R] avoiding reinstall already installed *package*

2010-05-18 Thread Martin Maechler
On Tue, May 18, 2010 at 18:06, milton ruser wrote: > Hi Martin, > > thanks for your reply, and very thanks for your kind tips about "package" > and "library" > So, I was trying to understand *why* we load packages using library(). > I've started to use and suggest using require(.) instead {as

Re: [R] Regarding the 'R' Load Command

2010-05-18 Thread Steve Lianoglou
Hi, On Tue, May 18, 2010 at 2:49 PM, Godavarthi, Murali wrote: > Hi, > > I'm new to 'R' and need some help on the "Load" command. Any responses > will be highly appreciated. Thanks in advance! > > As per manuals, the "Load" command expects a binary file input that is > saved using a "save" comman

[R] sem error "no variance or error-variance parameter"

2010-05-18 Thread Jan Schubert
Hi, I am sorry to post the message again but I really need some advise on that. I am using the R version 2.11.0 and the version of sem package: sem_0.9-20 under Windows XP. I read the questions: http://r.789695.n4.nabble.com/computationally-singular-and-lack-of-variance-parameters-in-SEM-td891081.

Re: [R] looking for .. dec if vector if element > x

2010-05-18 Thread Knut Krueger
Thank you Adrian, its working fine. Knut __ 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, minimal, self-contained, rep

Re: [R] GUI commands to call for a protein from protein data bank

2010-05-18 Thread Amitoj S. Chopra
I tried doing that and this is what I go: dlg <- aDialog(items=list( ProtienCode=stringItem("") ), OK_handler=function(.) { # . is reference to dlg object values <- .$to_R() f <- function(ProtienCode) pdb <- read.pdb(.$get_ProteinCode()) #cat("ProteinCode is",ProtienCode,"\n") do.call(f, values)

[R] Regarding the 'R' Load Command

2010-05-18 Thread Godavarthi, Murali
Hi, I'm new to 'R' and need some help on the "Load" command. Any responses will be highly appreciated. Thanks in advance! As per manuals, the "Load" command expects a binary file input that is saved using a "save" command. However it is required that we need to call the 'R' program from J

Re: [R] survey package: weights used in svycoxph()

2010-05-18 Thread Thomas Lumley
On Tue, 18 May 2010, Vinh Nguyen wrote: Binder's estimating equations are the usual way of applying weights to a Cox model, so nothing special is done apart from calling coxph(). To quote the author of the survival package, Terry Therneau, "Other formulae change in the obvious way, eg, the weigh

Re: [R] Getting dates in an SPSS file in right format.

2010-05-18 Thread Frank E Harrell Jr
On 05/18/2010 11:52 AM, Chuck Cleland wrote: On 5/18/2010 12:38 PM, Praveen Surendran wrote: Dear all, I am trying to read an SPSS file into a data frame in R using method read.spss(), sample<- read.spss(file.name,to.data.frame=TRUE) But dates in the data.frame 'sample' are coming as inte

[R] Maximization of quadratic forms

2010-05-18 Thread Russell Shinohara
Dear R Help, I am trying to fit a nonlinear model for a mean function $\mu(Data_i, \beta)$ for a fixed covariance matrix where $\beta$ and $\mu$ are low- dimensional. More specifically, for fixed variance-covariance matrices $\Sigma_{z=0}$ and $\Sigma_{z=1}$ (according to a binary covariate $

Re: [R] C function call in R

2010-05-18 Thread Dan Davison
John Lande writes: > dear all, > > we am trying to improve the performance of my R code, with the implentation > of some function with custom C code. > we found difficult to import and export/import data structure such us > matrices or data.frame into the external C functions. Please give a *ver

[R] Res: Using the zero-inflated binomial in experimental designs

2010-05-18 Thread Ivan Allaman
Hi Ben! First I thank you for your attention. Unfortunately, the ANOVA does not work with vglm. In another email, Rafael warned me that actually a lot of zeros does not necessarily imply a distribution of zeros binomail inflated. So how could I test if my variable is or not a binomial zero infl

[R] Glasso question

2010-05-18 Thread daysixty
The "glassolist" function says that if rholist is set to NULL, then "10 values in a (hopefully reasonable) range are used". I'm trying to figure out how these 10 values are chosen, I can't find this in any documentation. Thanks for your help! -- View this message in context: http://r.789695.n4.n

Re: [R] (no subject)

2010-05-18 Thread David Winsemius
On May 18, 2010, at 12:07 PM, Arantzazu Blanco Bernardeau wrote: Hello Well, the problem is, that arcilla is the percentage of clay in the soil sample. So, for linear model, I need to work with that number or value. Now, R thinks that arcilla (arcilla means clay in spanish), is a factor,

Re: [R] Sweave counter

2010-05-18 Thread Benno Pütz
Under UNIX I usually write something like system(paste("echo '",...,"'", sep=sep)) where I replace the '...' with whatever I need to show. This would need some adjustments for non-scalars, though. Benno Am 18.Mai.2010 um 19:10 schrieb Jimmy Söderly: > Dear R users, > > I am using th

Re: [R] Sweave counter

2010-05-18 Thread Ista Zahn
Hi Jimmy, You can use message() instead of cat(): if (i%%100==0) message(i) Best, Ista On Tuesday 18 May 2010 1:10:51 pm Jimmy Söderly wrote: > Dear R users, > > I am using the Sweave package and I am doing some MCMC. I have a loop > function for my MCMC. Every 100 iterations, I want the number

Re: [R] unsigned 4 byte number

2010-05-18 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of tetonedge > Sent: Tuesday, May 18, 2010 9:14 AM > To: r-help@r-project.org > Subject: [R] unsigned 4 byte number > > > Does anybody know how to read in a unsigned 4 byte number

Re: [R] proportion of treatment effect by a surrogate (fitting multivariate survival model)

2010-05-18 Thread Vinh Nguyen
On Mon, May 17, 2010 at 7:42 PM, Vinh Nguyen wrote: > Dear R-help, > > I would like to compute the variance for the proportion of treatment > effect by a surrogate in a survival model (Lin, Fleming, and De > Gruttola 1997 in Statistics in Medicine).  The paper mentioned that > the covariance matri

[R] Sweave counter

2010-05-18 Thread Jimmy Söderly
Dear R users, I am using the Sweave package and I am doing some MCMC. I have a loop function for my MCMC. Every 100 iterations, I want the number of iterations already done to appear on my screen (but not on the final document). Is that possible ? Usually I can rely on > if (i%%100==0) cat(i, "\

Re: [R] avoiding reinstall already installed *package*

2010-05-18 Thread Ted Harding
On 18-May-10 16:42:40, Peter Ehlers wrote: > On 2010-05-18 10:05, (Ted Harding) wrote: >> On 18-May-10 15:49:37, Martin Maechler wrote: >>> { I've modified the subject; I can't stand it hitting square into >>>my face ... } "mr" == milton ruser on Tue, 18 May 2010 12:36:23

Re: [R] Function that is giving me a headache- any help appreciated (automatic read )

2010-05-18 Thread John Kane
I don't think you can do this precipitation!="NA") have a look at ?is.na --- On Tue, 5/18/10, stephen sefick wrote: > From: stephen sefick > Subject: [R] Function that is giving me a headache- any help appreciated > (automatic read ) > To: r-help@r-project.org > Received: Tuesday, May 18, 20

Re: [R] Getting dates in an SPSS file in right format.

2010-05-18 Thread Chuck Cleland
On 5/18/2010 12:38 PM, Praveen Surendran wrote: > Dear all, > > > > I am trying to read an SPSS file into a data frame in R using method > read.spss(), > > sample <- read.spss(file.name,to.data.frame=TRUE) > > > > But dates in the data.frame 'sample' are coming as integers and not in the >

Re: [R] survey package: weights used in svycoxph()

2010-05-18 Thread Vinh Nguyen
On Tue, May 18, 2010 at 8:50 AM, Thomas Lumley wrote: > >  > I >> >> don't believe so since svycoxph() calls coxph() of the survival >> package and weights are applied once in the estimating equation.  If >> the weights are implemented in the ratio, could you point me to where >> in the code this

Re: [R] avoiding reinstall already installed *package*

2010-05-18 Thread Peter Ehlers
On 2010-05-18 10:05, (Ted Harding) wrote: On 18-May-10 15:49:37, Martin Maechler wrote: { I've modified the subject; I can't stand it hitting square into my face ... } "mr" == milton ruser on Tue, 18 May 2010 12:36:23 -0300 writes: mr> Dear R-experts, mr> I am installing ne

[R] Getting dates in an SPSS file in right format.

2010-05-18 Thread Praveen Surendran
Dear all, I am trying to read an SPSS file into a data frame in R using method read.spss(), sample <- read.spss(file.name,to.data.frame=TRUE) But dates in the data.frame 'sample' are coming as integers and not in the actual date format given in the SPSS file. Appreciate if anyone can help

[R] FW: "Re: Change class factor to numeric"

2010-05-18 Thread Arantzazu Blanco Bernardeau
Hello everybody the problem has been solved. It was my mistake not to be ensured that any N/A had dissapeared. I do apologize for the inconveniences caused ;) friendly greeting sfrom Spain! Arantzazu Blanco Bernardeau Dpto de Química Agrícola, Geología y Edafología Universidad de Murcia-Campu

[R] Function that is giving me a headache- any help appreciated (automatic read )

2010-05-18 Thread stephen sefick
note: whole function is below- I am sure I am doing something silly. when I use it like USGS(input="precipitation") it is choking on the precip.1 <- subset(DF, precipitation!="NA") b <- ddply(precip.1$precipitation, .(precip.1$gauge_name), cumsum) DF.precip <- precip.1 DF.precip$precipitation <-

Re: [R] Using the zero-inflated binomial in experimental designs

2010-05-18 Thread Ben Bolker
Ivan Allaman yahoo.com.br> writes: > > > I'm trying to use the inflated binomial distribution of zeros (since 75% of > the values are zeros) in a randomized block experiment with four > quantitative treatments (0, 0.5, 1, 1.5), but I'm finding it difficult, > since the examples available in VGA

Re: [R] (no subject)

2010-05-18 Thread Peter Ehlers
Arantzazu, Your problem is that the data were probably imported from Excel where you had at least one cell containing "#N/A". You need to replace those cases in your dataframe with NA. Then you should be able to do as.numeric(as.character(arcilla)). -Peter Ehlers On 2010-05-18 10:07, Arantzazu

[R] unsigned 4 byte number

2010-05-18 Thread tetonedge
Does anybody know how to read in a unsigned 4 byte number from a binary file? According to the help for readBin, the signed argument only applies to size=1 or 2. But if you declare any size larger it assumes it is signed? Thanks -- View this message in context: http://r.789695.n4.nabble.com/unsi

Re: [R] (no subject)

2010-05-18 Thread Steve Lianoglou
One last thing: before you take my advice on how to recode your nominal/categorical "clay" variable for your regression model, take some time to see how other people talk about this and do some searching on phrases like "regression model with nominal variables" (that's just the one I used). You'l

Re: [R] "Re: Change class factor to numeric"

2010-05-18 Thread Ivan Calandra
Hi again, If you used the function read.table() to read from a csv file into a data.frame, it is weird that numeric data are converted into factors. I would check in the original data that you don't have a typo somewhere. I don't know all the possibilities, but a special character can definite

Re: [R] avoiding reinstall already installed *package*

2010-05-18 Thread milton ruser
Hi Martin, thanks for your reply, and very thanks for your kind tips about "package" and "library" So, I was trying to understand *why* we load packages using library(). I suggest that developers killl the problem on its root, deleting library function :-) Good to know already installed packages w

Re: [R] timing a function

2010-05-18 Thread Gustave Lefou
Dear all, Just one last question. There seems to be no problem in writing > z = system.time(y <- f(x)) or > z <- system.time(y <- f(x)) Then z contains the named vector of the elapsed times, and y the value of the function f(x). Am I right ? Thank you very much, Gustave 2010/5/17 Alexander

Re: [R] (no subject)

2010-05-18 Thread Arantzazu Blanco Bernardeau
Hello Well, the problem is, that arcilla is the percentage of clay in the soil sample. So, for linear model, I need to work with that number or value. Now, R thinks that arcilla (arcilla means clay in spanish), is a factor, and gives me the value as a factor, so the output of the linear model i

Re: [R] Repeating Name for Rows

2010-05-18 Thread Wu Gong
If I perceive the issue: Day <- c(rep(97, each = 11), rep(98:278, each = 12)) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Repeating-Name-for-Rows-tp2221457p2221492.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] avoiding reinstall already installed *package*

2010-05-18 Thread Ted Harding
On 18-May-10 15:49:37, Martin Maechler wrote: > { I've modified the subject; I can't stand it hitting square into > my face ... } >> "mr" == milton ruser >> on Tue, 18 May 2010 12:36:23 -0300 writes: > mr> Dear R-experts, > mr> I am installing new libraries using > mr> in

Re: [R] "Re: Change class factor to numeric"

2010-05-18 Thread Arantzazu Blanco Bernardeau
Hello so, here you have the output of the data frame. The data frame comes from a csv file. I could take Gr_2 instead of arcilla, because it is the same value... but curiously, it is a factor as well. > str(caperf) 'data.frame':    556 obs. of  38 variables:  $ Hoja    : int  818 818 818 8

Re: [R] (no subject)

2010-05-18 Thread Steve Lianoglou
Hi, Sorry, I'm not really getting what going on here ... perhaps having more domain knowledge would help me make better sense of our question. In particular: On Tue, May 18, 2010 at 11:35 AM, Arantzazu Blanco Bernardeau wrote: > > Hello > I have a data array with soil variables (caperf), in whi

Re: [R] survey package: weights used in svycoxph()

2010-05-18 Thread Thomas Lumley
On Mon, 17 May 2010, Vinh Nguyen wrote: Dear R-help, Let me know if I should email r-devel instead of this list. This message is addressed to Professor Lumley or anyone familiar with the survey package. Does svycoxph() implement the method outlined in Binder 1992 as referenced in the help fil

Re: [R] "Re: Change class factor to numeric"

2010-05-18 Thread Ivan Calandra
Hi, I think that providing the output from str(data array or whatever you have) would help. Because, for now, we don't have much idea of what you really have. Moreover, some sample data is always welcomed (using the function dput for example) Ivan Le 5/18/2010 17:36, Arantzazu Blanco Berna

Re: [R] BRugs under Linux?

2010-05-18 Thread Uwe Ligges
On 17.05.2010 18:46, Kevin E. Thorpe wrote: Hello. In this post: http://finzi.psych.upenn.edu/Rhelp10/2010-March/233815.html Uwe Ligges suggests using BRugs rather than R2WinBUGS under windows. He also notes that it is not in the main CRAN repository, but it is in "extras" which is a default

Re: [R] avoiding reinstall already installed *package*

2010-05-18 Thread Martin Maechler
{ I've modified the subject; I can't stand it hitting square into my face ... } > "mr" == milton ruser > on Tue, 18 May 2010 12:36:23 -0300 writes: mr> Dear R-experts, mr> I am installing new libraries using mr> install.packages("ggplot2",dependencies=T). mr> But I

Re: [R] "Re: Change class factor to numeric"

2010-05-18 Thread milton ruser
Try arcilla<-as.numeric(as.character(clay)) best milton On Tue, May 18, 2010 at 12:36 PM, Arantzazu Blanco Bernardeau < aramu...@hotmail.com> wrote: > > > sorry I had a mistake sending my question without a subject. I do resend > again. Please excuse me. > > Hello > > I have a data array with

Re: [R] avoiding reinstall already installed library

2010-05-18 Thread Steve Lianoglou
Hi, On Tue, May 18, 2010 at 11:36 AM, milton ruser wrote: > Dear R-experts, > > I am installing new libraries using > install.packages("ggplot2",dependencies=T). > But I perceive that many dependencies are already installed. As I am using > a low-band internet, how can avoid reinstall installed l

[R] "Re: Change class factor to numeric"

2010-05-18 Thread Arantzazu Blanco Bernardeau
sorry I had a mistake sending my question without a subject. I do resend again. Please excuse me. > Hello > I have a data array with soil variables (caperf), in which the variable > "clay" is factor (as I see entering str(caperf)) . I need to do a regression > model, so I need to have arcilla

Re: [R] Counting Frequencies in Data Frame

2010-05-18 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of M.Ribeiro > Sent: Tuesday, May 18, 2010 7:13 AM > To: r-help@r-project.org > Subject: [R] Counting Frequencies in Data Frame > > > Hi, > I am sure there is an easy way to do it,

[R] avoiding reinstall already installed library

2010-05-18 Thread milton ruser
Dear R-experts, I am installing new libraries using install.packages("ggplot2",dependencies=T). But I perceive that many dependencies are already installed. As I am using a low-band internet, how can avoid reinstall installed libraries? cheers milton [[alternative HTML version deleted]]

[R] (no subject)

2010-05-18 Thread Arantzazu Blanco Bernardeau
Hello I have a data array with soil variables (caperf), in which the variable "clay" is factor (as I see entering str(caperf)) . I need to do a regression model, so I need to have arcilla (=clay) as a numeric variable.  For that I have entered as.numeric(as.character(arcilla)) and even enterin

Re: [R] Counting Frequencies in Data Frame

2010-05-18 Thread Ista Zahn
Hi, Others will have fancier solutions, but is the way I would do it: dat <- read.table(textConnection("1 2 3 1 aa ab ab 2 ab ab ab 3 aa aa aa 4 bb bb bb"), header=TRUE) closeAllConnections() countAB <- function(x) { aa <- length(which(x == "aa")) ab <- length(which(x == "ab")) bb <- leng

Re: [R] Fatal error that doesn't let me start R

2010-05-18 Thread Steve Lianoglou
Hi, On Tue, May 18, 2010 at 10:51 AM, wrote: > Hi, all. > > I have R installed in my computer.  I guess I did something in my previous > session, and now every time I start R, I find the following message: > > "Fatal error: unable to restore saved data in .RData" > > I uninstalled R and installe

Re: [R] Fatal error that doesn't let me start R

2010-05-18 Thread Duncan Murdoch
On 18/05/2010 10:51 AM, gbre...@ssc.wisc.edu wrote: Hi, all. I have R installed in my computer. I guess I did something in my previous session, and now every time I start R, I find the following message: "Fatal error: unable to restore saved data in .RData" I uninstalled R and installed it ag

[R] Repeating Name for Rows

2010-05-18 Thread ecvetano
Hello, I have a large data frame (47:2186), where i want to label every 12th row. This command works, Day <-rep(97:278, each = 12) However i need 97 to only labeled 11 rows and then from 98:278 can be labeled every 12 times. Thanks! __ R-help@r-proj

Re: [R] C function call in R

2010-05-18 Thread Steve Lianoglou
Hi, On Tue, May 18, 2010 at 10:50 AM, John Lande wrote: > dear all, > > we am trying to improve the performance of my R code, with the implentation > of some function with custom C code. > we found difficult to import and export/import data structure such us > matrices or data.frame into the exte

[R] Fatal error that doesn't let me start R

2010-05-18 Thread gbrenes
Hi, all. I have R installed in my computer. I guess I did something in my previous session, and now every time I start R, I find the following message: "Fatal error: unable to restore saved data in .RData" I uninstalled R and installed it again and I'm still getting this message. Can anyone he

[R] C function call in R

2010-05-18 Thread John Lande
dear all, we am trying to improve the performance of my R code, with the implentation of some function with custom C code. we found difficult to import and export/import data structure such us matrices or data.frame into the external C functions. we already tried the solution from "Writing R Exte

Re: [R] looking for .. dec if vector if element > x

2010-05-18 Thread Knut Krueger
Henrique Dallazuanna schrieb: Try this also: pmax(test - 1, 1) O test <- c(1,3,5,7,9,11,12,13,14) test test <- pmax(test - 1, 1) test This works for 1 what about if I would dec 11: to 14 to close the gap between 9 and 10 ? I did not find the answer with the help file Thank you Knut _

[R] Counting Frequencies in Data Frame

2010-05-18 Thread M.Ribeiro
Hi, I am sure there is an easy way to do it, but I can't find it. I have a data frame that has 15 columns and 7000 rows. The only values inside the data.frame are "aa", "ab", "bb" as you can see an example bellow. 1 2 3 1 aa ab ab 2 ab ab ab 3 aa aa aa 4 bb bb bb What I would like to do, i

Re: [R] sample

2010-05-18 Thread Wu Gong
Sorry, I made two mistakes. The first was matching the female with the male. The second was 2 variables should be selected randomly every time. Followed is a revised copy: ## Import data. moms <- read.delim("females.txt", sep =" ", stringsAsFactors = FALSE, header = TRUE) dads <- read.delim("mal

Re: [R] help color coding map in R

2010-05-18 Thread Anderson, Chris
Thank you this was helpful Chris Anderson Data Analyst Medical Affairs wk: 925-677-4870 cell: 707-315-8486 Fax:925-677-4670 -Original Message- From: foolish.andr...@gmail.com [mailto:foolish.andr...@gmail.com] On Behalf Of Felix Andrews Sent: Monday, May 17, 2010 5:55 PM To: Anderson, C

Re: [R] scaling with relative units in plots or retrieving axes limits in plots

2010-05-18 Thread Jannis
Thanks for the replies! If anybody encounters a similar problem, the function that now does what I wanted is attached below. Best Jannis trnsf.coords = function(array_x,array_y) # This function transfers relative coordinates between 0 and 1 for two arrays with x # and y values into the coo

[R] scaling with relative units in plots or retrieving axes limits in plots

2010-05-18 Thread Jannis
Dears, a way to define x and y positions in plots in relative numbers (e.g in fractions between 0 and 1 referring to relative positions inside the plot region) would really help me. One example I would need this to would be to add text via text() to a plot always at a defined spot, e.g the up

Re: [R] scaling with relative units in plots or retrieving axes limits in plots

2010-05-18 Thread Ivan Calandra
Hi, For 2., I don't know if it's possible to retrieve the axis limits, but you can surely specify them in your call to plot (with arguments xlim and ylim). That's a cheap solution and others probably have better ones. Ivan Le 5/18/2010 16:23, Jannis a écrit : Dears, a way to define x and

  1   2   >