Re: [R] How to interpret the phase spectrum?

2009-11-24 Thread Peter Dalgaard
sdlywjl666 wrote: > Dear all, > I would like to know whether positive or negative values of the phase > spectrum indicate that the time series leads or lags. > In my work, x and y have peak nearly at the same > frequency,(eg:f=1/56);and the coherency is peak where f=1/56,the phase is 0.5 >

Re: [R] Loess Fit

2009-11-24 Thread Karl Ove Hufthammer
On Mon, 23 Nov 2009 14:03:11 -0700 Greg Snow wrote: > If you need a function to reproducibly generate predictions, then > use loess to generate a set of predictions for a reasonably dense set > of x-values, then use approxfun or splinefun to create a function to > interpolate for you. Then th

Re: [R] How to interpret the phase spectrum?

2009-11-24 Thread David Scott
Peter Dalgaard wrote: sdlywjl666 wrote: Dear all, I would like to know whether positive or negative values of the phase spectrum indicate that the time series leads or lags. In my work, x and y have peak nearly at the same frequency,(eg:f=1/56);and the coherency is peak where f=1/56,the ph

Re: [R] Natural colours for topographic data

2009-11-24 Thread Karl Ove Hufthammer
On Mon, 23 Nov 2009 12:21:03 -0500 David Winsemius wrote: > > I would be happy with a simple one, that just mapped negative values > > to water colours and positive values to land colours. > > Searching with the strategy "color positive negative zero" in r-search > and limiting it to r-help

Re: [R] How to interpret the phase spectrum?

2009-11-24 Thread Prof Brian Ripley
On Tue, 24 Nov 2009, David Scott wrote: Peter Dalgaard wrote: sdlywjl666 wrote: Dear all, I would like to know whether positive or negative values of the phase spectrum indicate that the time series leads or lags. In my work, x and y have peak nearly at the same frequency,(eg:f=1/56);and

[R] Fwd: R- bioconductor -- help

2009-11-24 Thread kumar kk
-- Forwarded message -- From: kumar kk Date: Tue, Nov 24, 2009 at 2:29 PM Subject: R- bioconductor -- help To: r-help-boun...@r-project.org How can we analyse text file using bioconductor(R). How can we import text file for analysis. Thanks [[alternative HTML version de

Re: [R] Natural colours for topographic data

2009-11-24 Thread Barry Rowlingson
On Tue, Nov 24, 2009 at 8:42 AM, Karl Ove Hufthammer wrote: > On Mon, 23 Nov 2009 12:21:03 -0500 David Winsemius > wrote: >> > I would be happy with a simple one, that just mapped negative values >> > to water colours and positive values to land colours. >> >> Searching with the strategy "color p

Re: [R] Natural colours for topographic data

2009-11-24 Thread Jim Lemon
On 11/24/2009 07:42 PM, Karl Ove Hufthammer wrote: On Mon, 23 Nov 2009 12:21:03 -0500 David Winsemius wrote: I would be happy with a simple one, that just mapped negative values to water colours and positive values to land colours. Searching with the strategy "color positive negat

Re: [R] Trellis Plot

2009-11-24 Thread Paul Hiemstra
ychu066 wrote: anyone know how to add text in the Trellis plot panel ?? i want to add things eg: dot dot dot. in the headrer of the panel. eg: http://old.nabble.com/file/p26486579/hist1.png hist1.png see panel.text() cheers, Paul -- Drs. Paul Hiemstra Department of Physical Geography Fac

Re: [R] Grouped Boxplot

2009-11-24 Thread Uwe Ligges
Gary wrote: Hi R Users, I'm interested in plotting a grouped boxplot (please see attached file for sample). Can anyone suggest a function{package} which can help me achieve this. Your attachment did not pass the list's filters. Anyway, see ?boxplot. Uwe Ligges Thanks, Gary ---

Re: [R] Fwd: R- bioconductor -- help

2009-11-24 Thread Uwe Ligges
kumar kk wrote: -- Forwarded message -- From: kumar kk Date: Tue, Nov 24, 2009 at 2:29 PM Subject: R- bioconductor -- help To: r-help-boun...@r-project.org How can we analyse text file using bioconductor(R). How can we import text file for analysis. You may want to ask a qu

[R] write to file append by column

2009-11-24 Thread e-letter
Readers, Scenario: data x consists of one column; 1 2 3 data y; 4 5 6 Is it possible to write to file such that the file is: 1,4 2,5 3,6 using the write.file function? I have tried the command: write(x,file="file.csv",ncolumns=1,append=TRUE,sep=",") write(y,file="file.csv",ncolumns=1,append=TR

Re: [R] Cannot set wireframe ticks?

2009-11-24 Thread Deepayan Sarkar
On Tue, Nov 24, 2009 at 10:02 AM, Fredrik Johansson wrote: > I have an issue when making a wireframe plot. I can't find any way to > change the number of ticks on the labels. I try to set it in the code > below with z.ticks=1, but that doesn't work. Is there anything that > works? (Note. I need to

[R] Odp: Grouped Boxplot

2009-11-24 Thread Petr PIKAL
Hi try ggplot2. It has some functionality to make groups of boxplots. Regards Petr r-help-boun...@r-project.org napsal dne 24.11.2009 03:33:49: > Hi R Users, > > I'm interested in plotting a grouped boxplot (please see attached file for > sample). Can anyone suggest a function{package} which

[R] Help: Beanplots calculating wrong average

2009-11-24 Thread Michael Hopgood
Hi there, I have a set of data that looks like this: As1988<-c(1254.0, 22.0, 4.2, 1081.0, 35.0, 6.0, 1772.0, 192.0, 7.6) The mean of this (as calculated by R) is: 485.9778 The median of this (as calculated by R) is: 35 If I then make a beanplot(As1988), I find that the beanline (average)

Re: [R] Excel-Export

2009-11-24 Thread Hans-Peter Suter
Jens, 2009/11/23 koj : > library(xlsReadWrite) > Everything is fine, but the format of the export is not the best. For > example, I every time have to adjust the column width. Furthermore there is > no possibility to highlight some cell or make them colourful. Auto-col is supported by the underly

Re: [R] Cannot set wireframe ticks?

2009-11-24 Thread Fredrik
Great, that's it! Thanks a lot! I didn't find that. __ 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-contai

[R] Old Version of R - packages

2009-11-24 Thread Julia Cains
Hi! Unfortunately the version loaded on the office server is 2.6.0 (for some undisclosed so called policy decision by my adamant IT dept. who are not willing to upgrade), I need to use YieldCurve package compatible with this version. On my standalone machine I have R 2.9 loaded and hence I have

Re: [R] write to file append by column

2009-11-24 Thread jim holtman
You can not append a column. Best bet, read the old file in, do a 'cbind', write the object back out. On Tue, Nov 24, 2009 at 5:59 AM, e-letter wrote: > Readers, > > Scenario: data x consists of one column; > 1 > 2 > 3 > > data y; > 4 > 5 > 6 > > Is it possible to write to file such that the fil

Re: [R] Old Version of R - packages

2009-11-24 Thread Uwe Ligges
Julia Cains wrote: Hi! Unfortunately the version loaded on the office server is 2.6.0 (for some undisclosed so called policy decision by my adamant IT dept. who are not willing to upgrade), I need to use YieldCurve package compatible with this version. On my standalone machine I have R 2.9

Re: [R] write to file append by column

2009-11-24 Thread e-letter
On 24/11/2009, jim holtman wrote: > You can not append a column. Best bet, read the old file in, do a > 'cbind', write the object back out. > > On Tue, Nov 24, 2009 at 5:59 AM, e-letter wrote: >> Readers, >> >> Scenario: data x consists of one column; >> 1 >> 2 >> 3 >> >> data y; >> 4 >> 5 >> 6

Re: [R] Old Version of R - packages

2009-11-24 Thread Julia Cains
Dear Uwe Ligges, Sir, I am extremely sorry for not mentioning about the windows environment. I am new to R and trying to learn R besides having to attend my regular commitments.  Thanks a lot for your guidance again Sir. Regards Julia Only

Re: [R] write to file append by column

2009-11-24 Thread jim holtman
Here is the way to get the required output: > x <- data.frame(a=1:3) > write.csv(x, file='tempxx.csv', row.names=FALSE) > # new data > newData <- data.frame(b=4:6) > # read old data back in > oldData <- read.csv('tempxx.csv') > # cbind the new data > write.csv(cbind(oldData, newData), file='tempxx

[R] Decision trees with factors and numericals

2009-11-24 Thread Joel Fürstenberg-Hägg
Hi all, Does any of you know how to make a decision tree when the data set contains factors and numericals? I've got a data frame with 3 columns, where y and x1 are numerical and x2 contains factors. Is it possible to use the rpart package, and in that case how? Otherwise, is there another

[R] From R to LaTeX to pdf?

2009-11-24 Thread Joel Fürstenberg-Hägg
Hi all, Anyone experienced in the LaTeX format? I'm trying to use the xtable package to create nice anova tables, but how do I do to produce a pdf from the resulting LaTeX table? I've tried WinShell and MiKTeX, but I couldn't get any of them working... Here's an example of the output

Re: [R] Decision trees with factors and numericals

2009-11-24 Thread David Winsemius
On Nov 24, 2009, at 8:50 AM, Joel Fürstenberg-Hägg wrote: Does any of you know how to make a decision tree when the data set contains factors and numericals? I've got a data frame with 3 columns, where y and x1 are numerical and x2 contains factors. Is it possible to use the rpart package

Re: [R] From R to LaTeX to pdf?

2009-11-24 Thread Kevin E. Thorpe
Joel Fürstenberg-Hägg wrote: Hi all, Anyone experienced in the LaTeX format? I'm trying to use the xtable package to create nice anova tables, but how do I do to produce a pdf from the resulting LaTeX table? I've tried WinShell and MiKTeX, but I couldn't get any of them working...

Re: [R] From R to LaTeX to pdf?

2009-11-24 Thread Benoit Boulinguiez
Hi Joel, that's a LaTeX issue you have there, nothing wrong with R. You should post your message on a LaTeX Forum about how to use LaTeX. http://www.latex-community.org/ Regards Benoit -Message d'origine- De : r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] De l

Re: [R] From R to LaTeX to pdf?

2009-11-24 Thread Thomas Adams
Joel, You should consider using Sweave: http://www.stat.umn.edu/~charlie/Sweave/ -or- http://en.wikipedia.org/wiki/Sweave Regards, Tom Joel Fürstenberg-Hägg wrote: Hi all, Anyone experienced in the LaTeX format? I'm trying to use the xtable package to create nice anova tables, bu

Re: [R] From R to LaTeX to pdf?

2009-11-24 Thread Stephan Devriese
2009/11/24 Joel Fürstenberg-Hägg > > Hi all, > > > > Anyone experienced in the LaTeX format? > > > > I'm trying to use the xtable package to create nice anova tables, but how > do I do to produce a pdf from the resulting LaTeX table? I've tried WinShell > and MiKTeX, but I couldn't get any of the

[R] [R-pkgs] new version of distr-family of packages

2009-11-24 Thread Matthias Kohl
The new version 2.2 of our distr-family of packages has now been available on CRAN for several days. As there were many changes we will only sketch the most important ones here. For more details see the corresponding NEWS files (e.g. news(package = "distr") or using function NEWS from package s

Re: [R] Trellis Plot

2009-11-24 Thread Walmes Zeviani
You could try adapt this code: yy <- c(rnorm(20,2),rnorm(35,3), rnorm(30,2),rnorm(20,3),rnorm(4,2),rnorm(10,3)) xx <- c(1:20,1:35,1:30,1:20,1:4,1:10) gg <- rep(c('A','B','A','B','A','B'), c(20,35,30,20,4,10)) pp <- rep(c('Cond 1','Cond 2','Cond 3'), c(55, 50, 14)) #pdf("teste.pdf") xyplot(yy ~ x

Re: [R] Re adline()

2009-11-24 Thread yonosoyelmejor
I put that before selection but Nothing happened...I don´t know because when I executed the code, in the console doesn´t show cat("1-24hours)...and neither asked me Select numers of hours from de line or readline... Peter Dalgaard wrote: > > yonosoyelmejor wrote: >> Hello, I would like to ask yo

[R] Method

2009-11-24 Thread yonosoyelmejor
Hello, i would like to ask you another question. Is exist anymethod to vectors that tells me the last element?That is to say,I have a vector, I want to return the position of last element. I hope having explained. A greeting, Ignacio. -- View this message in context: http://old.nabble.com/Metho

Re: [R] From R to LaTeX to pdf?

2009-11-24 Thread Liviu Andronic
Hello On 11/24/09, Joel Fürstenberg-Hägg wrote: > I'm trying to use the xtable package to create nice anova tables, but how do > I do to produce a pdf from the resulting LaTeX table? I've tried WinShell and > MiKTeX, but I couldn't get any of them working... > Take a look at the documentation

Re: [R] Help: Beanplots calculating wrong average

2009-11-24 Thread joris meys
Hi, The log of the mean is not the same as the mean of the logs, that's a no-brainer. Guess you use the beanplot from the package with the same name. > beanplot(As1988,log="") gives the correct plot. Next time, could you provide a minimal code example we can run ourselves? If we don't know what

Re: [R] Method

2009-11-24 Thread Keo Ormsby
yonosoyelmejor escribió: Hello, i would like to ask you another question. Is exist anymethod to vectors that tells me the last element?That is to say,I have a vector, I want to return the position of last element. I hope having explained. A greeting, Ignacio. vect1 <- c(1,2,3) vect1[length(v

Re: [R] Method

2009-11-24 Thread Sarah Goslee
It isn't entirely clear what you want. Maybe one of these? x <- runif(45) # make a test vector length(x) # position of the last element x[length(x)] # value of the last element Sarah On Tue, Nov 24, 2009 at 5:18 AM, yonosoyelmejor wrote: > > Hello, i would like to ask you another

Re: [R] From R to LaTeX to pdf?

2009-11-24 Thread Tom Backer Johnsen
As a general observation, few, if any, statistical packages, generate tables in the format what you might think you need or want. R is not an exception. Then it is better to transfer the table to a spreadsheet, shift things around, add headers, etc.. The R2HTML library is useful for that ope

Re: [R] From R to LaTeX to pdf?

2009-11-24 Thread Ista Zahn
2009/11/24 Tom Backer Johnsen : > As a general observation, few, if any, statistical packages, generate tables > in the format what you might think you need or want.  R is not an exception. I actually find that Hmisc::latex generates tables pretty much exactly as I want them. For me, this is one o

[R] Error in text.rpart(fit) : fit is not a tree, just a root

2009-11-24 Thread Joel Fürstenberg-Hägg
Hi all, I've tried to make a decision tree for the following data set: Level X Response 279 C 2.4728646 -9.445 341 B 0.5986398 -9.413 343 B 1.1786271 -9.413 384 D 1.4797870 -9.413 390 C 2.0364569 -9.133 391 D 0.93657

Re: [R] Method

2009-11-24 Thread David Winsemius
On Nov 24, 2009, at 10:20 AM, Keo Ormsby wrote: yonosoyelmejor escribió: Hello, i would like to ask you another question. Is exist anymethod to vectors that tells me the last element?That is to say,I have a vector, I want to return the position of last element. I hope having explained. A

Re: [R] From R to LaTeX to pdf?

2009-11-24 Thread Erik Iverson
While what you say is true for base R, someone already mentioned Hmisc's latex function, and I have written several custom functions to output tables in LaTeX, the benefit being the elimination of manual formatting and intervention when preparing tables. Add this in with Sweave and make files,

Re: [R] Method

2009-11-24 Thread Karl Ove Hufthammer
On Tue, 24 Nov 2009 10:14:18 -0500 Sarah Goslee wrote: > x <- runif(45) # make a test vector > length(x) # position of the last element > x[length(x)] # value of the last element For the last one, this should be even better: tail(x, 1) But, actually benchmarking this, it turns out

Re: [R] Method

2009-11-24 Thread Johannes Graumann
myVector <- c(seq(10),23,35) length(myVector) myVector[length(myVector)] it's unclear to me which of the two you want ... HTH, Joh yonosoyelmejor wrote: > > Hello, i would like to ask you another question. Is exist anymethod to > vectors that tells me the last element?That is to say,I have a v

[R] convex hull for cluster analysis

2009-11-24 Thread james.foadi
Dear R gurus and users, I seem to have problem finding the right tool for plotting convex hulls over 2D plots, after a cluster analysis. In fact I would like to draw a convex hull in 2D for a generic group of points. I found a "convhulln", but this doesn't seem to give me a convex hull. Here is wh

Re: [R] Re adline()

2009-11-24 Thread joris meys
I can't reproduce the error you have. With me, it runs all fine. In fact, readline apparently flushes automatically, as I didn't have to use the flush.console() at all. test.r --- cat("1- 24horas\n") cat("2- 12horas\n") cat("3- 8horas\n") selection<-readline(prompt="\nSelecciona numero de h

Re: [R] Excel-Export

2009-11-24 Thread Kevin Wright
If had done a little searching before posting, you surely would have found this link https://stat.ethz.ch/pipermail/r-help/2008-July/169149.html which describes how to create .xls files that are customized any way that you desire. Kevin Wright On Mon, Nov 23, 2009 at 7:02 AM, koj wrote: > > De

Re: [R] Labels in horizontal dendrogram not placed correctly?

2009-11-24 Thread joris meys
Thx Chris, extending the margins worked like a charm. It would be nice though if the plot function would take the length of the labels into account as well, but I guess I'm just being too much of a spoiled kid here ;-) Cheers Joris On Thu, Nov 19, 2009 at 6:46 AM, Chris Campbell wrote: > On Mon,

Re: [R] convex hull for cluster analysis

2009-11-24 Thread Henrique Dallazuanna
Try this: plot(Y) polygon(Y[chull(Y),]) On Tue, Nov 24, 2009 at 1:58 PM, wrote: > Dear R gurus and users, > I seem to have problem finding the right tool for plotting convex hulls over > 2D plots, after a cluster analysis. In fact I would like to draw a convex hull > in 2D for a generic group

Re: [R] Loess Fit

2009-11-24 Thread Greg Snow
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Karl Ove Hufthammer > Sent: Tuesday, November 24, 2009 1:11 AM > To: r-h...@stat.math.ethz.ch > Subject: Re: [R] Loess Fit > > On Mon, 23 Nov 2009 14:03:11 -0700 Greg Snow > wr

Re: [R] convex hull for cluster analysis

2009-11-24 Thread james.foadi
-Original Message- From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: Tue 24/11/2009 16:10 To: Foadi, James (Imperial Coll.,RAL,DIA) Cc: r-help@r-project.org Subject: Re: [R] convex hull for cluster analysis Try this: plot(Y) polygon(Y[chull(Y),]) Yes! Lovely! Thanks. J D

Re: [R] Translation from R codes to SAS.

2009-11-24 Thread Greg Snow
You should really learn at least basic SAS yourself. Don't abandon R, but if you use R only because it is the only program you know, then you are making an uninformed decision. If you learn SAS and still prefer R (I do) then it is an informed decision and much better. And your teachers are no

[R] Encoding problems.

2009-11-24 Thread Gérald Jean
Hello, I use: R version 2.9.2 (2009-08-24) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 on Ubuntu 9.10, I usually run R from ESS (5.4 on current Unbuntu) from Emacs-22.2.1. But I also tried the following from the console and it gave the same results. I have

Re: [R] Understanding hclust and dendrogram

2009-11-24 Thread Peng Yu
On Thu, Oct 15, 2009 at 4:11 AM, Fearghas MacGregor wrote: > I'd recommend "The Elements of Statistical Learning" by Hastie, Tibshirani, > and Friedman. There's a lot of good information on clustering, as well as a > wealth of info on many other apsects of classification, machine learning, > etc.

[R] Split column

2009-11-24 Thread Lisaj
Hello, R users, I have a dataset that looks like this: id var1 var2 1 1 3 2 3 1 3 2 1 4 1 2 5 2 3 I want to split one column to two columns with 1 = 1 and 1, 2 = 1 and 2, 3 = 2 and 2: id var1.1 var1.2 var2.1 va

[R] Graphic Device - View/get all graphics

2009-11-24 Thread MarcioRibeiro
Hi Listers, I am producing some graphics that the commands are in a FUNCTION... The problem is that I end up viewing just last graphic and in my FUNCTION there are 4 graphics with the PAR command function... Like those below... How do I view/get the other 3 graphics? Any help? Thanks in advance...

[R] Convert Time Variable to Numeric

2009-11-24 Thread RanjanV
Hello Everyone I am new to R I would like to know how to deal with Time Variable. If I have a column of containing Time data in the format of hh:mm:ss such as 00:56:45, 01:24:36, 01:41:25, and so on.. I could find averages for this column using the Chron package. But now I need to plot a gr

Re: [R] From R to LaTeX to pdf?

2009-11-24 Thread Tom Backer Johnsen
I am sure you are right. I myself have not looked at the LaTeX function in Hmisc, that really sounds interesting, and thank you. On the other hand I had the impression (which may be wrong) that the original question was posed by someone with not too much experience. If that is the case the s

Re: [R] Encoding problems.

2009-11-24 Thread Peter Dalgaard
Gérald Jean wrote: > Hello, > > I use: > > R version 2.9.2 (2009-08-24) > Copyright (C) 2009 The R Foundation for Statistical Computing > ISBN 3-900051-07-0 > > on Ubuntu 9.10, I usually run R from ESS (5.4 on current Unbuntu) from > Emacs-22.2.1. But I also tried the following from the console

Re: [R] Help: Beanplots calculating wrong average

2009-11-24 Thread Tom Wainwright
Hi Michael, Looking at the help for beanplot(), note that the 'log' option defaults to 'auto' which means the function will automatically log-transform data like yours. This also implies that the mean it shows is the geometric mean, not the arithmetic mean. As you note, the transformation do

Re: [R] Grouped Boxplot

2009-11-24 Thread David Winsemius
Back in March Soren Vogel asked exactly the same thing: Here is the solution that was offered then. (He offered a dataset as requested in the Posting Guide.) ... with only a minor adjustment: g <- rep.int(c("A", "B", "C", "D"), 125) t <- rnorm(5000) a <- sample(t, 500, replace=TRUE) b <- sam

Re: [R] From R to LaTeX to pdf?

2009-11-24 Thread cryan
Doesn't the APA package in LaTeX help in this situation? --Chris Ryan Original message >Date: Tue, 24 Nov 2009 18:24:52 +0100 >From: Tom Backer Johnsen >Subject: Re: [R] From R to LaTeX to pdf? >To: Erik Iverson >Cc: "r-help@r-project.org" , Joel Fürstenberg-Hägg > > >I am sure y

Re: [R] From R to LaTeX to pdf?

2009-11-24 Thread Frank E Harrell Jr
Tom Backer Johnsen wrote: As a general observation, few, if any, statistical packages, generate tables in the format what you might think you need or want. R is not an exception. Then it is better to transfer the table to a spreadsheet, shift things around, add headers, etc.. The R2HTML libr

Re: [R] Split column

2009-11-24 Thread Henrique Dallazuanna
Try this: cbind(x$id, t(do.call(rbind, lapply(x[-1], sapply, switch, '1' = c(1,1), '2' = c(1, 2), '3' = c(2, 2) On Tue, Nov 24, 2009 at 1:51 PM, Lisaj wrote: > > Hello, R users, > > I have a dataset that looks like this: > > id   var1   var2 >  1      1      3 >  2      3      1 >  3      2

Re: [R] Graphic Device - View/get all graphics

2009-11-24 Thread David Winsemius
On Nov 24, 2009, at 11:52 AM, MarcioRibeiro wrote: Hi Listers, I am producing some graphics that the commands are in a FUNCTION... The problem is that I end up viewing just last graphic and in my FUNCTION there are 4 graphics with the PAR command function... Like those below... How do I v

Re: [R] Split column

2009-11-24 Thread Adaikalavan Ramasamy
Not very elegant but this does the trick: df <- cbind( var1=c(1,3,2,1,2), var2=c(3,1,1,2,3) ) out <- df out[ which(df==1, arr.ind=T) ] <- "1&1" out[ which(df==2, arr.ind=T) ] <- "1&2" out[ which(df==3, arr.ind=T) ] <- "2&2" outlist <- apply(out, 2, strsplit, split="&") do.call( "cbind.data.fram

[R] Tests in Anova

2009-11-24 Thread Silvano
Hi, how can I make tests like Dunnett and Duncan using R? Thanks, -- Silvano Cesar da Costa Departamento de Estatística Universidade Estadual de Londrina Fone: 3371-4346 __ R-help@r-project.org mailing list https:/

Re: [R] Tests in Anova

2009-11-24 Thread Sarah Goslee
www.rseek.org is great for finding functions/packages that perform specific tests. Sarah On Tue, Nov 24, 2009 at 1:09 PM, Silvano wrote: > Hi, > > how can I make tests like Dunnett and Duncan using R? > > Thanks, > -- Sarah Goslee http://www.functionaldiversity.org __

[R] reshaping data

2009-11-24 Thread Joseph Magagnoli
Hi all, I have a dataframe that has one observation per case. for example: CaseStartyear Endyear A 1979 1989 B 1950 1955 I would like to create a dataframe in which each case has multiple observations corresponding to the start and end

Re: [R] Graphic Device - View/get all graphics

2009-11-24 Thread Greg Snow
There are multiple ways, some are OS specific (and I don't see where you told us that). Some things to try: par(ask=TRUE) # or pdf('tempfile.pdf') yourfunctionhere() dev.off() # or par(mfrow=c(2,2)) # or Windows(record=TRUE) # or Look at the help for the function creating the plots, som

Re: [R] reshaping data

2009-11-24 Thread Henrique Dallazuanna
Try this; with(x, data.frame(Case = rep(Case, (Endyear - Startyear) + 1), Year = unlist(mapply(seq, Startyear, Endyear On Tue, Nov 24, 2009 at 4:14 PM, Joseph Magagnoli wrote: > Hi all, > I have a dataframe that has one observation per case. > for example: > > Case

Re: [R] Split column

2009-11-24 Thread David Winsemius
On Nov 24, 2009, at 12:53 PM, Adaikalavan wrote: Not very elegant but this does the trick: df <- cbind( var1=c(1,3,2,1,2), var2=c(3,1,1,2,3) ) df <- data.frame(id=1:5, df) data.frame(id=df$id, var1.1 = (df$var1<3) + 2*(df$var1==3), # 1 for < 3; 2 for 3 var1.2 = (d

Re: [R] Excel-Export

2009-11-24 Thread Hans-Peter Suter
2009/11/24 Kevin Wright : > If had done a little searching before posting, you surely would have found > this link > https://stat.ethz.ch/pipermail/r-help/2008-July/169149.html > which describes how to create .xls files that are customized any way that > you desire. Manually convert to html, then

[R] predict: remove columns with new levels automatically

2009-11-24 Thread Andreas Wittmann
Dear R-users, in the follwing thread http://tolstoy.newcastle.edu.au/R/help/03b/3322.html the problem how to remove rows for predict that contain levels which are not in the model. now i try to do this the other way round and want to remove columns (variables) in the model which will be lat

Re: [R] NAs introduced by coercion warning?

2009-11-24 Thread Don MacQueen
In my experience, it is generally due to something like this example: as.numeric(c('1','b','2')) [1] 1 NA 2 Warning message: NAs introduced by coercion There may be other operations that generate that error, I can't say for sure. But the above example illustrates what I look for when I

Re: [R] Convert Time Variable to Numeric

2009-11-24 Thread Don MacQueen
Perhaps something like: as.numeric(chron(times.=c('01:23:21','11:12:13'))) [1] 0.05788194 0.46681713 -Don At 7:02 AM -0800 11/24/09, RanjanV wrote: Hello Everyone I am new to R I would like to know how to deal with Time Variable. If I have a column of containing Time data in the format of

[R] Subscript out of bounds

2009-11-24 Thread tobiasfa
Hi! Trying to make a forecast, and get the following error message: Error in NextMethod("[<-") : subscript out of bounds The script is as follows: > Forecast.A <- ts(matrix(NA, nrow=25, ncol = 1, + dimnames = list(c(), c("Outcome"))), + start = c(2006, 10), frequency = 12) > for (i in 1:25) {

[R] How to interpret the name of an object literally?

2009-11-24 Thread novocaine
Hi, I can't seem to figure out how to tell R to stop expanding an object. I would like to use the literal name rather than the expanded value. The issue occurs in a function I've been writing. The problematic part looks like this: # "fund" is a matrix of open, high, low, close, and volume pr

Re: [R] Re adline()

2009-11-24 Thread yonosoyelmejor
Sure,but my problem is that the script is run from the console windows,therefore I believe that the cat or readline doesn´t work... JorisMeys wrote: > > I can't reproduce the error you have. With me, it runs all fine. In > fact, readline apparently flushes automatically, as I didn't have to > us

Re: [R] Method

2009-11-24 Thread yonosoyelmejor
I use length(myVector),but when i want to use for example exp(x.reconstruida[length(myVector)+1:length(myVector)+9]), I need that function returns the number of last element,would then: if the last position of my vector is 1440 exp(x.reconstruida[1440+1:1440+9] This is what I need, I hope havin

[R] How to identify the rows in my dataframe with a negative value in any column?

2009-11-24 Thread Mark Na
Dear R-helpers, I have a dataframe that should not contain any negative values, but it does. I wish to print the rows from my dataframe that contain a negative value in any column. I've tried this: > dataframe[dataframe<0,] but it just returns a row of NAs. I would very much appreciate any help

Re: [R] How to identify the rows in my dataframe with a negative value in any column?

2009-11-24 Thread Henrique Dallazuanna
Try this: DF[rowSums(DF < 0) == 0,] On Tue, Nov 24, 2009 at 5:58 PM, Mark Na wrote: > Dear R-helpers, > > I have a dataframe that should not contain any negative values, but it does. > I wish to print the rows from my dataframe that contain a negative value in > any column. I've tried this: > >>

Re: [R] How to identify the rows in my dataframe with a negative value in any column?

2009-11-24 Thread Steve Lianoglou
Hi, On Nov 24, 2009, at 2:58 PM, Mark Na wrote: > Dear R-helpers, > > I have a dataframe that should not contain any negative values, but it does. > I wish to print the rows from my dataframe that contain a negative value in > any column. I've tried this: > >> dataframe[dataframe<0,] > > but i

Re: [R] How to interpret the name of an object literally?

2009-11-24 Thread Duncan Murdoch
On 11/24/2009 1:13 PM, novocaine wrote: Hi, I can't seem to figure out how to tell R to stop expanding an object. I would like to use the literal name rather than the expanded value. The issue occurs in a function I've been writing. The problematic part looks like this: # "fund" is a matr

Re: [R] Method

2009-11-24 Thread Sarah Goslee
If the last position of your vector is 1440, what do you expect to get from 1440 + 1??? And you certainly need some parentheses in there if you expect to get a range of values from your vector. Perhaps you need some subtraction? And no, we still can't tell exactly what you want. If this doesn't a

Re: [R] how to change the class of a group of objects

2009-11-24 Thread Ben Mazzotta
Erik and others, Many thanks for your assistance. Erik correctly points out that the as.dist() coercion requires a different format than I was using. The correct format for input to as.dist() is a square matrix, not a lower triangle matrix. Once I had that in order, everything went much better. I

Re: [R] random effects correlation in lmer

2009-11-24 Thread Daniel Malter
It implies that the random intercept is perfectly collinear with the random slope, as you suggested. I attach an example. The data generating process of y1 has a random intercept, but no random slope. When you fit a model with random intercept and random slope, the correlation between the two is

Re: [R] How to identify the rows in my dataframe with a negative value in any column?

2009-11-24 Thread Mark Na
Thanks Steve, this works very well! Mark On Tue, Nov 24, 2009 at 2:07 PM, Steve Lianoglou < mailinglist.honey...@gmail.com> wrote: > Hi, > > On Nov 24, 2009, at 2:58 PM, Mark Na wrote: > > > Dear R-helpers, > > > > I have a dataframe that should not contain any negative values, but it > does.

Re: [R] Method

2009-11-24 Thread David Winsemius
On Nov 24, 2009, at 1:44 PM, yonosoyelmejor wrote: I use length(myVector),but when i want to use for example exp(x.reconstruida[length(myVector)+1:length(myVector)+9]), I need that function returns the number of last element,would then: if the last position of my vector is 1440 exp(x.reco

[R] linear regression on groups of consecutive rows of a matrix

2009-11-24 Thread Jim Bouldin
I want to perform linear regression on groups of consecutive rows--say 5 to 10 such--of two matrices. There are many such potential groups because the matrices have thousands of rows. The matrices are both of the form: > shp[1:5,16:20] SL495B SL004C SL005C SL005A SL017A -2649 1.06 0.56

Re: [R] How to identify the rows in my dataframe with a negative value in any column?

2009-11-24 Thread David Winsemius
On Nov 24, 2009, at 3:04 PM, Henrique Dallazuanna wrote: Try this: DF[rowSums(DF < 0) == 0,] ITYM: > DF <- data.frame(a=1:10, b=c(1:3,-4, 5:10), c=c(-1, 2:10)) > > DF[rowSums(DF < 0) > 0,] a b c 1 1 1 -1 4 4 -4 4 -- David On Tue, Nov 24, 2009 at 5:58 PM, Mark Na wrote: Dear R

Re: [R] linear regression on groups of consecutive rows of a matrix

2009-11-24 Thread David Winsemius
Perhaps along these lines: 1st #need to decide what your group width is , so the second number inside the extraction call will be that number minus 1: for (x in seq(1:1000, by=6) { temp <- na,omit( shp[x:(x+5), ] ) # Need the parens in x:(x+5) lm( formula, data=temp) } Or dependi

[R] predict from glmer

2009-11-24 Thread sj
Hi all, Windows XP R 2.10.0 I am trying to generate predictions from a binomial mixed model using glmer. the models is as follows: mod.PN <- glmer(PN_out~ as.factor(intr3) + transcode + Yr + (Yr|ID) family=binomial,data=partset, na.action=na.omit) where PN_out is a two column binomial variable

Re: [R] linear regression on groups of consecutive rows of a matrix

2009-11-24 Thread Jim Bouldin
> But I do feel compelled to ask: Do you really get meaningful > information from lm applied to 5 cases? Especially when the predictors > used may not be the same from subset to subset??? Thanks again for your help David. Your question is a good one. It's a bit complicated but here's the bas

[R] anova() method for coxph objects with robust standard errors

2009-11-24 Thread Terry Therneau
> what is the reason why the anova() method for coxph objects does not work when robust standard errors have been requested, e.g., A robust variance estimate is normally used in situations where the model may be mis-specified, e.g., multiple events per subject. In this case a comparison of partia

Re: [R] Method

2009-11-24 Thread William Dunlap
Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius > Sent: Tuesday, November 24, 2009 12:22 PM > To: yonosoyelmejor > Cc: r-help@r-project.org > Subject: Re: [R] Method > > > On Nov 24, 2009, at 1:44 PM, yonosoyelmejor wrote: >

Re: [R] Split column

2009-11-24 Thread Lisaj
Thank you for your help. But how to change the column names to var1.1, var1.2, var2.1, and var2.2? Lisa Henrique Dallazuanna wrote: > > Try this: > > cbind(x$id, t(do.call(rbind, lapply(x[-1], sapply, switch, '1' = > c(1,1), '2' = c(1, 2), '3' = c(2, 2) > > On Tue, Nov 24, 2009 at 1:51

Re: [R] Graphic Device - View/get all graphics

2009-11-24 Thread Don MacQueen
You might try putting readline('CR to continue') between the two sets of plot commands. -Don At 8:52 AM -0800 11/24/09, MarcioRibeiro wrote: Hi Listers, I am producing some graphics that the commands are in a FUNCTION... The problem is that I end up viewing just last graphic and in my FUNC

[R] Anova and covariable

2009-11-24 Thread john polo
Dear R users, i want to use ANOVA with a small data set, here is an example of the data: Rich FireDe TimeS Area 8 2 4 C 92.5 7 C 51.9 2 C 7 3 4 C 82.5 0 L 2 4 3 L 9

  1   2   >