[R] aggregateSeries and seriesData in R?

2008-04-10 Thread filame uyaco
hi to all! (Q1): I'd like to ask where can i find aggregateSeries and seriesData in R packages? (Q2): how can i perform these Splus commads in R? e.g. annualMax.sp500 = aggregateSeries(-spto87,by="years",FUN=max) hist(seriesData(annualMax.sp500)) (Q3): is the method

Re: [R] for loop help

2008-04-10 Thread Hans-Jörg Bibiko
On 11.04.2008, at 05:38, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: >> ?`break` >> ?`next` >> > > >> for(i in 1:13) { >> > if(i < 13) next > print("Hello!\n") > } > [1] "Hello!\n" > >> >> > > I am trying to find a solution in R for the following C++ code that > allows > one to s

Re: [R] loading an updated version of a package during an active R session?

2008-04-10 Thread Prof Brian Ripley
On Thu, 10 Apr 2008, Roger Levy wrote: > Prof Brian Ripley wrote: >> On Wed, 9 Apr 2008, Roger Levy wrote: >> >>> I am developing a package and I want to be able to load an updated version >>> of the package from within an active R session. Suppose, >>> for example, I have a function f within a

[R] problem of java and R

2008-04-10 Thread Renu Gupta
hi, i apology for doing this but i m very new to R and java on linux. I want ur help. please tell me how i can connect a java program to R so that i wil give commande from java and it plots in R i hav read about omegahat i tried to install it but there is sum problem the problem starts from "no sha

Re: [R] for loop help

2008-04-10 Thread Bill.Venables
> ?`break` > ?`next` > for(i in 1:13) { if(i < 13) next print("Hello!\n") } [1] "Hello!\n" > Bill Venables CSIRO Laboratories PO Box 120, Cleveland, 4163 AUSTRALIA Office Phone (email preferred): +61 7 3826 7251 Fax (if absolutely necessary): +61 7 3826 7304 Mobile:

[R] Vegan plotting- color help

2008-04-10 Thread stephen sefick
I have looked all over the internet for being able to color sites differently in a plot of an MDS (metaMDS)- I would like to color the different sites in the ordination plot (plot or ordiplot). I have set the matrix up so that my site code is 1 296 (first column). is there a way to make 1-

[R] for loop help

2008-04-10 Thread tom soyer
Hi, I am trying to find a solution in R for the following C++ code that allows one to skip ahead in the loop: for (x = 0; x <= 13; x++){ x=12; cout << "Hello World"; } Note that "Hello World" was printed only twice using this C++ loop. I tried to do the same in R: for(i in 1:13){ i=12 print

Re: [R] system.time gives error when "=" is used for assignment(R-2.6.0)

2008-04-10 Thread Bill.Venables
Kyeongmi asks: > Hello list, > > I found that system.time works correctly when I used "<-" to assign > a value to a variable but when I happened to use "=" instead of > "<-", R gave an error message: "Error in system.time(your argument > here...)". It happened with a few functions I tried. I

Re: [R] system.time gives error when "=" is used for assignment (R-2.6.0)

2008-04-10 Thread Charles C. Berry
On Thu, 10 Apr 2008, Kyeongmi Cheon wrote: > Hello list, > I found that system.time works correctly when I used "<-" to assign a > value to a variable but when I happened to use "=" instead of "<-", R > gave an error message: > "Error in system.time(your argument here...)". It happened with a few

Re: [R] Problem installing and using package "tseries"

2008-04-10 Thread Robert A LaBudde
Thanks, Uwe. Note that another posting today had the same type of problem: > >> require(Matrix) > > Loading required package: Matrix > > Error in dyn.load(file, ...) : > > unable to load shared library > > 'C:/PROGRA~1/R/R-26~1.2/library/Matrix/libs/Matrix.dll': > > LoadLibrary failure: The sp

[R] system.time gives error when "=" is used for assignment (R-2.6.0)

2008-04-10 Thread Kyeongmi Cheon
Hello list, I found that system.time works correctly when I used "<-" to assign a value to a variable but when I happened to use "=" instead of "<-", R gave an error message: "Error in system.time(your argument here...)". It happened with a few functions I tried. Is this a bug or is there any circu

[R] Vegan dataframe not acting nicely

2008-04-10 Thread stephen sefick
This is what my data looks like DOC TOC TKN RM119mFeb-06 1 23 RM61mFeb-06 246 I have this both in a .csv and .txt I have read this in with read.csv("chemodr.csv", header=T) and this is what I get X dAmon DN

Re: [R] Adding average into a matplot?

2008-04-10 Thread Bill.Venables
Dear Kingfisher, Try this. X <- as.matrix(read.table(textConnection(" 500 500 500 500 516 519 509 508 559 573 556 566 613 650 611 633 676 714 667 716 751 808 742 809 816 890 823 879"))) Year <- 2000 + 1:7 matplot(Year, X, type = "l", pch = 3, col = "grey") lines(Yea

Re: [R] mixture distribution analisys

2008-04-10 Thread Rubén Roa-Ureta
Antonio Olinto wrote: > Hello, > > I'm analyzing some fish length-frequency data to access relative age and > growth > information and I would like to do something different from FiSAT / ELEFAN > analysis. > > I found a package named MIX in http://www.math.mcmaster.ca/peter/mix/mix.html > but i

Re: [R] loading an updated version of a package during an active R session?

2008-04-10 Thread Roger Levy
Prof Brian Ripley wrote: > On Wed, 9 Apr 2008, Roger Levy wrote: > >> I am developing a package and I want to be able to load an updated >> version of the package from within an active R session. Suppose, >> for example, I have a function f within a package X. In my active >> R session, I have

[R] cls.attrib and integer

2008-04-10 Thread Christophe Genolini
Hi the list, Is it a bug? The function cls.attrib seems to not work with integer : values <- round(runif(50,1,10)) dim(values) <- c(10,5) valuesBis <- as.integer(values) dim(valuesBis) <- c(10,5) cluster <- rep(1:2,5) library(clv) cls.attrib(values,cluster) cls.attrib(valuesBis,cluster) Christop

Re: [R] adonis (vegan package) and subsetted factors

2008-04-10 Thread Jari Oksanen
On 10 Apr 2008, at 18:57, tyler wrote: > On Thu, Apr 10, 2008 at 04:47:44PM +0100, Gavin Simpson wrote: >> >> This behaviour arises from the following, using the in-built dune >> data: >> >>> newdune.env <- subset(dune.env, Management != "NM") >>> newdune.env$Management >> [1] BF SF SF SF HF SF

[R] nonlinear regression problem

2008-04-10 Thread Sungsu
Dear R users. I would like to ask you a nonlinear regression problem that I have. Thr model is y=integrate(1/[(a+b*cos(x))*sqrt{(a+b*cos(x))^2-h^2}],from 0 to x) I tried the following code in writing the function and the minimization: y=c( 3.2, 3.4, 3.2, 3, 3.4, 3.1, 3.2, 3.3, 3.5, 3.4, 3.2,

Re: [R] mixture distribution analisys

2008-04-10 Thread Ingmar Visser
The CRAN task view on cluster and mixture models likely has what you need. hth, Ingmar http://cran.r-project.org/web/views/Cluster.html On Apr 10, 2008, at 11:20 PM, Antonio Olinto wrote: > Hello, > > I'm analyzing some fish length-frequency data to access relative > age and growth > informa

Re: [R] Fixing the physical size of Trellis graphs panels

2008-04-10 Thread Deepayan Sarkar
On 4/10/08, Sébastien <[EMAIL PROTECTED]> wrote: > Dear R-users, > > Please consider the following script: > > # > > library(lattice) > ID <- rep(1:8,each=2) > x <- rep (c(1,2),8) > y <- c(rep(c(0.5,2),4),rep(c(50,1000),4)) > df<-data.frame(ID,x,y) > g <- rep(1:2,each=8) > df.split<-sp

Re: [R] Relational Databases or XML?

2008-04-10 Thread Martin Morgan
Harold -- you'll really want to check out the XML package. xmlTreeParse + xpathApply provides a very flexible solution. As a recent example, parsing 189 XML files to extract 4 attributes from deeply nested elements into a data frame: fls <- list.files('~/runBrowser', pattern=".*xml", full=TRUE)

[R] Fixing the physical size of Trellis graphs panels

2008-04-10 Thread Sébastien
Dear R-users, Please consider the following script: # library(lattice) ID <- rep(1:8,each=2) x <- rep (c(1,2),8) y <- c(rep(c(0.5,2),4),rep(c(50,1000),4)) df<-data.frame(ID,x,y) g <- rep(1:2,each=8) df.split<-split(df,g) df.split pdf(file="C:/Test.pdf") for (i in 1:2) { mydf<-as.data.fram

Re: [R] Degrees of freedom in binomial glm

2008-04-10 Thread Prof Brian Ripley
You don't have 168 observations - 2 of them have no data (Freq = 0). On Thu, 10 Apr 2008, Giovanni Petris wrote: Hello, I am looking at the job satisfaction data below, from a problem in Agresti's book, and I am not sure where the degrees of freedom come from. The way I am fitting a binomial

Re: [R] Types in grouped multi-panel (lattice) xyplot

2008-04-10 Thread Aaron Arvey
On Thu, 10 Apr 2008, Deepayan Sarkar wrote: > On 4/10/08, Deepayan Sarkar <[EMAIL PROTECTED]> wrote: >> On 4/10/08, Aaron Arvey <[EMAIL PROTECTED]> wrote: >> > Apologetic prologue: I've looked through the mailing list for an answer to >> > this (since I'm sure it's trivial) but I have not been ab

[R] mixture distribution analisys

2008-04-10 Thread Antonio Olinto
Hello, I'm analyzing some fish length-frequency data to access relative age and growth information and I would like to do something different from FiSAT / ELEFAN analysis. I found a package named MIX in http://www.math.mcmaster.ca/peter/mix/mix.html but it's compiled for R 2.0.0 So I have two q

Re: [R] Row mean scores differ association

2008-04-10 Thread Austin, Matt
There is a R companion to Agresti's text at the following site, I believe the answer to your question is there: http://www.stat.ufl.edu/~aa/cda/cda.html --Matt Matt Austin Biostatistics Director Amgen, Inc -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Beha

Re: [R] Relational Databases or XML?

2008-04-10 Thread Gabor Grothendieck
Its avaliable on CRAN extras: http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/ and can be downloaded even more easily through the Windows package menu in R. On Thu, Apr 10, 2008 at 4:45 PM, Doran, Harold <[EMAIL PROTECTED]> wrote: > Well, I guess it is possible with XML package on CRAN. B

[R] Degrees of freedom in binomial glm

2008-04-10 Thread Giovanni Petris
Hello, I am looking at the job satisfaction data below, from a problem in Agresti's book, and I am not sure where the degrees of freedom come from. The way I am fitting a binomial model, I have 168 observations, so in my understanding that should also be the number of fitted parameters in the sat

[R] time series regression

2008-04-10 Thread bereket weldeslassie
Dear, I am doing a time series regression (one dependent time series variable, 7 independent time series variables and 32 annual observations). I have the problem of cointegration, autocorrelation and multicollinearity. I am considering an error correction model of the form: diff(lnY(t))=a+b1*lnY(t

[R] function to calculate networkdays?

2008-04-10 Thread tom soyer
Hi, Does anyone know if R has a built-in function that is similar to Excel's NETWORKDAYS function? i.e., Returns the number of whole working days between two dates. Working days exclude weekends. Thanks, -- Tom [[alternative HTML version deleted]] _

Re: [R] Problem installing and using package "tseries"

2008-04-10 Thread Uwe Ligges
Can you please try to reinstall in roughly 12 hours from now from CRAN master? I have fixed the problem and recompiled tseries which will appear on CRAN master within 12 hours. Best wishes, Uwe Ligges Robert A. LaBudde wrote: > I have R 2.6.2, and have tried downloading and installing the pack

Re: [R] Relational Databases or XML?

2008-04-10 Thread Prof Brian Ripley
On Thu, 10 Apr 2008, Doran, Harold wrote: > Well, I guess it is possible with XML package on CRAN. But, it seems > there is no windows binary (yet) There certainly is -- did you try installing it from CRAN (extras)? >> -Original Message- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROT

Re: [R] Types in grouped multi-panel (lattice) xyplot

2008-04-10 Thread Deepayan Sarkar
On 4/10/08, Deepayan Sarkar <[EMAIL PROTECTED]> wrote: > On 4/10/08, Aaron Arvey <[EMAIL PROTECTED]> wrote: > > Apologetic prologue: I've looked through the mailing list for an answer to > > this (since I'm sure it's trivial) but I have not been able to find a fix. > > > > So the problem is t

Re: [R] Types in grouped multi-panel (lattice) xyplot

2008-04-10 Thread Deepayan Sarkar
On 4/10/08, Aaron Arvey <[EMAIL PROTECTED]> wrote: > Apologetic prologue: I've looked through the mailing list for an answer to > this (since I'm sure it's trivial) but I have not been able to find a fix. > > So the problem is that I want each group to have a different type of plot. > "Probes" s

Re: [R] Relational Databases or XML?

2008-04-10 Thread Doran, Harold
Well, I guess it is possible with XML package on CRAN. But, it seems there is no windows binary (yet) > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold > Sent: Thursday, April 10, 2008 4:29 PM > To: Keith Alan Chamberlain; r-help@r-proje

Re: [R] Relational Databases or XML?

2008-04-10 Thread Gabor Grothendieck
You may wish to try out sqldf. It allows one to manipulate data frames using sql. The real work is done by sqlite and the RSQLite interface but it sets up the database for you and all the tables and then deletes them so its as easy a typing in one line of code. Check out the home page at http://s

Re: [R] Relational Databases or XML?

2008-04-10 Thread Doran, Harold
I'm not sure it is possible to parse an XML file in R directly. Well, I guess it's *possible*, but may not be the best way to do it. ElementTree in Python is an easy-to-use parser that you might use to first parse your XML file (or others hierarchically structured data), organize it anyway you want

[R] Relational Databases or XML?

2008-04-10 Thread Keith Alan Chamberlain
Dear R-Help, I am working on a paper in an R course for large file support in R using scan(), relational databases, and XML. I have never used SQL or heirarchical document formats such as XML (except where it occurs without user interaction), and knowledge in RDBs and XML is lacking in my progr

[R] Row mean scores differ association

2008-04-10 Thread dt Excellent
Suppose that we have o 2-D contingency table where the row variable is nominal and the column one is ordinal. In SAS it is possible to compute the statistic named as row mean scores differ. How can we programmed it in R? (See also Aggresti (2002), Categorical Data Analysis, p. 302) With regards

[R] Types in grouped multi-panel (lattice) xyplot

2008-04-10 Thread Aaron Arvey
Apologetic prologue: I've looked through the mailing list for an answer to this (since I'm sure it's trivial) but I have not been able to find a fix. So the problem is that I want each group to have a different type of plot. "Probes" should be points and "Segments" should be lines (preferably us

Re: [R] two graphs in one figure?

2008-04-10 Thread Greg Snow
Using par(new=TRUE) can be tricky. A better approach is to create one plot, then add the other information to it. You can add bars to an existing graph using barplot with add=TRUE, you can add lines to an existing plot using the lines function. If you give more detail of what you want (examp

Re: [R] Arbitrary Precision Numbers

2008-04-10 Thread Rory Winston
Thanks Earl Thats exactly what I was looking for - an extension that uses libgmp and provides a bignum type that can be combined with standard operators and numeric variables. Somehow my original search on CRAN missed this one. Cheers Rory Earl F. Glynn wrote: > > "Rory Winston" <[EMAIL PROTEC

Re: [R] How to replace German umlauts in strings?

2008-04-10 Thread Prof Brian Ripley
Or read the file with read.table(file("umlaut.txt", encoding="MAC"), ...) On Thu, 10 Apr 2008, Peter Dalgaard wrote: Dieter Menne wrote: Hans-Jörg Bibiko eva.mpg.de> writes: On 10.04.2008, at 18:03, Hofert Marius wrote: I have a file containing names of German students. These names con

Re: [R] Problem with loading package Matrix

2008-04-10 Thread Prof Brian Ripley
What OS is that? If it is Windows 2000, try copying Rblas.dll to Rblas in the bin folder. (We have no idea why that might be needed, but it has worked for some people -- others have no problem even with Windows 2000.) On Thu, 10 Apr 2008, Peter H Singleton wrote: > > Hello, > > I recently upgra

[R] how to fit a model that is nonlinear with multiplicate errors

2008-04-10 Thread Stacey Burrows
Hi fellow R-users, I am interested in fitting the following model yi=log(a+xi*b*e), e~N(0,sigma2) and where x is a known covariate and a and b are parameters to be estimated as is sigma2. I am not sure how to fit such a model using lm or nls. Is there another function I can use to fit this?

Re: [R] How to replace German umlauts in strings?

2008-04-10 Thread Peter Dalgaard
Dieter Menne wrote: > Hans-Jörg Bibiko eva.mpg.de> writes: > > >> On 10.04.2008, at 18:03, Hofert Marius wrote: >> >>> I have a file containing names of German students. These names >>> contain the characters "ä", "ö" or "ü" (German umlauts). I use >>> read.table() to read the file and let

[R] polytomous or multinomial regression for matched data

2008-04-10 Thread Sara Gale
Hi, I've been trying to find a program that will run a multinomial conditional regression on k:m matched data. Does anyone know of a package in R or another package that will allow this? It's not obvious that multinom within nnet or VGAM will allow matched sets. I've used a program (mcl) in

Re: [R] Tukey in R, extracting values

2008-04-10 Thread Dieter Menne
mad_bassie hotmail.com> writes: > how can i extract the values from the CI's when i use following code for a > tukey test? > the output shows three CI's and i know it should work with 'names but i > don't really know how... You forgot to post a self-running example. Chances are always better to g

Re: [R] How to replace German umlauts in strings?

2008-04-10 Thread Dieter Menne
Hans-Jörg Bibiko eva.mpg.de> writes: > > On 10.04.2008, at 18:03, Hofert Marius wrote: > > I have a file containing names of German students. These names > > contain the characters "ä", "ö" or "ü" (German umlauts). I use > > read.table() to read the file and let's assume the table is then > > st

Re: [R] subtract the mean from each column

2008-04-10 Thread Henrique Dallazuanna
Or just: scale(mymat, scale = FALSE) On Thu, Apr 10, 2008 at 2:03 PM, kayj <[EMAIL PROTECTED]> wrote: > > Hi, > > I am new to R an dI need some help > I have a matrix of real values 100*300 and I would like to calculate the > mean for each column , then for each entry in a column i need to subtr

Re: [R] Adding average into a matplot?

2008-04-10 Thread Mike Prager
-Halcyon- <[EMAIL PROTECTED]> wrote: > I have a matrix which is filled with simulation results for several years. > Example of an output (7 years, 4 simulations): > [...] > My matplot gives me 4 lines, but I would like to add a line with the > averages of each year for all simulations. Can an

Re: [R] subtract the mean from each column

2008-04-10 Thread Chuck Cleland
On 4/10/2008 1:03 PM, kayj wrote: > Hi, > > I am new to R an dI need some help > I have a matrix of real values 100*300 and I would like to calculate the > mean for each column , then for each entry in a column i need to subtract > the mean so I will have a matrix where the columns have zero mean.

[R] subtract the mean from each column

2008-04-10 Thread kayj
Hi, I am new to R an dI need some help I have a matrix of real values 100*300 and I would like to calculate the mean for each column , then for each entry in a column i need to subtract the mean so I will have a matrix where the columns have zero mean. any one know how to do that . Thanks -- V

[R] Problem with loading package Matrix

2008-04-10 Thread Peter H Singleton
Hello, I recently upgraded from R 2.6.1 to 2.6.2. I uninstalled 2.6.1, installed 2.6.2, and installed the packages I regularly use. Everyting seems to be running properly, including most of the packages, but when I try to call the Matrix package, I get the following error: > require(Matrix) Load

Re: [R] permutation test assumption?

2008-04-10 Thread Ramon Diaz-Uriarte
Just an additional note: what I find interesting (that is an euphemism) is that a paper such as that got published on 2006 when a whole bunch of detailed papers on the same topic had been published in the past. For instance, the first I pick from the pile is by J. Romano, "On the behavior of random

[R] QP.solve, QPmat, constraint matrix, and positive definite

2008-04-10 Thread jpolo
hello all, i'm trying to use QPmat, from the popbio package. it appears to be based on solve.QP and is intended for making a population projection matrix. QPmat asks for: nout, A time series of population vectors and C, C constraint matrix, (with two more vectors, b and nonzero). i believe the rel

Re: [R] How to replace German umlauts in strings?

2008-04-10 Thread Hans-Jörg Bibiko
On 10.04.2008, at 18:03, Hofert Marius wrote: > I have a file containing names of German students. These names > contain the characters "ä", "ö" or "ü" (German umlauts). I use > read.table() to read the file and let's assume the table is then > stored in a variable called "data". The names are then

Re: [R] New Special Interest Groups?

2008-04-10 Thread Douglas Bates
Martin Maechler <[EMAIL PROTECTED]>, who oversees the mailing lists, would be the best person to start with. On 4/10/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >Dear list, >After some extensive searching, I have drawn a blank on this. So ... >Who is the best contact for questi

[R] QP.solve, QPmat, constraint matrix, and positive definite

2008-04-10 Thread jpolo
hello all, i'm trying to use QPmat, from the popbio package. it appears to be based on solve.QP and is intended for making a population projection matrix. QPmat asks for: nout, A time series of population vectors and C, C constraint matrix, (with two more vectors, b and nonzero). i believe the rel

[R] Problem installing and using package "tseries"

2008-04-10 Thread Robert A. LaBudde
I have R 2.6.2, and have tried downloading and installing the package "tseries". I get the same error when I use two different mirror sites: > utils:::menuInstallPkgs() trying URL 'http://cran.mirrors.hoobly.com/bin/windows/contrib/2.6/tseries_0.10-14.zip' Content type 'application/zip' length

[R] How to replace German umlauts in strings?

2008-04-10 Thread Hofert Marius
Dear R-users, I have a file containing names of German students. These names contain the characters "ä", "ö" or "ü" (German umlauts). I use read.table() to read the file and let's assume the table is then stored in a variable called "data". The names are then contained in the first column,

Re: [R] New user, requesting help with MAC installation of R

2008-04-10 Thread Armin Goralczyk
Hi The graphics commands should work without problem. On Mac the default graphics window is a quarz device. Did you get the 'official' mac binary from CRAN with GUI? If the problem persits you can ask in the mailing list R-SIG-Mac (see instructions for posting: http://www.r-project.org/mail.html) -

[R] 64-bit/32-bit

2008-04-10 Thread Sancar Adali
Our research group is thinking of buying a 64-bit windows workstation with an intel core2 duo processor, and I am going to use R on it. I have a couple of questions. Is it possible to run 32-bit build of R on a 64-bit computer without problems?(For windows) Would there be problems with contrib pac

Re: [R] adonis (vegan package) and subsetted factors

2008-04-10 Thread tyler
On Thu, Apr 10, 2008 at 04:47:44PM +0100, Gavin Simpson wrote: > > This behaviour arises from the following, using the in-built dune data: > > > newdune.env <- subset(dune.env, Management != "NM") > > newdune.env$Management > [1] BF SF SF SF HF SF HF HF BF BF HF SF SF HF > Levels: BF HF NM SF >

[R] Tukey in R, extracting values

2008-04-10 Thread mad_bassie
hey, how can i extract the values from the CI's when i use following code for a tukey test? the output shows three CI's and i know it should work with 'names but i don't really know how... thanks library(multcomp) data1$soort<-as.factor(data1$soort) amod<-aov(waarde~soort,data=data1) g<-glht(amod

Re: [R] adonis (vegan package) and subsetted factors

2008-04-10 Thread Gavin Simpson
On Thu, 2008-04-10 at 11:18 -0300, tyler wrote: > Hi, > > I'm trying to use adonis on a subset of data from a dataframe. The > actual data is in columns 5:118, and the first four columns are various > factors. There are 3 levels of the factor Habitat, and I want to examine > differences among only

Re: [R] two graphs in one figure?

2008-04-10 Thread hadley wickham
On Thu, Apr 10, 2008 at 8:36 AM, ONKELINX, Thierry <[EMAIL PROTECTED]> wrote: > Dear Anne-Katrin, > > You could use ggplot to do this. The example below works, although it > generates some warnings. > > library(ggplot2) > dataset <- data.frame(x = 0:55, y = rnorm(56, 10), z = runif(56, 9, 11))

[R] Adding average into a matplot?

2008-04-10 Thread -Halcyon-
Hi all, I have a matrix which is filled with simulation results for several years. Example of an output (7 years, 4 simulations): [,1] [,2] [,3] [,4] [1,] 500 500 500 500 [2,] 516 519 509 508 [3,] 559 573 556 566 [4,] 613 650 611 633 [5,] 676 714 667 716 [6,]

Re: [R] Arbitrary Precision Numbers

2008-04-10 Thread Earl F. Glynn
"Rory Winston" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > (If you're wondering, this is a Project Euler question :)) > > If I wanted to calculate the sum of the digits in the decimal > representation > of 2^1000, what would be a good way to go about that? Try this: > library(

Re: [R] (no subject)

2008-04-10 Thread Katharine Mullen
I would suggest making your exact data and calls available. You can get the estimated parameters from nls even in the case that the convergence criterium is not met by saying warnOnly=TRUE in the control list. depending on why you are not getting convergence, you may want to try a different algor

Re: [R] Structural Modelling in R-project

2008-04-10 Thread Ivaha C (AT)
Thanks for this, it's a good start. I am using a univariate series indeed. Do you know where I could find the codes for StructTS please? I can't seem to find it. Thanks again Christian Ivaha PhD Student University of Glamorgan Faculty of Advanced Technology Treforest CF37 1DL -Original Mess

Re: [R] Structural Modelling in R-project

2008-04-10 Thread markleeds
>From: "Ivaha C (AT)" <[EMAIL PROTECTED]> >Date: 2008/04/10 Thu AM 08:51:14 CDT >To: R Help >Subject: [R] Structural Modelling in R-project if you have a univariate time series and you want to break it into its various components, then you get the scalars based on a decomposition. if you have

Re: [R] Fit a nonlinear regression model with power exponentially distributed errors

2008-04-10 Thread Spencer Graves
You are making progress. Could you please provide a self-contained example of an attempt by you to make it work, as requested in the posting guide http://www.R-project.org/posting-guide.html? That should make it easier for someone else to provide an answer that will actually be us

Re: [R] LSODA not accurate when RK4 is; what's going on?

2008-04-10 Thread Ravi Varadhan
John, In "lsoda" the increment for "time-marching" is adaptively chosen, controlled by "atol" and "rtol". The increment is restricted to lie in (hmin, hmax). So you can ensure accuracy, perhaps, at the cost of efficiency by specifying smaller than default values for atol, rtol, and hmax, which a

[R] ggplot - plot with only legend?

2008-04-10 Thread Pedro de Barros
Dear R'ers, I am trying to build a composite plot (with several plots in one figure). I have tried, but I cannot use facetting, as I need to customize each plot using grid. Since all the plots are the same (with different data, but same layout and categories), I would like to have only one lege

Re: [R] LSODA not accurate when RK4 is; what's going on?

2008-04-10 Thread Ravi Varadhan
John, I should also mention that by looking at the R source for lsoda() you can see that the default values for "atol" and "rtol" are 1.e-06. This should have been mentioned in the help file, but is not. Another approach to solving your problem is to restrict "hmax", the maximum steplength. s4

[R] adonis (vegan package) and subsetted factors

2008-04-10 Thread tyler
Hi, I'm trying to use adonis on a subset of data from a dataframe. The actual data is in columns 5:118, and the first four columns are various factors. There are 3 levels of the factor Habitat, and I want to examine differences among only two of them. So I started with: > CoastNear = subset(gel_d

Re: [R] Recovering SPlus GraphSheets

2008-04-10 Thread Duncan Murdoch
On 4/10/2008 9:56 AM, Thompson, David (MNR) wrote: > Hello, > > Is it possible with R to recover the contents of SPlus GraphSheets > (*.sgr) without access to SPlus? > Also, some of the .sgr files may have multiple pages. "Possible" is probably not the right word here: I'm sure the answer to yo

Re: [R] LSODA not accurate when RK4 is; what's going on?

2008-04-10 Thread Ravi Varadhan
John, You should decrease atol and/or rtol to get accurate integration of your function. Try this: fn <- function(t,y,parms=0){return(list(t*y-1))} t4 <- seq(0, 5, by=.0001) s4 <- lsoda(y=sqrt(pi/2), times=t4, func=fn, parms=0, atol=1.e-10, rtol=1.e-10) plot(s4, type="l") Hope this is helpfu

Re: [R] lme and confidence intervals

2008-04-10 Thread Gregory Warnes
FWIW, the ci() function in the gmodels package supports generating confidence intervals for the fixed effects of lme objects. -G On Apr 8, 2008, at 1:34PM , Dieter Menne wrote: > Cristian Carranza hotmail.com> writes: >> After fitting a mixed effects model to repeated measurements data >> s

[R] (no subject)

2008-04-10 Thread Lindsay Banin
Subject: nls, step factor 0.000488281 reduced below 'minFactor' of 0.000976563 Hi there, I'm trying to conduct nls regression using roughly the below code: nls1 <- nls(y ~ a*(1-exp(-b*x^c)), start=list(a=a1,b=b1,c=c1)) I checked my start values by plotting the relationship etc. but I kept getting

[R] Recovering SPlus GraphSheets

2008-04-10 Thread Thompson, David (MNR)
Hello, Is it possible with R to recover the contents of SPlus GraphSheets (*.sgr) without access to SPlus? Also, some of the .sgr files may have multiple pages. Thanx, DaveT. * Silviculture Data Analyst Ontario Forest Research Institute Ontario Ministry of Natu

[R] Structural Modelling in R-project

2008-04-10 Thread Ivaha C (AT)
Hi all I was wondering if I could ask for some assistance on two little enquiries that I have got. In the R-project, when using the StructTS function on a times series Zt, the programs return this: Call: StructTS(x = Zt) Variances: level slope seasepsilon 0.168461 0.000

[R] quantitative real time PCR

2008-04-10 Thread Marcelo
Hi, Please, I am looking for a way to analyze my qRT-PCR in my debian gnu linux and I found a package named qpcR on cran. Do you known another one that do this analysis (preferable a R addon)? If you already had do this one in a linux box, could you point me out how you did? Thank you very much

Re: [R] two graphs in one figure?

2008-04-10 Thread ONKELINX, Thierry
Dear Anne-Katrin, You could use ggplot to do this. The example below works, although it generates some warnings. library(ggplot2) dataset <- data.frame(x = 0:55, y = rnorm(56, 10), z = runif(56, 9, 11)) ggplot(data = dataset) + geom_bar(aes(x = factor(x), y = y), position = "dodge") + geom_line

[R] New Special Interest Groups?

2008-04-10 Thread Hollister . Jeff
Dear list, After some extensive searching, I have drawn a blank on this. So ... Who is the best contact for questions about starting a new special interest group mailing list? Cheers, Jeff *** Dr. Jeffrey W. Hollister US EPA Atlantic Ecology D

Re: [R] Orthogonal polynomial contrasts

2008-04-10 Thread Frank E Harrell Jr
Peter Dalgaard wrote: > Chris Bennett wrote: >> How do you remove one of the terms from an ordered polynomial contrast in >> your linear model. For example, I have significant terms for linear and >> cubic but not quadratic, how would i remove the quadratic term from >> lm(response~treatment) >> >

[R] two graphs in one figure?

2008-04-10 Thread Anne-Katrin Link
Dear all, how can I plot a line graph and a bar graph in one single figure? I tried to combine "barplot" and "plot". Even though they both have the same x-values (1 to 55),  it just doesnt look as if they match in their scale (the barplot is much wider than the "plot"even though I tried to

Re: [R] How to estimate a hazard ratio using an external hazard function

2008-04-10 Thread Terry Therneau
included message Hi, I would like to compare the hazard functions of two samples using the Cox proportional hazards model. For sample 1 I have individual time-to- event data. For sample 2 I don't have individual data, but grouped data that allows to obtain a hazard function. I am wo

Re: [R] Beautifying axis tick labels

2008-04-10 Thread Jim Lemon
Ng Stanley wrote: > Hi, > > For example, the y axis shows "0 50 150". Is there any way to > beautify the tick labels to get 0 5 10 15, and at the top of y-axis "x10^5" > (superscript 5) ? My plots all have different ylim, how to perform the > beautification automatically ? Hi Stanley, You

Re: [R] Orthogonal polynomial contrasts

2008-04-10 Thread Peter Dalgaard
Chris Bennett wrote: > How do you remove one of the terms from an ordered polynomial contrast in > your linear model. For example, I have significant terms for linear and > cubic but not quadratic, how would i remove the quadratic term from > lm(response~treatment) > > Cheers, > Chris > Are you

[R] [R-pkgs] RcmdrPlugin.Export_0.2-0 released

2008-04-10 Thread Liviu Andronic
Dear R users, I am pleased to announce the release of the Export plug-in for Rcmdr. At the moment, it is simply a graphical user interface to xtable(). Several developments are, however, planned. It is worth to note that the Manual offers several pointers on using Sweave together with LyX, and fro

[R] Orthogonal polynomial contrasts

2008-04-10 Thread Chris Bennett
How do you remove one of the terms from an ordered polynomial contrast in your linear model. For example, I have significant terms for linear and cubic but not quadratic, how would i remove the quadratic term from lm(response~treatment) Cheers, Chris -- View this message in context: http://ww

Re: [R] legend placement

2008-04-10 Thread Duncan Murdoch
Ng Stanley wrote: > Hi, > > I am plotting 5 charts using p <- par(mfrow = c(3, 2), how can I place my > legend in the last region ? I don't wan to put it into the margin. You should be able to do a blank plot, then plot the legend. For example, > par(mfrow=c(3,2)) > for (i in 1:5) plot(1) > p

Re: [R] How to create a legend without plot, and to use scientific notation for axes label ?

2008-04-10 Thread Hans-Joerg Bibiko
On 10 Apr 2008, at 12:57, Hans-Joerg Bibiko wrote: > > On 10 Apr 2008, at 12:33, Stanley Ng wrote: >> How can I use formatC to convert 600 to 6e5 and not 6e+05 ? >> >>> formatC(60) >> [1] "6e+05" >>> formatC(60, format="e", digit=0) >> [1] "6e+05" > > > Try this: > > gsub("([eE])(\\+?)

Re: [R] How to create a legend without plot, and to use scientific notation for axes label ?

2008-04-10 Thread Hans-Joerg Bibiko
On 10 Apr 2008, at 12:33, Stanley Ng wrote: > How can I use formatC to convert 600 to 6e5 and not 6e+05 ? > >> formatC(60) > [1] "6e+05" >> formatC(60, format="e", digit=0) > [1] "6e+05" Try this: gsub("([eE])(\\+?)(\\-?)0+", "\\1\\3", formatC(60, format="e", digit=0)) --Hans

Re: [R] Skipping specified rows in scan or read.table

2008-04-10 Thread Abhijit Dasgupta
Hi Ravi, One thing I tend to do is, when using read.table, specify the option 'colClasses='character''. This forces everything to be read as a character. From there, as.numeric works fine, and you don't have to deal with factors and reconverting them. Hope this helps Abhijit Ravi Varadhan wro

[R] How to estimate a hazard ratio using an external hazard function

2008-04-10 Thread Montserrat Rue
Hi, I would like to compare the hazard functions of two samples using the Cox proportional hazards model. For sample 1 I have individual time-to-event data. For sample 2 I don't have individual data, but grouped data that allows to obtain a hazard function. I am wondering if there is an R functio

Re: [R] How to create a legend without plot, and to use scientific notation for axes label ?

2008-04-10 Thread Stanley Ng
Hi, How can I use formatC to convert 600 to 6e5 and not 6e+05 ? > formatC(60) [1] "6e+05" > formatC(60, format="e", digit=0) [1] "6e+05" -Original Message- From: Uwe Ligges [mailto:[EMAIL PROTECTED] Sent: Thursday, April 10, 2008 17:11 To: Ng Stanley Cc: r-help Subject: Re:

Re: [R] Error: expected the collection operator c error pos 98 (error on line 1)

2008-04-10 Thread Uwe Ligges
Quick inspection shows that we cannot do anything. In BUGS, Y indicates a scalar and Y[] indicates a vector. For scalar Y, you need Y=0.0E+00 in your data file, but for vector Y[], you need Y=c(0.0E+00) in your data file. This means you need to know what Y is in the model and I do not s

  1   2   >