[R] Odp: Creating a data.frame

2008-02-17 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 13.02.2008 23:17:32: > OK...newbie question here. > Either I'm reading the docs wrong, or I'm totally confused. > > Given the following: > > x<-c("aaa","bbb","ccc") > y<-rep(0,3) > z<-rep(0,3) > > is.character(x) > [1] TRUE > > is.numeric(y) > [1] TRUE > > Now

[R] fitted.values from zeroinfl (pscl package)

2008-02-17 Thread Sarah J Thomas
Hello all: I have a question regarding the fitted.values returned from the zeroinfl() function. The values seem to be nearly identical to those fitted.values returned by the ordinary glm(). Why is this, shouldn't they be more "zero-inflated"? I construct a zero-inflated series of counts, calle

Re: [R] How to make a vector/list/array of POSIXlt object?

2008-02-17 Thread Gabor Grothendieck
If the problem is that you have a vector of dates, a vector of times and a vector of data and you want to create a data frame with one POSIXct column and one column of data then try this: dd <- c("01/22/2008", "02/13/2008") tt <- c("01:01:00", "23:01:12") dat <- 1:2 data.frame(dt = strptime(paste

Re: [R] How to make a vector/list/array of POSIXlt object?

2008-02-17 Thread Bo Zhou
Hi Gabor, I'm using this code but it doesn't work for me > strptime2<-function (date,time) as.POSIXct(strptime(paste(date,time), > "%m/%d/%Y %H:%M:%S")) > dt=mapply(strptime2, "01/01/2008", "00:00:00", SIMPLIFY=FALSE, > USE.NAMES=FALSE) > df=data.frame(X1=dt,X2=1) > dt [[1]] [1] "2008-01-01 Ea

Re: [R] Custom Plot - means, SD & 5th-95th% (Plotmeans or Boxplot)

2008-02-17 Thread Gabor Grothendieck
Using builtin dataset stackloss try this: f <- function(x) replace(quantile(x, c(5, 25, 50, 75, 95)/100), 3, mean(x)) bxp(list(stats = sapply(stackloss, f), n = stackloss, names = names(stackloss))) and see ?bxp and ?boxplot On Feb 17, 2008 9:17 PM, Stropharia <[EMAIL PROTECTED]> wrote: > > Any

Re: [R] Custom Plot - means, SD & 5th-95th% (Plotmeans or Boxplot)

2008-02-17 Thread David Winsemius
[EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: > It's fairly simple to set up something like this for ggplot2: > > install.packages("ggplot2") > library(ggplot2) > > library(ggplot2) > > q5 <- function(data) { > q <- function(p) unname(quantile(data$y, p)) > data.frame(min = q(0.05), max

Re: [R] Custom Plot - means, SD & 5th-95th% (Plotmeans or Boxplot)

2008-02-17 Thread h . wickham
It's fairly simple to set up something like this for ggplot2: install.packages("ggplot2") library(ggplot2) library(ggplot2) q5 <- function(data) { q <- function(p) unname(quantile(data$y, p)) data.frame(min = q(0.05), max = q(0.95)) } ggplot(diamonds, aes(x = cut, y = price)) + stat_summary(f

[R] Custom Plot - means, SD & 5th-95th% (Plotmeans or Boxplot)?

2008-02-17 Thread Stropharia
Any help with this problem would be greatly appreciated: I need to produce a custom plot i haven't come across in R. Basically, I want to show means, 1st standard deviation and 5th and 95th percentiles visually, using something resembling a boxplot. Is it possible to completely customize a boxplo

Re: [R] compiling 2.6.2 using icc

2008-02-17 Thread Denham Robert
Just in case others make my mistake, the problem was that I had a .R directory in my home directory, which had a Makevars file in it with CC=gcc. I don't remember why I had this, but it was being read for package building and throwing everything out. Robert -Original Message- From:

[R] ASA Southern California Chapter Applied Statistics Workshop

2008-02-17 Thread Madeline Bauer
The Southern California Chapter of the American Statistical Association invites you to attend the 27th annual Applied Statistics Workshop on Friday March 28, 2008 in The Pointe at the Pyramid at California State University, Long Beach. The topic is "The Vital Importance of Adjusting for Patien

[R] difference between lme and lmer in df calculation

2008-02-17 Thread Jarrett Byrnes
Hello all. I'm currently working with mixed models, and have noticed a curious difference between the nlme and lmer packages. While I realize that model selection with mixed models is a tricky issue, the two packages currently produce different AIC scores for the same model, but they syst

Re: [R] Weird SEs with effect()

2008-02-17 Thread John Fox
Dear Gustaf, > -Original Message- > From: Gustaf Granath [mailto:[EMAIL PROTECTED] > Sent: February-17-08 4:18 PM > To: John Fox > Cc: 'Prof Brian Ripley'; r-help@r-project.org > Subject: RE: [R] Weird SEs with effect() > > Dear John and Brian, > Thank you for your help. I get the feeling

Re: [R] extracting elements by using logical values

2008-02-17 Thread Henrique Dallazuanna
Try this: overlapped<-function(x,y) { z<-rbind(x,y) overlap <- vector() for(i in 1:nrow(z)){ overlap<-c(overlap, (z[i,1]<=z[,2]&z[i,2]>=z[,1])[-i]) } return(z[overlap,]) } On 17/02/2008, mohamed nur anisah <[EMAIL PROTECTED]> wrote: > dear lists, > > My question is quite simple but i'm

Re: [R] ggplot2: bug in geom_ribbon + log scale!?

2008-02-17 Thread Martin Rittner
'works nicely with loging the values. Thank you very much! Keep on the great work, the more I use ggplot2, the more I love it! Greetings, Martin [EMAIL PROTECTED] wrote: > Yes, that's a bug in the current version (fixed in the development > version) - the problem is that the min and max aesthet

[R] extracting elements by using logical values

2008-02-17 Thread mohamed nur anisah
dear lists, My question is quite simple but i'm a new user in R and it's seem tough to me. How am i going to recall back my values??ok..it could be easy if i ilustrate my problem with the simple example. say that, x [1] 1 2 y [1] 2 3 and my logical output fro

Re: [R] Weird SEs with effect()

2008-02-17 Thread Gustaf Granath
Dear John and Brian, Thank you for your help. I get the feeling that it is something fundamental that I do not understand here. Furthermore, a day of reading did not really help so maybe we have reached a dead end here. Nevertheless, here comes one last try. I thought that the values produce

Re: [R] How to make a vector/list/array of POSIXlt object?

2008-02-17 Thread Gabor Grothendieck
Normally one uses POSIXct rather than POSIXlt for storage. See R News 4/1 for more info on date and time classes. On Feb 17, 2008 3:45 PM, Bo Zhou <[EMAIL PROTECTED]> wrote: > > Hi Guys, > > I'm cooking up my time series code. I want a data frame with first column as > timestamp in POSIXlt forma

[R] How to make a vector/list/array of POSIXlt object?

2008-02-17 Thread Bo Zhou
Hi Guys, I'm cooking up my time series code. I want a data frame with first column as timestamp in POSIXlt format. I hit on this the problem of how to create an array/list/vector of POSIXlt objects. Code is as follows > dtt=array(dim = 2) > t=as.POSIXlt( strptime("07/12/07 13:20:01", "%m/%d

[R] How to create an array/list/vector of POSIXlt objects?

2008-02-17 Thread bo
Hi Guys, I'm cooking up my own time series code. I'm creating a data frame with first column as timestamp in POSIXlt format. I'm hit on problems like this > dtt=array(dim = 2) > t=as.POSIXlt( strptime("07/12/07 13:20:01", "%m/%d/%Y %H:%M:%S",tz="GMT")) > dtt [1] NA NA > t [1] "0007-07-12 13:20:0

[R] ggplot2: bug in geom_ribbon + log scale!?

2008-02-17 Thread Martin Rittner
Hi everyone, Hadley, it seems there's a bug in geom_ribbon() when using it in a log-scaled plot: d<-data.frame(x=c(1:20),y1=rnorm(20)+3,y2=rnorm(20)+5) p<-ggplot() p<-p+geom_ribbon(data=d,aes(x=d[["x"]],min=d[["y1"]],max=d[["y2"]])) p<-p+geom_line(data=d,aes(x=d[["x"]],y=d[["y1"]]),colour="blue")

Re: [R] random location in polygons sp spsample splancs csr

2008-02-17 Thread Patrick Giraudoux
Thanks for those detailed explanation and the time taken to write them. > The spsample methods for polygons have an iter= argument that can be > used to make then "try harder", did you try it (with what values - the > help page senctence you quote is from the iter= description)? Yes sure, I went

Re: [R] Set length of axes in lattice

2008-02-17 Thread Saptarshi Guha
Thank you. On Feb 17, 2008, at 1:18 PM, Deepayan Sarkar wrote: > See ?print.trellis. > > p <- xyplot(1 ~ 1, aspect = 0.5) > p > plot(p, panel.width = list(2, "inches"), panel.height = list(1, > "inches")) > > This overrides 'aspect=' though, that is, you will need to specify > both width and heig

Re: [R] Set length of axes in lattice

2008-02-17 Thread Deepayan Sarkar
On 2/17/08, Saptarshi Guha <[EMAIL PROTECTED]> wrote: > Hello, > It is possible to set the aspect ratio of the Y-axis to the X-axis > in xyplot > (a) xyplot(y~x,aspect=1.8) > Suppose I have only 1 panel and i wish to set the length of the X- > axis to 2" keeping the sam

Re: [R] Transfer Crosstable to Word-Document

2008-02-17 Thread Udo König
Zitat von Greg Snow <[EMAIL PROTECTED]>: > If your final goal is a word document, then you should look at the odfWeave > package. Greg, I had a look at the odfWeave package, but it seems that complex tables, for instance produced with latex() can´t be produced/included, as can be done with sw

Re: [R] random location in polygons sp spsample splancs csr

2008-02-17 Thread Roger Bivand
On Sun, 17 Feb 2008, Patrick Giraudoux wrote: > Dear all, > > I had to place points at random, one in each of larger number of polygons > (actually in objects of class 'SpatialPolygonsDataFrame' , see sp library), > and tried first to do it using spsample (from sp). Surprisingly, every 5-15 >

Re: [R] R on a computer cluster

2008-02-17 Thread Jay Emerson
Gabriele, In addition to the suggestions from Markus (below), there is NetWorkSpaces (package nws). I have used both nws and snow together with a package I'm developing (bigmemoRy) which allocates matrices to shared memory (helping avoid the bottleneck Markus alluded to for processors on the same

Re: [R] History of R

2008-02-17 Thread John C Frain
The windows port of R has been very good for a long time. I know some people who even think that the current windows port is better than the Linux version. Thanks to those who have made the windows port available and who continue to maintain it. I now use both MS Windows and Linux (Fedora) and wo

Re: [R] Transfer Crosstable to Word-Document

2008-02-17 Thread Duncan Temple Lang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 You can programmatically create content directly in Word from R including tables, lists, paragraphs, etc. via a DCOM connection where R is the client and Word is the server. There are two packages to do this - rcom and RDCOMClient and both allow you

Re: [R] How to use a reserved word in italics in an expression

2008-02-17 Thread Michael Kubovy
Delightfully straightforward! Thanks. On Feb 16, 2008, at 5:15 PM, Duncan Murdoch wrote: > On 16/02/2008 4:51 PM, Michael Kubovy wrote: >> Dear R-helpers, >> > label2 <- expression(paste(italic(attraction function:), 'slope')) >> Error: unexpected 'function' in "label2 <- >> expression(paste(i

[R] random location in polygons sp spsample splancs csr

2008-02-17 Thread Patrick Giraudoux
Dear all, I had to place points at random, one in each of larger number of polygons (actually in objects of class 'SpatialPolygonsDataFrame' , see sp library), and tried first to do it using spsample (from sp). Surprisingly, every 5-15 trials, the output was a NULL value. The doc says that '

Re: [R] Specify Path of an Excel file in R

2008-02-17 Thread Charles Annis, P.E.
One way that works for lazy people like me is to use file.choose(). 1) Type in "file.choose()" without the quotes and hit 2) Navigate to the folder and file that you want and click on it. 3) R will show you the complete path to your file. An even easier way is to do something like this: my.stuf

[R] Set length of axes in lattice

2008-02-17 Thread Saptarshi Guha
Hello, It is possible to set the aspect ratio of the Y-axis to the X-axis in xyplot (a) xyplot(y~x,aspect=1.8) Suppose I have only 1 panel and i wish to set the length of the X- axis to 2" keeping the same aspect ratio as in (a). I would also like to keep the same

Re: [R] Specify Path of an Excel file in R

2008-02-17 Thread My Coyne
Try: X<- read.csv ("") or Y<- read.delim("", sep=",", header=T) Example, if your file is in C-directory, file name is my_file, and the file has a header. X<- read.csv("c:\\my_file") or Y<- read.delim("c:\\my_file", sep=",", header=T) My D. Coyne -Original Message- From: [EMAIL PROTEC

[R] Set length of axes in lattice's xyplot?

2008-02-17 Thread Saptarshi Guha
Hello, It is possible to set the aspect ratio of the Y-axis to the X-axis in xyplot (a) xyplot(y~x,aspect=1.8) Suppose I have only 1 panel and i wish to set the length of the X- axis to 2" keeping the same aspect ratio as in (a), I suppose i need to do something in

[R] Specify Path of an Excel file in R

2008-02-17 Thread savanna3000
Hello Helpers, I have an Excel file on my desktop (.csv) which I want to use in my R worksheet, how can I specify the path while using read.csv() ? Savanna -- View this message in context: http://www.nabble.com/Specify-Path-of-an-Excel-file-in-R-tp15530586p15530586.html Sent from t

Re: [R] Producing graphs and console output in postscript format

2008-02-17 Thread John Kane
?postscript Perhaps sweave? http://www.stat.umn.edu/~charlie/Sweave/ --- John Sorkin <[EMAIL PROTECTED]> wrote: > R 2.6.1 > Windows XP > > I would like to make a postscript document that > contains my graphs and the output that I get from > the R console. So far, all I have been able to do is >

Re: [R] Re storing a UPDATES on a data.frame

2008-02-17 Thread savanna3000
Thank you Prof Brian, this really solved my problem and it was well explained :) Prof Brian Ripley wrote: > > Well > > - MASS is a package and not a library > - it is not 'base' but 'contributed', and as library(help=MASS) says, > support software for a book. It is on CRAN. > - Packages wit

Re: [R] Weird SEs with effect()

2008-02-17 Thread John Fox
Dear Brian and Gustaf, I too have a bit of trouble following what Gustaf is doing, but I think that Brian's interpretation -- that Gustaf is trying to transform the standard errors via the inverse link rather than transforming the ends of the confidence intervals -- is probably correct. If this is

Re: [R] Transfer Crosstable to Word-Document

2008-02-17 Thread Gabor Grothendieck
On Feb 17, 2008 8:20 AM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > > On Feb 17, 2008 4:41 AM, Peter Dalgaard <[EMAIL PROTECTED]> wrote: > > > > Gabor Grothendieck wrote: > > > On Feb 16, 2008 5:28 PM, David Scott <[EMAIL PROTECTED]> wrote: > > > > > >> On Sat, 16 Feb 2008, Alan Zaslavsky wrot

Re: [R] filled.contour with log axis

2008-02-17 Thread Duncan Murdoch
On 16/02/2008 7:33 PM, Thomas Hoffmann wrote: > Dear all, > > I would like to generate a filled.contour plot with log x and y axis, > however using: > > filled.contour(as.line,log="xy") > > results in a warning message. > > > Does anybody knos what to do? You could transform your x and y val

Re: [R] Transfer Crosstable to Word-Document

2008-02-17 Thread Tobias Sing
On Feb 17, 2008 2:49 PM, Udo König <[EMAIL PROTECTED]> wrote: > [...] > Greg: > To the odfWeave package: in [2] I found the sentence "The package is currently > limited to creating text documents using OpenOffice". So it doesn´t seem work > with MS-Word? Udo, I think odfWeave is exactly what you

Re: [R] Error massage in attaching package 'rgl'

2008-02-17 Thread Duncan Murdoch
On 17/02/2008 8:56 AM, stat stat wrote: > I am using 2.6.0 version in usual Windows-XP platform The message indicates a damaged copy of something: either your decompression code, or rgl. I'd try re-downloading and installing rgl first, and if that doesn't work, reinstall R (and upgrade to the

Re: [R] filled.contour with log axis

2008-02-17 Thread David Winsemius
Thomas Hoffmann <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Dear all, > > I would like to generate a filled.contour plot with log x and y > axis, however using: > > filled.contour(as.line,log="xy") > > results in a warning message. > > > Does anybody knos what to do? Use a functi

Re: [R] Error massage in attaching package 'rgl'

2008-02-17 Thread stat stat
I am using 2.6.0 version in usual Windows-XP platform Duncan Murdoch <[EMAIL PROTECTED]> wrote: On 17/02/2008 8:15 AM, stat stat wrote: > Hi, > > I am getting following error message while attaching 'rgl' package : > >> library(rgl) > Error in get(Info[i, 1], envir = env) : internal error in R_

Re: [R] Error massage in attaching package 'rgl'

2008-02-17 Thread Duncan Murdoch
On 17/02/2008 8:15 AM, stat stat wrote: > Hi, > > I am getting following error message while attaching 'rgl' package : > >> library(rgl) > Error in get(Info[i, 1], envir = env) : internal error in R_decompress1 > > Can anyone tell me what should I do here? Not unless you give a proper error rep

Re: [R] Transfer Crosstable to Word-Document

2008-02-17 Thread Udo König
(2. attempt to post this) (Udo) Quoting Greg Snow <[EMAIL PROTECTED]>: > If your final goal is a word document, then you should look at the odfWeave > package. > At work my primary goal has to be a word document, because: * we have a Windows-XP network with MS-Office software * my bo

Re: [R] Transfer Crosstable to Word-Document

2008-02-17 Thread Gabor Grothendieck
On Feb 17, 2008 4:41 AM, Peter Dalgaard <[EMAIL PROTECTED]> wrote: > > Gabor Grothendieck wrote: > > On Feb 16, 2008 5:28 PM, David Scott <[EMAIL PROTECTED]> wrote: > > > >> On Sat, 16 Feb 2008, Alan Zaslavsky wrote: > >> > >> > >>> If you want to get nicely formatted tables in Word and are familia

[R] Producing graphs and console output in postscript format

2008-02-17 Thread John Sorkin
R 2.6.1 Windows XP I would like to make a postscript document that contains my graphs and the output that I get from the R console. So far, all I have been able to do is produce my graphs in postscript form. I do this in a sub-optimal manner by MANUALLY saving each graph in postscript form. I h

[R] Error massage in attaching package 'rgl'

2008-02-17 Thread stat stat
Hi, I am getting following error message while attaching 'rgl' package : > library(rgl) Error in get(Info[i, 1], envir = env) : internal error in R_decompress1 Can anyone tell me what should I do here? Regards, - 5, 50, 500, 5000 - Store N number of mai

Re: [R] Weird SEs with effect()

2008-02-17 Thread Prof Brian Ripley
On Sun, 17 Feb 2008, Gustaf Granath wrote: > Hi John, > > In fact I am still a little bit confused because I had read the > ?effect help and the archives. > > ?effect says that the confidence intervals are on the linear predictor > scale as well. Using exp() on the untransformed confidence interva

Re: [R] how to specify the location of tick mark on x axies

2008-02-17 Thread Jim Lemon
Xin wrote: > Dear: > > I want to plot barplot and let bar be in the middle of each x axis > category. > >Do you have this experience? > Hi Xin, The "barp" function in the plotrix package centers the bars on integer values. This might make it a bit easier to do what you want. Jim __

[R] R Package Implementing Kohavi's Wrapper Method for Subset

2008-02-17 Thread Vu Nguyen
Hi List, I am looking for a R package that implements Kohavi & John's wrapper methods for feature subset selection. Do you know whether there is a such kind of R package? Ref: R. Kohavi and G. H. John, “Wrappers for feature subset selection,” Artificial Intelligence, vol. 97, no. 1-2, pp. 273

Re: [R] Transfer Crosstable to Word-Document

2008-02-17 Thread Peter Dalgaard
Gabor Grothendieck wrote: > On Feb 16, 2008 5:28 PM, David Scott <[EMAIL PROTECTED]> wrote: > >> On Sat, 16 Feb 2008, Alan Zaslavsky wrote: >> >> >>> If you want to get nicely formatted tables in Word and are familiar with >>> Office tools (I know it's the Evil Empire but some of us work th

Re: [R] Weird SEs with effect()

2008-02-17 Thread Gustaf Granath
Hi John, In fact I am still a little bit confused because I had read the ?effect help and the archives. ?effect says that the confidence intervals are on the linear predictor scale as well. Using exp() on the untransformed confidence intervals gives me the same values as summary(eff). My co