[R] Odp: applying a function to data frame columns

2008-02-21 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 21.02.2008 22:57:31: > > useR's, > > I want to apply this function to the columns of a data frame: > > u[u >= range(v)[1] & u <= range(v)[2]] Do you really mean this function? range(v) gives you an overall range in data frame v e.g. (1,5) and u[your ranges]

[R] How to get MSS value for individual clusters.

2008-02-21 Thread Prateek Singh
Hi there, I am working on clustering genomic data. I am using HOPACH method for clustering. I have a query here. How can i get SS (split silhouette) value for individual clusters. What I am getting as MSS value, is Mean of all SS value of individual cluster. Hence I am getting single value for a

Re: [R] reshaping data frame

2008-02-21 Thread Vikas Rawal
> # 2. create one new row for each case in level.1 and level.2 > > # the new reshaped data.frame would should look like this: > > # indiv factorcovar case.id > # A level.1 4.6141051 > # A level.1 4.6141052 > # A level.2 31.0644051 > # A level.2 31.064405

Re: [R] Compilation error on installing rgl package

2008-02-21 Thread Duncan Murdoch
On 21/02/2008 3:13 PM, Kenneth Lo wrote: > Thank you for your reply. Hope that it will be > available soon. It won't happen unless someone does it. What you should be asking is how to learn to do it, or how to encourage someone else to do it. Duncan Murdoch > > Kenneth > > > --- Duncan Mur

Re: [R] How to get names of a list into df:s?

2008-02-21 Thread Bert Gunter
Jim's solution showed me that mine should be simplified to: mapply(data.frame,value=g,nm=names(g),SIMPLIFY=FALSE) This has the slight advantage of automatically naming the list. Cheers, Bert Gunter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jim hol

Re: [R] How to get names of a list into df:s?

2008-02-21 Thread jim holtman
Here is one way of doing it: > lapply(names(g), function(z)cbind(x=g[[z]], var1=z)) [[1]] x var1 1 1a 2 2a 3 3a [[2]] x var1 1 4b 2 5b 3 6b [[3]] x var1 1 7c 2 8c 3 9c On Thu, Feb 21, 2008 at 1:22 PM, Lauri Nikkinen <[EMAIL PROTECTED]> wrote: > R users

Re: [R] How to get names of a list into df:s?

2008-02-21 Thread Bert Gunter
mapply(data.frame,value=g,nm=lapply(names(g),rep,length(g)),SIMPLIFY=FALSE) Cheers, Bert Gunter Genentech -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Kane Sent: Thursday, February 21, 2008 2:05 PM To: Lauri Nikkinen; [EMAIL PROTECTED] Subject: R

Re: [R] Simple Newbie Question

2008-02-21 Thread Gabor Grothendieck
On Thu, Feb 21, 2008 at 4:51 PM, MassimoH <[EMAIL PROTECTED]> wrote: > > How do I plot data like this: > > Date,Series,Value > 1/5/2007,Blue,300 > 1/20/2007,Blue,400 > 1/9/2007,Red,200 > 1/15/2007,Red,500 > > Two things I'm having trouble figuring out from online help & tutorials: > > 1) How does R

Re: [R] jpeg() creating empty files with qplot() in a loop

2008-02-21 Thread hadley wickham
> So what could be the difference between the last example and it running > in a loop, that the former generates a proper jpeg file and the lattter > does not? > > Does something more special than dev.off() need to be done with qplot > output when in a loop? As well as Henrik's advice, you co

[R] bootstrap: definition of original statistic

2008-02-21 Thread Gad Abraham
Hi, In the boot package, the original statistic is simply the statistic function evaluated on the original data (called t0). However, in Harrell et al 1996 "Multivariable prognostic models..." Stats Med vol 15, pp. 361--387, it is different (p. 372): The statistic function evaluated on the origin

[R] applying a function to data frame columns

2008-02-21 Thread dxc13
useR's, I want to apply this function to the columns of a data frame: u[u >= range(v)[1] & u <= range(v)[2]] where u is the n column data frame under consideration and v is a data frame of values with the same number of columns as u. For example, v1 <- c(1,2,3) v2 <- c(3,4,5) v3 <- c(2,3,4) v

Re: [R] History of R

2008-02-21 Thread Greg Snow
I agree with what others have said, the R core team is a great and unique group. There are a couple of ideas that I would like to add that may have played a part in the level of growth that R has had. I think timing has played a part. The field of statistics has matured along with the computer.

Re: [R] History of R

2008-02-21 Thread Greg Snow
Many of the doctors that I work with also have teaching appointments at the local university and use the bookstore to buy academic versions of SAS, SPSS, Minitab, and others. When they have asked me to use those (sometimes offered to buy me a student copy) I have refered them to the licence agreem

Re: [R] Mixture of Distributions

2008-02-21 Thread Ted Harding
I just realised I made a bad mistaqke (see below) On 21-Feb-08 21:39:56, Ted Harding wrote: > On 21-Feb-08 20:58:25, Evgenia wrote: >> >> Dear R users, >> I would like to sample from a mixture distribution >> p1*f1+p2*f2+p3*f3 with f1,f2,f3 three different forms >> of distributions. I know that

[R] Function for linear mixed model with gamma-distributed random effects?

2008-02-21 Thread Christopher Hatherly
Hi, I'm new to R and am hoping someone might be able to help with the following lme problem. I am trying to fit an ellipse equation to some spatial human factors data, varying the major and minor axes randomly and specifying an exp~ variogram for errors. Using normally-distributed random effects

Re: [R] How to get names of a list into df:s?

2008-02-21 Thread John Kane
I don't see any difference --- Lauri Nikkinen <[EMAIL PROTECTED]> wrote: > R users, > > I have a simple lapply question. > > g <- list(a=1:3, b=4:6, c=7:9) > g <- lapply(g, function(x) as.data.frame(x)) > lapply(g, function(x) cbind(x, var1 = rep(names(g), > each=nrow(x))[1:nrow(x)])) > > I ge

Re: [R] plotting every ith data point?

2008-02-21 Thread jebyrnes
Here's a similar variant on what has been proposed, but is simpler. It relies on the fact that plot() doesn't need a ~. a<-1:100 b<-seq(1,length(a),5) plot(1:20, a[1:b]) Alternately, if you were using a data frame, as long as you knew the column names, you could do something like plot(my.dat

[R] Simple Newbie Question

2008-02-21 Thread MassimoH
How do I plot data like this: Date,Series,Value 1/5/2007,Blue,300 1/20/2007,Blue,400 1/9/2007,Red,200 1/15/2007,Red,500 Two things I'm having trouble figuring out from online help & tutorials: 1) How does R handle dates? It seems there is no built-in support for dates, but some standard add-ons

[R] Problems with aggregate

2008-02-21 Thread Mcmahon, Kevin
Hello list, I'm new to this list, so please forgive my ignorance. I have searched R-help for some hints into what might be my problem, but I truly have no idea where to go from here. I have an object of approximately 15,000 rows and 2 columns. There are many duplicates in the first column

Re: [R] Mixture of Distributions

2008-02-21 Thread Ted Harding
On 21-Feb-08 20:58:25, Evgenia wrote: > > Dear R users, > I would like to sample from a mixture distribution > p1*f1+p2*f2+p3*f3 with f1,f2,f3 three different forms > of distributions. I know that in the case of two > distributions I have to sample the mixture compoment > membership. > > How can

Re: [R] nnet

2008-02-21 Thread Prof Brian Ripley
On Thu, 21 Feb 2008, Luís Paulo F. Garcia wrote: In nnet.formula(classe ~ ., data = treinamento_data, size = 10, : group Class is empty What does this mean? Well, you are the best placed to tell us as we don't have a reproducible example (see the footer) and you do. But at a guess, 'class

Re: [R] jpeg in batch mode

2008-02-21 Thread Prof Brian Ripley
On Thu, 21 Feb 2008, Elizabeth Purdom wrote: > Hello, > > I am running some commands in batch on a server that I SSH into; some of > the commands call jpeg(). If I continue to stay signed on (with my > xwindows working on my machine) then the jpeg() command works (with a > single caveat, below). I

Re: [R] jpeg in batch mode

2008-02-21 Thread Henrik Bengtsson
Hi. I think the devices provided in 'Cairo' package solves your problem. [ Alternatively you can use the bitmap() device which utilizes Ghostscript to generate bitmap images. In the 'R.utils' package there are wrappers png2() and jpeg2() calling bitmap() but that imitates the png() and jpeg() ar

[R] jpeg in batch mode

2008-02-21 Thread Elizabeth Purdom
Hello, I am running some commands in batch on a server that I SSH into; some of the commands call jpeg(). If I continue to stay signed on (with my xwindows working on my machine) then the jpeg() command works (with a single caveat, below). If I leave it and sign off (with a nohup command in fr

[R] Mixture of Distributions

2008-02-21 Thread Evgenia
Dear R users, I would like to sample from a mixture distribution p1*f1+p2*f2+p3*f3 with f1,f2,f3 three different forms of distributions. I know that in the case of two distributions I have to sample the mixture compoment membership. How can I weight my three distributions with their respective

Re: [R] plot two columns of a matrix with standard deviation

2008-02-21 Thread Henrique Dallazuanna
Try this: plot(x[,1], ylim=range(x[c(1,3)]), xaxt="n", xlab="", pch=16, col="blue") points(x[,3], pch=16, col="red") axis(1, at=1:nrow(x), labels=rownames(x), las=2) segments(1:nrow(x), x[,1]-x[,2], 1:nrow(x), x[,1]+x[,2], col="blue") segments(1:nrow(x), x[,3]-x[,4], 1:nrow(x), x[,3]+x[,4], col="r

Re: [R] jpeg() creating empty files with qplot() in a loop

2008-02-21 Thread Henrik Bengtsson
First, please provide us with enough unambiguous information so we don't have to second guess that you are using qplot() in the 'ggplot' package. Report sessionInfo() is recommended. It has nothing to do with jpeg() or any other device driver. You get the same problem with: library(ggplot) x <-

Re: [R] numerical integration of a ftn of 2 variables

2008-02-21 Thread Berend Hasselman
Chris Rhoads wrote: > > > I wish to find the root of a function of two variables that is defined by > an integral which must be > evaluated numerically. > > So the problem I want to solve is of the form: Find k such that f(k)=0, > where f(y) = int_a^b > g(x,y) dx. Again, the integral > invo

Re: [R] coloring a graph left or right of an abline

2008-02-21 Thread Roland Rau
Hi Georg, Georg Ehret wrote: > Dear R community, >I would wish to color the background of my histogram differently to the > left and right of an abline... Can you please help? maybe not very elegant or beautiful, but I hope it will get you started: ### Start of Code Example n

Re: [R] Compilation error on installing rgl package

2008-02-21 Thread Kenneth Lo
Thank you for your reply. Hope that it will be available soon. Kenneth --- Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 20/02/2008 4:54 PM, Kenneth Lo wrote: > > Hi all, > > > > I encountered difficulties when I tried to install > the > > rgl package. I'm using R devel (2.7.0) on Mac OS >

Re: [R] plot two columns of a matrix with standard deviation

2008-02-21 Thread Paul Hammer
Henrique Dallazuanna schrieb: Perhaps: plot(x[c(1,3)], pch=16) segments(x[,1],x[,3]-x[,2], x[,1], x[,3]+x[,4], col="red") On 21/02/2008, Paul Hammer <[EMAIL PROTECTED]> wrote: hi members, i try to plot two columns of a matrix as points with standard deviation. a legend should also be th

Re: [R] anova power calculations

2008-02-21 Thread Will Holcomb
To answer my own question, the notes that I was drawing from made it seem as through the mean I was using for my sum of squares was unweighted. In reality, I needed to weight the contribution of each contributing mean by the sample size. Once I did that, I got a value that agreed with SAS. So, the

[R] nnet

2008-02-21 Thread Luís Paulo F. Garcia
In nnet.formula(classe ~ ., data = treinamento_data, size = 10, : group Class is empty What does this mean? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read t

[R] SAS transport files and read.xport

2008-02-21 Thread Nelson, Gary (FWE)
Hi All, In 2005, I noted that when I used read.xport function in the foreign package to import a SAS transport file (.xpt) with multiple files imbedded in it, data frames from some of the files were not created. Since then, I discovered that the information from the missing files is being read in

[R] coloring a graph left or right of an abline

2008-02-21 Thread Georg Ehret
Dear R community, I would wish to color the background of my histogram differently to the left and right of an abline... Can you please help? Thankin you, Georg. Georg Ehret JHU Baltimore - USA [[alternative HTML version deleted]]

Re: [R] plot two columns of a matrix with standard deviation

2008-02-21 Thread Henrique Dallazuanna
Perhaps: plot(x[c(1,3)], pch=16) segments(x[,1],x[,3]-x[,2], x[,1], x[,3]+x[,4], col="red") On 21/02/2008, Paul Hammer <[EMAIL PROTECTED]> wrote: > hi members, > > i try to plot two columns of a matrix as points with standard deviation. > a legend should also be there. the one points should be

[R] how to create ROC curve for 2 dimensional classifiers

2008-02-21 Thread Waverley
Hi, I understand for 1 d classifiers, you can use ROCR package. Is there a package you can plot ROC curve for 2d classifiers? One of my colleagues asked me about this. I have been quite puzzled, conceptually, how you can do the ROC curve for 2d classifiers. Can someone share his/her knowledge

Re: [R] column name handling and long labels

2008-02-21 Thread Werner Wernersen
That's perfect! The subset way is very easy to use and I have to play around a bit more with label() which seems quite complex. Thanks a million, Werner --- Gabor Grothendieck <[EMAIL PROTECTED]> schrieb: > On Thu, Feb 21, 2008 at 6:09 AM, Werner Wernersen > <[EMAIL PROTECTED]> wrote: > > Hi,

[R] plot two columns of a matrix with standard deviation

2008-02-21 Thread Paul Hammer
hi members, i try to plot two columns of a matrix as points with standard deviation. a legend should also be there. the one points should be green and the others red... column 1 and 3 are the values to plot and column 2 and 4 are the attendant standard deviation (sd)... as xlab should show the

[R] jpeg() creating empty files with qplot() in a loop

2008-02-21 Thread B. Bogart
Hello all, I'm stuck with a strange issue with writing jpegs of plots to a folder in a loop. This works: for (step in 1:length(steps)) { jpeg(filename=paste("frame_",sprintf("%05d",step),".jpg",sep="")) plot(steps[[step]]) dev.off() } But if I use qplot to generate the plot (which is my a

Re: [R] How to get names of a list into df:s?

2008-02-21 Thread Martin Elff
On Thursday 21 February 2008 (19:22:40), Lauri Nikkinen wrote: > R users, > > I have a simple lapply question. > > g <- list(a=1:3, b=4:6, c=7:9) > g <- lapply(g, function(x) as.data.frame(x)) > And I would like to have > > $a >   x var1 > 1 1    a > 2 2    a > 3 3    a > > $b >   x var1 > 1 4    

Re: [R] How to get names of a list into df:s?

2008-02-21 Thread Henrique Dallazuanna
Try this: g <- list(a=1:3, b=4:6, c=7:9) with(stack(g), split(stack(g), ind)) On 21/02/2008, Lauri Nikkinen <[EMAIL PROTECTED]> wrote: > R users, > > I have a simple lapply question. > > g <- list(a=1:3, b=4:6, c=7:9) > g <- lapply(g, function(x) as.data.frame(x)) > lapply(g, function(x) cbin

[R] Warning messages about replacing previous import...

2008-02-21 Thread Petar Milin
Hello! I have posted this message before, but no answer. Now, after a few upgrades, I still have the same warning messages. I am a bit worried, since I do not know does this affect or could affect R. I use R under Linux (Ubuntu 6.06). After start, and after loading few libraries, I got following

[R] anova power calculations

2008-02-21 Thread Will Holcomb
I sent a message a couple days ago about doing calculations for power of the ANOVA. Several people got back to me very quickly which I really appreciated. I'm working now on a similar problem, but instead of a balanced ANOVA, I have an unbalanced one. The first part of the question was: You assum

[R] How to get names of a list into df:s?

2008-02-21 Thread Lauri Nikkinen
R users, I have a simple lapply question. g <- list(a=1:3, b=4:6, c=7:9) g <- lapply(g, function(x) as.data.frame(x)) lapply(g, function(x) cbind(x, var1 = rep(names(g), each=nrow(x))[1:nrow(x)])) I get $a x var1 1 1a 2 2a 3 3a $b x var1 1 4a 2 5a 3 6a $c x var1

Re: [R] update don't find an object

2008-02-21 Thread Ronaldo Reis Junior
Em Qui 21 Fev 2008, David Winsemius escreveu: > Ronaldo Reis Junior <[EMAIL PROTECTED]> wrote in > > news:[EMAIL PROTECTED]: > > I try this update: > > > > mmaa <- update(mma,biomass~qvartemp) > > That does not look like it has proper arguments to update.formula. As > the update() help page suggest

Re: [R] triangle.plot - change the axes orientation

2008-02-21 Thread Wang, Zhaoming (NIH/NCI) [C]
Try the triax.plot in plotrix package http://rss.acs.unt.edu/Rdoc/library/plotrix/html/triax.plot.html Zhaoming -Original Message- From: WCD [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 12:21 PM To: r-help@r-project.org Subject: [R] triangle.plot - change the axes orientat

Re: [R] insert() function

2008-02-21 Thread Dani Valverde
Great! Now it works. Many thanks. Dani Daniel Valverde Saubí Grup de Biologia Molecular de Llevats Facultat de Veterinària de la Universitat Autònoma de Barcelona Edifici V, Campus UAB 08193 Cerdanyola del Vallès- SPAIN Centro de Investigación Biomédica en Red en Bioingeniería, Biomateriales y

[R] triangle.plot - change the axes orientation

2008-02-21 Thread WCD
Hello, I need to chenge axes orirentation in triangle plot. (function triangle.plot in ade4 package) I want to plot elasticities of some species in demographic triangle, where axes values commnly increace "clockwise". If some better imangination is needed, see http://www.open.ac.uk/science/biosci/

Re: [R] insert() function

2008-02-21 Thread Henrik Bengtsson
> spect2 <- insert(spect1, ats=pos, values=as.list(intensities)) > str(spect2) num [1:13112] -0.457 -0.457 0.300 1.781 -0.381 ... /Henrik On Thu, Feb 21, 2008 at 9:26 AM, Henrik Bengtsson <[EMAIL PROTECTED]> wrote: > On Thu, Feb 21, 2008 at 4:30 AM, Dani Valverde <[EMAIL PROTECTED]> wrote: >

Re: [R] insert() function

2008-02-21 Thread Henrik Bengtsson
On Thu, Feb 21, 2008 at 4:30 AM, Dani Valverde <[EMAIL PROTECTED]> wrote: > Hello, > I still having problems with insert() from R.utils package. I provide a > code with no error: > > x <- seq(1:10909) > x1 <- c(13112-10909) > spect1 <- rnorm(10909) > > interpol <- approx(x,spect1,xout=c(seq(fro

Re: [R] Nested frailty model

2008-02-21 Thread Roland Rau
Hi, the package 'survival' provides the possibility to estimate Cox PH models with a frailty term. library(survival) ?frailty If this is not what you are looking for, there is also a package called 'frailtypack'. But I have no experience with that. I hope this helps. Best, Roland P.S. Boccon

Re: [R] Save a group of matrix

2008-02-21 Thread jim holtman
Look at using a list to store the data, something like this: > results <- list() > for (year in 2002:2008){ + results[[as.character(year)]] <- matrix(year,10,10) + } > results $`2002` [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 2002 2002 2002 2002 2002 2002 2002 2002 2002 2

Re: [R] Unable to create/index a zoo irregular timeseries

2008-02-21 Thread Gabor Grothendieck
Here are two ways of doing it with POSIXct and one with chron. Read RNews 4/1, ?read.zoo and the three zoo vignettes: Lines <- '"Data","MAX","MIN","Note" "07-01-2008 08:00:00", 135, 90, "Eccessi feste, inizio dieta" "07-01-2008 18:00:00", 135, 85, "" "08-01-2008 08:00:00", 125, 75, "" ' library(zo

Re: [R] variable syntax problem

2008-02-21 Thread jim holtman
Also consider using a 'list' to store the results. On 2/21/08, Paul Hammer <[EMAIL PROTECTED]> wrote: > Paul Hammer schrieb: > > jim holtman schrieb: > >> Exactly what do you mean by additional text? Have you tried "paste"? > >> > >> On 2/21/08, Paul Hammer <[EMAIL PROTECTED]> wrote: > >> > >>> d

Re: [R] Unable to create/index a zoo irregular timeseries

2008-02-21 Thread jim holtman
You need to convert to POSIXct since POSIXlt is a vector of size 9. So do the following: miedate <- as.POSIXct(strptime(as.character(pressione[,1]), format="%d-%m-%Y %H:%M:%S")) There is a newsletter (I forget the issue) that you might want to refer to on using 'dates'. On 2/21/08, vittorio <

Re: [R] variable syntax problem

2008-02-21 Thread jim holtman
?assign On 2/21/08, Paul Hammer <[EMAIL PROTECTED]> wrote: > Paul Hammer schrieb: > > jim holtman schrieb: > >> Exactly what do you mean by additional text? Have you tried "paste"? > >> > >> On 2/21/08, Paul Hammer <[EMAIL PROTECTED]> wrote: > >> > >>> dear members, > >>> > >>> i would like to wr

Re: [R] variable syntax problem

2008-02-21 Thread Paul Hammer
Paul Hammer schrieb: > jim holtman schrieb: >> Exactly what do you mean by additional text? Have you tried "paste"? >> >> On 2/21/08, Paul Hammer <[EMAIL PROTECTED]> wrote: >> >>> dear members, >>> >>> i would like to write a variable in a plot title (main="") but i don't >>> know the right syn

Re: [R] variable syntax problem

2008-02-21 Thread Paul Hammer
jim holtman schrieb: > Exactly what do you mean by additional text? Have you tried "paste"? > > On 2/21/08, Paul Hammer <[EMAIL PROTECTED]> wrote: > >> dear members, >> >> i would like to write a variable in a plot title (main="") but i don't >> know the right syntax:(...i tried a lot of differ

Re: [R] problem on pg32 of ISwR

2008-02-21 Thread Gavin Simpson
On Thu, 2008-02-21 at 11:06 -0500, b.r. clark wrote: > > hist.with.normal<-function(x,xlab=deparse(substitute(x)),...)+ (+ > h<-hist(x, plot=F, ...)+ s<-sd(x)Error: unexpected symbol > in:"h<-hist(x, plot=F, ...)s"> > > I am using ISwR to teach myself R. Above is what happens when I try to > dup

[R] Unable to create/index a zoo irregular timeseries

2008-02-21 Thread vittorio
In the text file pressione2008.csv I have the following "Data","MAX","MIN","Note" "07-01-2008 08:00:00", 135, 90, "Eccessi feste, inizio dieta" "07-01-2008 18:00:00", 135, 85, "" "08-01-2008 08:00:00", 125, 75, "" which is a collection of blood pressure data at different time of the day. I woul

[R] Nested frailty model

2008-02-21 Thread ah06981
Dear R-help, I am trying to estimate a Cox model with nested effects, or better h(t,v,w)=v*w*h0(t)*exp(B'x) where h(t,v,w) is the individual hazard function w and v are both frailty terms (gamma or normal distributed) I have 12 clusters and for each one of them I would like to associate a

[R] problem on pg32 of ISwR

2008-02-21 Thread b.r. clark
> hist.with.normal<-function(x,xlab=deparse(substitute(x)),...)+ (+ h<-hist(x, > plot=F, ...)+ s<-sd(x)Error: unexpected symbol in:"h<-hist(x, plot=F, ...)s"> I am using ISwR to teach myself R. Above is what happens when I try to duplicate the example on page 32. What went wrong? Note: I am u

Re: [R] variable syntax problem

2008-02-21 Thread jim holtman
Exactly what do you mean by additional text? Have you tried "paste"? On 2/21/08, Paul Hammer <[EMAIL PROTECTED]> wrote: > dear members, > > i would like to write a variable in a plot title (main="") but i don't > know the right syntax:(...i tried a lot of different ways without success. > > here

[R] Save a group of matrix

2008-02-21 Thread Alfonso Pérez Rodríguez
It seems that is not posible to send R file in the messages, well, then I resend the message with the script included. Hello, I'm creating a loop to work with vegan, to get a species abundance curve. Here I send the script I've created and also an excel file to prove what it can do. Well, I ha

[R] Save a group of matrix

2008-02-21 Thread Alfonso Pérez Rodríguez
Hello, I'm creating a loop to work with vegan, to get a species abundance curve. Here I send the script I've created and also an excel file to prove what it can do. Well, I have a database with 20 years, and each year we have sampled 19 stratum, and in each estratum we have carry out some sumpli

[R] variable syntax problem

2008-02-21 Thread Paul Hammer
dear members, i would like to write a variable in a plot title (main="") but i don't know the right syntax:(...i tried a lot of different ways without success. here my example: y=30 z=33 for (i in 10:length(tissue)) { png(filename = tissues[i], width = 1024, height = 768, pointsize = 12, bg =

Re: [R] overall comparison of an ordered categorical in a multiple regression

2008-02-21 Thread David Winsemius
"Angelo Passalacqua" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I entered the following: > > formula<-nst~age+soc+inc+reg+imp > > pnstlm<-lm(formula,nst) > > summary(pnstlm) > > imp and soc are ordered categorical variables but the summary does > not give an output of the overall

Re: [R] reshaping data frame

2008-02-21 Thread John Kane
Here is a very clumsy way to do it but I think it works fact1 <- rep("level.1", length(mydat[,1])) fact2 <- rep("level.2", length(mydat[,1])) lels <- c(fact1,fact2) nams <- c("indiv", "case.id", "covar") set1 <- mydat[, c(1,2,3)] ; names(set1) <- nams set2 <- mydat[,c(1, 4,5)] ; names(set2) <-

Re: [R] overall comparison of an ordered categorical in a multiple regression

2008-02-21 Thread Gavin Simpson
On Thu, 2008-02-21 at 14:25 +, Angelo Passalacqua wrote: > I entered the following: > > formula<-nst~age+soc+inc+reg+imp > > pnstlm<-lm(formula,nst) > > summary(pnstlm) > > imp and soc are ordered categorical variables but the summary does not give > an output of the overall p-values, just

Re: [R] linebreaks in mathplot

2008-02-21 Thread Henrique Dallazuanna
Perhaps: txt <- list(A=bquote(a == .(a)~'%'), B=bquote(b==.(b)~km^2)) plot(c(0,100), c(0,100), xaxs="i", yaxs="i", type="n") text(95-cumsum(strheight(txt)), 95-cumsum(strheight(txt)), parse(text=txt)) On 21/02/2008, Bálint Czúcz <[EMAIL PROTECTED]> wrote: > Dear HelpeRs, > > I would like to do

Re: [R] update don't find an object

2008-02-21 Thread David Winsemius
Ronaldo Reis Junior <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I try this update: > > mmaa <- update(mma,biomass~qvartemp) That does not look like it has proper arguments to update.formula. As the update() help page suggests: ?update.formula You should have included the call tha

[R] overall comparison of an ordered categorical in a multiple regression

2008-02-21 Thread Angelo Passalacqua
I entered the following: formula<-nst~age+soc+inc+reg+imp pnstlm<-lm(formula,nst) summary(pnstlm) imp and soc are ordered categorical variables but the summary does not give an output of the overall p-values, just individual comparisons. I can't find help for this in the manual. Is there a co

Re: [R] Overdispersion, AIC and mixed models

2008-02-21 Thread Ben Bolker
Julien Martin usherbrooke.ca> writes: > > Hi > > I want to do use AIC for model selection on mixed model. However, before > going deeper in the model selection, I want to assess is there is > overdispersion with the full model in order to decide if I should use QAIC > instead of AIC. > > Is t

Re: [R] numerical integration of a ftn of 2 variables

2008-02-21 Thread Paul Smith
On Tue, Feb 19, 2008 at 11:07 PM, Chris Rhoads <[EMAIL PROTECTED]> wrote: > To start, let me confess to not being an experienced programmer, although I > have used R fairly > extensively in my work as a > graduate student in statistics. > > I wish to find the root of a function of two variable

Re: [R] Finding local maxima (height) in a matrix data (6 spatial coordinates)?

2008-02-21 Thread Ben Bolker
Josep Maria Campanera Alsina ub.edu> writes: > > Dear all, > I wonder which R algorithm could perform a search of local maxima in > an spatial grid, in other words, having the coordinates of a map > (x,y,z... up to 6 coordinates) and then the altitude/height at each > point (h) (in total 7 numer

Re: [R] column name handling and long labels

2008-02-21 Thread Gabor Grothendieck
On Thu, Feb 21, 2008 at 6:09 AM, Werner Wernersen <[EMAIL PROTECTED]> wrote: > Hi, > > I have two loosely related questions which could make > my live again a bit easier: > > 1) Is there a simple way to select a range of columns > in a data frame using column names? > I am thinking of something lik

[R] linebreaks in mathplot

2008-02-21 Thread Bálint Czúcz
Dear HelpeRs, I would like to do sg similar to: plot(c(0,100), c(0,100), xaxs="i", yaxs="i", type="n") txt <- paste("a =", a, "%\n b =", b, " km2", sep="") text(95, 95, txt, adj=c(1,1)) just with the "km2" formatted with 2 in a superscript. I thought txt <- substitute("a = "*a*" %\n b ="*b*" km

Re: [R] insert() function

2008-02-21 Thread Dani Valverde
Hello, I still having problems with insert() from R.utils package. I provide a code with no error: x <- seq(1:10909) x1 <- c(13112-10909) spect1 <- rnorm(10909) interpol <- approx(x,spect1,xout=c(seq(from=1, by=((10909 - 1)/(x1 -1)), length.out=x1))) pos <- round(interpol$x,0) intensities <- inte

Re: [R] column name handling and long labels

2008-02-21 Thread Henrique Dallazuanna
Try this: mydf <- data.frame(s8v2=rnorm(10), s12v3=runif(10), s1a5=rnorm(10), s6v1=rnorm(10)) pos <- match(c('s8v2', 's1a5'), names(mydf)) mydf[,seq(pos[1], pos[2])] On 21/02/2008, Werner Wernersen <[EMAIL PROTECTED]> wrote: > Thank you very much, Henrique! The comment function is > exactly what

Re: [R] column name handling and long labels

2008-02-21 Thread Werner Wernersen
Thank you very much, Henrique! The comment function is exactly what I was looking for. Regarding 1) why example was bad: The column names don't follow an easy pattern but are more like "s8v2", "s12v3", "s6v1" etc. Kind regards, Werner --- Henrique Dallazuanna <[EMAIL PROTECTED]> schrieb: >

Re: [R] [OT] Linux/UNIX question

2008-02-21 Thread Jim Lemon
Edna Bell wrote: > > ... > I'm using the find command, (surprise), but I only want to see the > output where it exists, not all of the other stuff. > > Is there an option that I could select, please? > Hi Edna, When you say you want to see the output, I assume you mean output files created by R.

Re: [R] [OT] Linux/UNIX question

2008-02-21 Thread Henrique Dallazuanna
Maybe also: $ whereis R In Debian based distributions works On 20/02/2008, Edna Bell <[EMAIL PROTECTED]> wrote: > Dear R Gurus: > > I'm trying to find R on another Linux system. > > I'm using the find command, (surprise), but I only want to see the > output where it exists, not all of the oth

Re: [R] column name handling and long labels

2008-02-21 Thread Henrique Dallazuanna
Try this: 1) mydf[1,paste("col", 4:8, sep="")] 2) You can use comment function: comment(mydf) <- c("Column number1", "Column number2") or comment(mydf$col1) <- "Column number1 etc" then comment(mydf) and comment(mydf$col1) to see the labels On 21/02/2008, Werner Wernersen <[EMAIL PROTECTED

[R] column name handling and long labels

2008-02-21 Thread Werner Wernersen
Hi, I have two loosely related questions which could make my live again a bit easier: 1) Is there a simple way to select a range of columns in a data frame using column names? I am thinking of something like mydf[1,"col4":"col8"] 2) I have a data frame with many columns and they all have short

[R] Finding local maxima (height) in a matrix data (6 spatial coordinates)?

2008-02-21 Thread Josep Maria Campanera Alsina
Dear all, I wonder which R algorithm could perform a search of local maxima in an spatial grid, in other words, having the coordinates of a map (x,y,z... up to 6 coordinates) and then the altitude/height at each point (h) (in total 7 numerical variables) I would like to localise the peaks (local ma

Re: [R] Permutation Test

2008-02-21 Thread Richard . Cotton
> Am I right in thinking that the correct way of working out how many possible > permutations there can be in this instance is: N! / (n1!) (n2!) (n3!)... > (ni!). Where N is the number of taxa (14) and (for character 2) n1 could be > 'number of state zeros' (i.e., 2), n2 could be 'number of state

Re: [R] Transfer Crosstable to Word-Document

2008-02-21 Thread Philippe Grosjean
bartjoosen wrote: > > > Greg Snow-2 wrote: >> >>> write.table(my.data, 'clipboard', sep="\t") >> Then in Excel just do a paste and the data is there, this saves a couple >> of steps from saving as a .csv file and importing that into excel. This >> would probably be fine for a few tables. >

[R] update don't find an object

2008-02-21 Thread Ronaldo Reis Junior
Hi, I have a situation here. I try this update: mmaa <- update(mma,biomass~qvartemp) but I have this message: Error in eval(expr, envir, enclos) : object "qvartemp" not found but this object exist: [1] "cont" "i" "levelsord" "mma" "qvar" "qvarmma" [7] "qvartemp" "t

Re: [R] factors ordered by mean

2008-02-21 Thread Ronaldo Reis Junior
Em Qua 20 Fev 2008, Henrique Dallazuanna escreveu: > Try this: > factor(pH,levels=names(sort(tapply(Riqueza,pH,mean > Thanks it work Ronaldo -- > Prof. Ronaldo Reis Júnior | .''`. UNIMONTES/Depto. Biologia Geral/Lab. de Biologia Computacional | : :' : Campus Universitário Prof. Darcy Ribei

Re: [R] Selecting timestamps

2008-02-21 Thread Lauri Nikkinen
Thanks Bill, How about situations where time steps are not hourly? Best regards, Lauri 2008/2/21, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Since both sequences are in hourly steps, there is a fairly easy way to > do this: > > > before <- colSums(outer(seq1, seq2, "<")) > > sort(c(seq1[before], s