[R] combine words and dataframe

2009-04-08 Thread Ravi S. Shankar
Hi R, I am trying to get an output like this Hi Hello 1 a b 2 a b 3 a b 4 a b 5 a b And write it as a text file cat(paste("Hi",sep='\n',"Hello")) gives me Hi Hello And whe

[R] Multiple Hexbinplots in 2 columns with a Single Categorical Variable

2009-04-08 Thread Dr Stuart Reece
Dear Ladies and Gentlemen, I have a fairly large database (N=13,000) and a single main categorical discriminator between the groups. I want to look at the time course of a number of continuous biochemical variables over chronologic age. Therefore I believe I need to prepare hexbinplots

Re: [R] Anova interaction not tested

2009-04-08 Thread Gabriel Murray
Playing around with this some more, it looks like it may purely be due to the way that R handles unbalanced data. I will investigate lme for this. Best, Gabe On Wed, Apr 8, 2009 at 3:24 PM, Gabriel Murray wrote: > Here is some toy data to give an example. Imagine someone is test-riding > severa

Re: [R] Anova interaction not tested

2009-04-08 Thread Gabriel Murray
Here is some toy data to give an example. Imagine someone is test-riding several bicycles to decide which to buy, and measures their average speed during each test-ride. They want to assess the main effects and interaction of brand and material on speed. SpeedSizeBrandMaterial 20

Re: [R] R File I/O Capability - Writing output to specific lines of existing file

2009-04-08 Thread Jason Rupert
Darn. I was afraid of this. Always kind of weak when it comes to file I/O approaches, so I guess I will have to stretch and try to put something together. Yeah. The input flat text file is about 600 lines long. I will be replacing about 200. I already have the template for those 200 li

Re: [R] Help plotting image to window without margin

2009-04-08 Thread Kingsford Jones
See 'mar' under ?par e.g., x <- y <- -100:100 z <- outer(x, y, function(x,y) sqrt(x^2 + y^2)) par(mar=c(0,0,0,0)) image(x,y,z) hth, Kingsford Jones On Wed, Apr 8, 2009 at 9:07 PM, Bob Meglen wrote: > I am using several scripts that employ various packages to process images > generated from

[R] Help plotting image to window without margin

2009-04-08 Thread Bob Meglen
I am using several scripts that employ various packages to process images generated from multispectral data sets. I have used rimage and other packages to try to "plot" or "image" to place images in a window. I have not been able to find a way to suppress the margins that surround the image in t

[R] Help with biOps loading

2009-04-08 Thread Bob Meglen
I have tried several times to load biOps package after reading the posts in this archive regarding the necessity of placing these two libs in the PATH (libjpeg62.dll and libtiff3.dll). I have tried locating the libs in several directories that should have worked, but I still get the following m

Re: [R] MLE for bimodal distribution

2009-04-08 Thread Ravi Varadhan
Dear Ted, Thanks for your comments on the profilie-likelihood approach for ratio of sigmas. I would like to look at your R code and the note on Aitken acceleration. I would appreciate if you could share this with me. I am glad you nibbled at my "bait" on EM acceleration. This is one of my fa

Re: [R] R File I/O Capability - Writing output to specific lines of existing file

2009-04-08 Thread jim holtman
You can always read in the initialization file, make the updates to it and then write it back out. If it is a text file, it would be very hard to write into the middle of it since there is no structure to the file. You can read it in as a table (read.table) or just as lines (readLines) and the ma

Re: [R] Need help in calculating studentized residuals/leverage values of non-linear model [nls()]

2009-04-08 Thread Giam Xingli
Hi Dieter, Yes, I understand the definition of studentized residuals and I also know that studentizing the residuals is an easy exercise. However, I need the hat ('leverage')-values to studentize the residuals. I tried to use hatvalues() to obtain the leverage values but while it works on glm a

Re: [R] MLE for bimodal distribution

2009-04-08 Thread Ted Harding
On 08-Apr-09 22:10:26, Ravi Varadhan wrote: > EM algorithm is a better approach for maximum likelihood estimation > of finite-mixture models than direct maximization of the mixture > log-likelihood. Due to its ascent properties, it is guaranteed to > converge to a local maximum. By theoretical co

Re: [R] Doubt about aov and lm function... bug?

2009-04-08 Thread William Dunlap
I'm also suspicious of code using parse to construct expressions. However this problem arose because the terms class is a subclass of the formula class and AlgDesign defines a model.matrix method for the formula class but not for the terms class. Hence model.matrix(terms(...)) invokes model.mat

Re: [R] MLE for bimodal distribution

2009-04-08 Thread Ravi Varadhan
EM algorithm is a better approach for maximum likelihood estimation of finite-mixture models than direct maximization of the mixture log-likelihood. Due to its ascent properties, it is guaranteed to converge to a local maximum. By theoretical construction, it also automatically ensures that a

Re: [R] Minimum Spanning Tree

2009-04-08 Thread Gábor Csárdi
On Wed, Apr 8, 2009 at 10:20 PM, jpearl01 wrote: > > That's like a miracle!  The only thing that would make this graph perfect is > if the lengths of the edges were in the same ratio as the actual edge > lengths from the matrix.  Is it possible to alter that? Not really. The thing is that the nod

Re: [R] Doubt about aov and lm function... bug?

2009-04-08 Thread Peter Dalgaard
Jose Claudio Faria wrote: library(AlgDesign) aov(Sepal.Length ~ Species, data=iris) Error in parse(text = x) : unexpected symbol in "Sepal(Sepal.Length+Species)Length" I wonder it is really a small bug. Do you agree? Yes, in AlgDesign. I'm always suspicious of things involving parse()

Re: [R] Doubt about aov and lm function... bug?

2009-04-08 Thread Rolf Turner
On 9/04/2009, at 9:17 AM, Jose Claudio Faria wrote: Hi Peter and Rolf, Many thanks for all! The "bug" was just found: it is related with the package AlgDesign! (and I've been loading it from Rprofile.site already for a long long time). :-( I wonder it is really a small bug. Do

Re: [R] does grid.rect() not accept NULL argument from gpar(col=NULL) ?

2009-04-08 Thread Paul Murrell
Hi Mark Heckmann wrote: > I want to draw a grid rectangle without a border. > > ?gpar says: > > "Specifying the value NULL for a parameter is the same as not specifying any > value for that parameter, except for col and fill, where NULL indicates not > to draw a border or not to fill an area (r

Re: [R] Minimum Spanning Tree

2009-04-08 Thread jpearl01
That's like a miracle! The only thing that would make this graph perfect is if the lengths of the edges were in the same ratio as the actual edge lengths from the matrix. Is it possible to alter that? Thank you!! ~josh Actually, library(igraph) tab <- read.csv("http://www.nabble.com/file/p

Re: [R] Doubt about aov and lm function... bug?

2009-04-08 Thread Jose Claudio Faria
Hi Peter and Rolf, Many thanks for all! The "bug" was just found: it is related with the package AlgDesign! (and I've been loading it from Rprofile.site already for a long long time). :-( See below: R version 2.8.1 Patched (2009-01-22 r47680) Copyright (C) 2009 The R Foundation for Statistical

Re: [R] Doubt about aov and lm function... bug?

2009-04-08 Thread Peter Dalgaard
Jose Claudio Faria wrote: # a) aov av <- aov(Sepal.Length ~ Species, data=iris) Error in parse(text = x) : unexpected symbol in "Sepal(Sepal.Length+Species)Length" traceback() 13: parse(text = x) 12: eval(parse(text = x)[[1]]) 11: formula(eval(parse(text = x)[[1]])) 10: formula.character(

Re: [R] Doubt about aov and lm function... bug?

2009-04-08 Thread Jose Claudio Faria
# a) aov > av <- aov(Sepal.Length ~ Species, data=iris) Error in parse(text = x) : unexpected symbol in "Sepal(Sepal.Length+Species)Length" > traceback() 13: parse(text = x) 12: eval(parse(text = x)[[1]]) 11: formula(eval(parse(text = x)[[1]])) 10: formula.character(object, env = baseenv()) 9:

Re: [R] Doubt about aov and lm function... bug?

2009-04-08 Thread Peter Dalgaard
Rolf Turner wrote: There is no bug. Both of your examples work fine for me. Ditto You may have a corrupt version of ``iris'' somewhere in your search path before ``datasets''. What does find("iris") tell you? What does names("iris") tell you? Could also be something interfering with t

Re: [R] Doubt about aov and lm function... bug?

2009-04-08 Thread Jose Claudio Faria
I've been finding the same problem in all R versions I'm using after 2.6.0 (I think). > find("iris") [1] ".GlobalEnv" "package:datasets" It is really strange... -- ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\ Jose Claudio Faria Estatistica - prof. Titular UESC/DCET/Brasil joseclaudio.f

Re: [R] Anova interaction not tested

2009-04-08 Thread Patrick Connolly
On Wed, 08-Apr-2009 at 12:59PM -0700, Gabriel Murray wrote: |> I've noticed with certain datasets that when I try to do an anova and test |> for main effects and interaction for two explanatory variables, sometimes |> the main effect results are given but not the interaction results. For |> exampl

Re: [R] Doubt about aov and lm function... bug?

2009-04-08 Thread Rolf Turner
There is no bug. Both of your examples work fine for me. You may have a corrupt version of ``iris'' somewhere in your search path before ``datasets''. What does find("iris") tell you? What does names("iris") tell you? cheers, Rolf Turner On 9/04/2009, at 8:16 AM, Jo

Re: [R] MLE for bimodal distribution

2009-04-08 Thread Rubén Roa-Ureta
_nico_ wrote: Hello everyone, I'm trying to use mle from package stats4 to fit a bi/multi-modal distribution to some data, but I have some problems with it. Here's what I'm doing (for a bimodal distribution): # Build some fake binormally distributed data, the procedure fails also with real data

Re: [R] MLE for bimodal distribution

2009-04-08 Thread Ravi Varadhan
Ben, You can also do this nicely with the function spg() in the "BB" package set.seed(1001) data = c(rnorm(1000, 3, 0.5), rnorm(500, 5, 0.3)) f = function(m, s, m2, s2, w) { -sum(log(w*dnorm(data, mean=m, sd=s)+ (1-w)*dnorm(data, mean=m2, sd=s2))) } start0 <- list("m"=3, "s"=0.5,

Re: [R] Constrained, multiple response statistics

2009-04-08 Thread Jonathan Greenberg
Hmm, it LOOKS like mvpart may be along the lines of what I want, but is mvpart a nominal classification tree, or can it handle multiple, continuous response variables as well? --j Gene Leynes wrote: This sounds very similar to what I've been working on, but I'm not sure without an example.

[R] Doubt about aov and lm function... bug?

2009-04-08 Thread Jose Claudio Faria
Hi, The below very strange: # a) aov function av <- aov(Sepal.Length ~ Species, data=iris) # Error in parse(text = x) : # unexpected symbol in "Sepal(Sepal.Length+Species)Length" av <- aov(iris[, 1] ~ iris[, 5]) # summary(av) # Df Sum Sq Mean Sq F value Pr(>F) # iris[, 5]

Re: [R] MLE for bimodal distribution

2009-04-08 Thread _nico_
Ben Bolker wrote: > > > Here's some tweaked code that works. > [cut] > Thanks, that saved me a few headaches. I also find out the answer to my (dumb) question #5, which is obviously to call f with the returned parameters or use the logLik function. I will have a look at the mixture model p

Re: [R] MLE for bimodal distribution

2009-04-08 Thread Bert Gunter
The problem is that fitting mixtures models is hard -- (non)identifiability is a serious problem: very large sample sizes may be necessary to clearly distinguish the modes. As V&R say in MASS, 4th edition, p. 320: " ... fitting normal mixtures is a difficult problem, and the results obtained are of

Re: [R] xyplot - show values of a series on graph

2009-04-08 Thread alienz747
This is great, thanks a lot! On Wed, Apr 8, 2009 at 3:50 PM, baptiste auguie wrote: > not very clean, but perhaps, > > xyplot(cars+trucks~year, data=df2, type="o", > panel=function(x,y,subscripts,...){ >panel.xyplot(x,y,subscripts=subscripts,...) > > grid.text(unit(df2$year,"native"),u

Re: [R] xyplot - show values of a series on graph

2009-04-08 Thread alienz747
Thank you so much Deepayan! My problem is solved. On Wed, Apr 8, 2009 at 3:47 PM, Deepayan Sarkar wrote: > On Wed, Apr 8, 2009 at 12:25 PM, taz9 wrote: > > > > Thank you very much for your help. I tried to use lattice but I'm not > sure > > how to restrict it to display only the values of "cars"

[R] Anova interaction not tested

2009-04-08 Thread Gabriel Murray
I've noticed with certain datasets that when I try to do an anova and test for main effects and interaction for two explanatory variables, sometimes the main effect results are given but not the interaction results. For example, ex1 = aov(Score ~ var1*var2, data=myData) summary(ex1) gives me only

Re: [R] Display a very low p-value

2009-04-08 Thread hadley wickham
>  pnorm(37:39,lower.tail=FALSE) > [1] 5.725571e-300  0.00e+00  0.00e+00 > >  This is just a limitation of double precision floating-point arithmetic > ... > >  curve(pnorm(x,lower.tail=FALSE),from=30,to=40,log="y") > .Machine$double.xmin But note curve(pnorm(x,lower.tail=FALSE, log=T),fr

Re: [R] xyplot - show values of a series on graph

2009-04-08 Thread baptiste auguie
not very clean, but perhaps, xyplot(cars+trucks~year, data=df2, type="o", panel=function(x,y,subscripts,...){ panel.xyplot(x,y,subscripts=subscripts,...) grid .text(unit(df2$year,"native"),unit(df2$cars,"native"),label=df2$cars, just="top")} ) baptiste On 8 Apr 2009, at 20:2

Re: [R] Minimum Spanning Tree

2009-04-08 Thread Gábor Csárdi
Actually, library(igraph) tab <- read.csv("http://www.nabble.com/file/p22957493/sp_matrix.csv";) tab <- tab[,-1] g <- graph.adjacency(as.matrix(tab), weighted=TRUE) V(g)$label <- V(g)$name mst <- as.undirected(minimum.spanning.tree(g)) lay <- layout.reingold.tilford(mst, root=which.max(degree(

[R] Customize Legend in Juxtaposed Barplot

2009-04-08 Thread Paul Jones
Hello, I'm making barplots out of binary data, typically 0=no 1=yes, but in some instances I have 2=Don't Know. Anyway, when I create a juxtaposed barplot, what appears in the legend is 0,1,and 2. I want it to read No, Yes, Don't Know. I'm not sure how to do that. In addition to this, the

Re: [R] xyplot - show values of a series on graph

2009-04-08 Thread Deepayan Sarkar
On Wed, Apr 8, 2009 at 12:25 PM, taz9 wrote: > > Thank you very much for your help. I tried to use lattice but I'm not sure > how to restrict it to display only the values of "cars". > > xyplot(cars+trucks~year, data=df2, type="o", > panel=function(x,y,...){ >        panel.xyplot(x,y,...) >      

Re: [R] MLE for bimodal distribution

2009-04-08 Thread Ben Bolker
_nico_ wrote: > > Hello everyone, > > I'm trying to use mle from package stats4 to fit a bi/multi-modal > distribution to some data, but I have some problems with it. > Here's what I'm doing (for a bimodal distribution): > > # Build some fake binormally distributed data, the procedure fails a

[R] rhipe v0.1

2009-04-08 Thread Saptarshi Guha
Greetings, I would like to announce the 0.1 release of RHIPE:R and Hadoop Integrated Processing Environment. The website is located at : http://www.stat.purdue.edu/~sguha/rhipe. The download link is the bottom most link on left side of the page. RHIPE wo

Re: [R] Lattice Groups

2009-04-08 Thread Lyman, Mark
I guess I didn't look too closely. I didn't even notice the points were gone. Thanks, Deepayan. Mark Lyman -Original Message- From: Deepayan Sarkar [mailto:deepayan.sar...@gmail.com] Sent: Wednesday, April 08, 2009 1:07 PM To: Lyman, Mark Cc: r-help@r-project.org; dickywe...@hotmail.co

Re: [R] Display a very low p-value

2009-04-08 Thread Ben Bolker
Dimitris Rizopoulos-4 wrote: > > in this case you need to use the 'lower.tail' argument, e.g., > > pnorm(8:15, lower.tail = FALSE) > > > Bhoom Suktitipat wrote: >> Hello R-Help, >> >> I ran some analysis and were hit with some low Z-score. I tried to >> convert >> it to a p-value, however,

Re: [R] Minimum Spanning Tree

2009-04-08 Thread jpearl01
Make the graph undirected first and then choose the right plotting parameters. E.g. the following works fine for me: set.seed(2) g <- erdos.renyi.game(100, 300, type="gnm", directed=TRUE) E(g)$weight <- runif(ecount(g)) mst <- minimum.spanning.tree(g) mst <- simplify(as.undirected(mst)) lay <-

Re: [R] xyplot - show values of a series on graph

2009-04-08 Thread taz9
Thank you very much for your help. I tried to use lattice but I'm not sure how to restrict it to display only the values of "cars". xyplot(cars+trucks~year, data=df2, type="o", panel=function(x,y,...){ panel.xyplot(x,y,...) grid.text(unit(x,"native"),unit(y,"native"),label=y, just

Re: [R] predict "interval" for lmRob?

2009-04-08 Thread Galkowski, Jan
[snip] >Discarding actual data points always makes me nervous. Sometimes the points >we want to discard are actually the most interesting. No doubt this is true, and there's a lot of information in those outliers, a lot of structure. For instance, in this case, one part of the outlier popu

Re: [R] predict "interval" for lmRob?

2009-04-08 Thread Greg Snow
> -Original Message- > From: Galkowski, Jan [mailto:jgalk...@akamai.com] > Sent: Wednesday, April 08, 2009 12:28 PM > To: Greg Snow; r-help@r-project.org > Subject: RE: predict "interval" for lmRob? [snip] > It sounds to me like I might use the robust regression to decide what > to discar

[R] April R/Splus Courses: Back2back (1) R/S+ Fundamentals and (2) R/S-Plus Advanced Programming. in San Francisco and New York City

2009-04-08 Thread Sue Turner
By popular demand, XLSolutions has scheduled first back2back courses in New York City and San Francisco taught by top R/S+ gurus! This is a first in our 9 years of teaching R/Splus Courses. West Coast<---back2back---> East Coast (1) R/S-PLUS Fundamentals and Programming Techniques http:/

Re: [R] Lattice Groups

2009-04-08 Thread Deepayan Sarkar
On Wed, Apr 8, 2009 at 10:36 AM, Lyman, Mark wrote: > I don't understand your first question, but, since no one else has > responded I can answer your second question. panel.bwplot, unlike > panel.xyplot doesn't use panel.superpose when groups is not NULL. In > order to get an analogous result you

Re: [R] help with random forest package

2009-04-08 Thread Liaw, Andy
I'm not quite sure what you're asking. RF predicts by classifying the new observation using all trees in the forest, and take plural vote. The predict() method for randomForest objects does that for you. The getTree() function shows you what each individual tree is like (not visually, just the un

Re: [R] Tinn-R pdf()

2009-04-08 Thread Bert Gunter
I **think** the explanation is: When sending code to R through TINN-R, TINN-R **sources** the code into R. Sourced code is **not** autoprinted. Indeed, ?source explicitly tells you this. -- Bert Bert Gunter Genentech Nonclinical Biostatistics 650-467-7374 -Original Message- From: r-he

Re: [R] help with random forest package

2009-04-08 Thread Chrysanthi A.
Many thanks for the reply. So, extracting the votes, how can we clarify the classification result? If I want to predict in which class will be included an unknown sample, what is the rule that will give me that? Thanks a lot, Chrysanthi. 2009/4/8 Liaw, Andy > The source code of the whole pa

Re: [R] xyplot - show values of a series on graph

2009-04-08 Thread baptiste auguie
with ggplot2, d <- melt(df2,id="year") qplot(year,value,data=d,colour=variable,geom=c("line","point")) + geom_text(data= subset(d, variable == "cars"), aes(label=value)) with lattice, my best guess would be to use grid.text in a custom panel function. Hope this helps, baptiste On 8 Apr 2

Re: [R] Display a very low p-value

2009-04-08 Thread Dimitris Rizopoulos
in this case you need to use the 'lower.tail' argument, e.g., pnorm(8:15, lower.tail = FALSE) I hope it helps. Best, Dimitris Bhoom Suktitipat wrote: Hello R-Help, I ran some analysis and were hit with some low Z-score. I tried to convert it to a p-value, however, it seems like the ceiling

Re: [R] Display a very low p-value

2009-04-08 Thread stephen sefick
?options look at scipen On Wed, Apr 8, 2009 at 2:38 PM, Bhoom Suktitipat wrote: > Hello R-Help, > > I ran some analysis and were hit with some low Z-score. I tried to convert > it to a p-value, however, it seems like the ceiling is around 1e-16. > >> 1-pnorm(8) > [1] 6.661338e-16 >> 1-pnorm(9) >

Re: [R] help with random forest package

2009-04-08 Thread Liaw, Andy
The source code of the whole package is available on CRAN. All packages are submitted to CRAN is source form. There's no "rule" per se that gives the final prediction, as the final prediction is the result of plural vote by all trees in the forest. You may want to look at the varUsed() and getTr

[R] xyplot - show values of a series on graph

2009-04-08 Thread taz9
Hi All, I have a very simple graph: cars <- c(1, 3, 6, 4, 9) trucks <- c(2, 5, 4, 5, 12) year <- c(2004, 2005, 2006, 2007, 2008) df2<-data.frame(cars,trucks,year) xyplot(cars+trucks~year, data=df2, type="o") I need to show the values of "cars" on the graph. How can I do this? Thanks. -- View

[R] Display a very low p-value

2009-04-08 Thread Bhoom Suktitipat
Hello R-Help, I ran some analysis and were hit with some low Z-score. I tried to convert it to a p-value, however, it seems like the ceiling is around 1e-16. > 1-pnorm(8) [1] 6.661338e-16 > 1-pnorm(9) [1] 0 Do you have any suggestion how I can display a very low p-value in the form of scientific

Re: [R] predict "interval" for lmRob?

2009-04-08 Thread Galkowski, Jan
Hi Greg, Thanks for your guidance. In this case, the evidence is that the primary subpopulation of the data, accounting for observes the standard statistical model in the sense that Rice uses the term. It may by all accounts be normally distributed, and a Q-Q shows a large portion of the pr

Re: [R] read.spss, locale and encodings

2009-04-08 Thread Hans Ekbrand
On Wed, Apr 08, 2009 at 07:12:23PM +0200, Peter Dalgaard wrote: > Apparently, you can work around it like this > > lc <- Sys.setlocale("LC_CTYPE") > Sys.setlocale("LC_CTYPE", "da_DK") > x <- read.spss("~/Desktop/downloads/test.sav", reencode = "latin1") > Sys.setlocale("LC_CTYPE", lc) > > -- which

Re: [R] Lattice Groups

2009-04-08 Thread Lyman, Mark
I don't understand your first question, but, since no one else has responded I can answer your second question. panel.bwplot, unlike panel.xyplot doesn't use panel.superpose when groups is not NULL. In order to get an analogous result you need to specify that you want to use panel.superpose. cols

Re: [R] Minimum Spanning Tree

2009-04-08 Thread Gábor Csárdi
On Wed, Apr 8, 2009 at 6:12 PM, jpearl01 wrote: > > >>I am not sure what you mean. Of course you can plot it using different >>layouts, e.g. with layout.reingold.tilford (after choosing the root >>vertex in some way) and then it looks like a usual tree plot, but why >>would that be any better? > >

Re: [R] predict "interval" for lmRob?

2009-04-08 Thread Greg Snow
Your problem is related to the theory underlying linear models (and is an example as to why it is important to understand the theory, not just know how to plug numbers into a computer). The lm function is based on theory that assumes the y variable in normally distributed with the mean of that

Re: [R] read.spss, locale and encodings

2009-04-08 Thread Peter Dalgaard
Hans Ekbrand wrote: On Wed, Apr 08, 2009 at 04:17:51PM +0200, Peter Dalgaard wrote: Hans Ekbrand wrote: Someone running foreign 8.34 that is willing to test my SPSS-file? Someone with an SPSS file problem willing to help test the prereleases? :-) http://sociologi.cjb.net/temp/test.sav No j

Re: [R] Reshape - strange outputs

2009-04-08 Thread stephen sefick
can you provide a reproducible example? On Wed, Apr 8, 2009 at 11:59 AM, Steve Murray wrote: > > Dear R Users, > > I am using the reshape package to reformat gridded data into column format > using the code shown below. However, when I display the resulting object, a > single column is fomed (i

Re: [R] Convert data frame containing time stamps to time series

2009-04-08 Thread stephen sefick
have you tried using zoo and then using the function as.ts() On Wed, Apr 8, 2009 at 11:56 AM, wrote: > Converting dates is getting stranger still. I am coercing a data frame > into a ts as follows: > > > tst1<-as.POSIXct("1/21/09 5:01",format="%m/%d/%y %H:%M") > tst2<-as.POSIXct("1/28/09 3:40",f

Re: [R] binary version of R 2.8.x

2009-04-08 Thread stephen sefick
Does solaris have a package managment system? And do you have all of the packages for building? It looks like you do, but I am not sure. On Wed, Apr 8, 2009 at 12:42 PM, wrote: > > Yes, ./configure works with no error. > I guess it's a problem of my environment setup.  It's my first attempt to

Re: [R] Genstat into R - Randomisation test

2009-04-08 Thread Mike Lawrence
I was taught that Fisher proposed the F-test as a computationally simpler approximation to what he called a "Randomization test", consisting of exhaustive permutations. I never looked at the original Fisher reference myself, so this may be false. However, I haven't observed a consistent nomenclatu

Re: [R] Minimum Spanning Tree

2009-04-08 Thread jpearl01
>I am not sure what you mean. Of course you can plot it using different >layouts, e.g. with layout.reingold.tilford (after choosing the root >vertex in some way) and then it looks like a usual tree plot, but why >would that be any better? I'd like to be able to distinguish between the nodes bett

[R] MLE for bimodal distribution

2009-04-08 Thread _nico_
Hello everyone, I'm trying to use mle from package stats4 to fit a bi/multi-modal distribution to some data, but I have some problems with it. Here's what I'm doing (for a bimodal distribution): # Build some fake binormally distributed data, the procedure fails also with real data, so the proble

[R] subscript out of bounds in eqscplot problem

2009-04-08 Thread Pierre Moffard
Dear R users, I have the following problem. Suppose I have the following toy data set: > data m1 m2 m3 m4 m5 state [1,] 1 0 1 13 23 2 [2,] 0 1 0 23 94 2 [3,] 1 0 0 45 56 1 [4,] 0 1 0 35 84 2 [5,] 1 1 0 98 37 1 [6,] 1 1 0 68 1 2 where the

Re: [R] binary version of R 2.8.x

2009-04-08 Thread tomkur2006-takehome
Yes, ./configure works with no error. I guess it's a problem of my environment setup. It's my first attempt to build it myself, and I have downloaded the binaries and installed it previously. --- On Wed, 4/8/09, stephen sefick wrote: > From: stephen sefick > Subject: Re: [R] binary version

Re: [R] Constrained, multiple response statistics

2009-04-08 Thread Gene Leynes
This sounds very similar to what I've been working on, but I'm not sure without an example. My solution has been to use an optimization that normalizes inside the objective function. The betas that are provided by optim are not normalized, however since they were normalized inside the objective f

Re: [R] axis values on lattice log-scale plot

2009-04-08 Thread Deepayan Sarkar
On 4/7/09, Don McKenzie wrote: > I'm plotting the following (stripped of inessentials) > > xyplot(sd ~ distance | > wshed,data=sdvar.df,scales=list(x=list(log=TRUE),y=list(log=TRUE))) > > sdvar.df is a data frame, sd and distance are numeric, wshed is an ordered > factor > > trying to replicat

[R] Comparing Proportions Among Groups

2009-04-08 Thread Isabella Ghement
Hi everyone, I am trying to compare proportions among groups using the logistic regression approach as follows: 1) Fit the model log(p_i/(1-p_i)) = M + G_i, where p_i is the probability of success in group i and G_i is the effect of group i, i=1,..,I. 2) Test the hypotheses: Ho: G_1 = G_2 =

Re: [R] vectors on top of contours, and lattice

2009-04-08 Thread Deepayan Sarkar
On 4/8/09, Cable, Samuel B Civ USAF AFMC AFRL/RVBXI wrote: > OK, I needed to plot a set of vectors on top of a contour plot. I > figured out a way to do this. I create a panel function that calls > "larrows()" with arguments constructed from my vector data. Then, when > I go to do the contou

Re: [R] Colour each letter of a text string in a plot

2009-04-08 Thread jim holtman
Use 'text' to write out each one: plot(0, type='n', xlim=c(0,1), ylim=c(0,1)) text(seq(0,1,length=10), rep(0.5,10), LETTERS[1:10], col=1:10) On Wed, Apr 8, 2009 at 12:15 PM, Daren Tan wrote: > I am inserting a DNA sequence into a plot, and hope to colourize each > of the four nucleotide of the

Re: [R] Tinn-R pdf()

2009-04-08 Thread Deepayan Sarkar
On 4/8/09, Tobias Verbeke wrote: > Hi Henning, > > > > thanks for your help, with solved the problem, although i don't why, > because when using the R editor accessible via the R console i created many > many lattice plots with the code i posted, i.e. without the print() command. > > > > At the c

Re: [R] Genstat into R - Randomisation test

2009-04-08 Thread Peter Dalgaard
Mike Lawrence wrote: Looks like that code implements a non-exhaustive variant of the randomization test, sometimes called a permutation test. Isn't it the other way around? (Permutation tests can be exhaustive by looking at all permutations, if a randomization test did that, then it wouldn't

[R] Colour each letter of a text string in a plot

2009-04-08 Thread Daren Tan
I am inserting a DNA sequence into a plot, and hope to colourize each of the four nucleotide of the DNA sequence with a unique colour i.e., A ("red"), C ("green"), G ("blue", and T ("yellow"). I use the following codes, but the DNA sequence only shows as "red" DNA <- "ACGT" plot(1, xlim = c(0,1)

Re: [R] Col Names

2009-04-08 Thread jim holtman
Is this what you are looking for: > x Positions DEV.MSCI 04/30/1980 00:00:00.000 -0.0150328542 05/31/1980 00:00:00.000 0.0005087752 06/30/1980 00:00:00.000 0.0586794492 07/31/1980 00:00:00.000 0.0458505592 08/31/1980 00:00:00.000 0.0350926728 > colnames(x)[2] <- "NewName" >

[R] Sweave problem, with multicolumn tables from R to LaTeX

2009-04-08 Thread Christian Salas
Hi there, I have been using the example provided bellow for a while, and It was working without any problem. Nevertheless, just since 2-3 days is not working, probably because I did update.packages(). I have tried to re-install the older versions of the packages Hmisc() and xtable(), but stil

Re: [R] Is a point into an ellipse

2009-04-08 Thread Duncan Murdoch
On 4/8/2009 11:17 AM, Alain Guillet wrote: Hi, I drew an ellipse with the package ellipse. Now I would like to know if a point is inside the ellipse. Is any R functions to do it without computing the equation of the ellipse manually? Thanks. For example, if I do "plot(ellipse(0.8), type = '

[R] Reshape - strange outputs

2009-04-08 Thread Steve Murray
Dear R Users, I am using the reshape package to reformat gridded data into column format using the code shown below. However, when I display the resulting object, a single column is fomed (instead of three) and all the latitude values (which should be in either column one or two) are collected

[R] problem with creating a netcdf file under script sh

2009-04-08 Thread tuatu
Hi everyone, I try to make a netcdf file which disposes a difference between 2 variables of 2netcdf files the same dimension When I programmed under R, everything is ok but when I put the code under EOF of a sh script, an error occurs: "Error, passed variable has a dim that is NOT of class dim.

[R] Col Names

2009-04-08 Thread livia
Hello, I am working with S-plus TimeSeries Object. I wonder how can I change the column names of the variable instead of using the one default? i.e to change "DEV.MSCI" to other name PositionsDEV.MSCI 04/30/1980 00:00:00.000 -0.0150328542 05/31/1980 00:00:00.000 0.0

Re: [R] persp3d and rgl.viewpoint for rotating 3D plots

2009-04-08 Thread Duncan Murdoch
On 4/8/2009 11:47 AM, Camarda, Carlo Giovanni wrote: Dear Duncan, thanks for your prompt reply. I was tempted to use movie3d, but below I copied what I get on my PC. Then, I have ImageMagick installed and, though I set convert equal to FALSE, I was not able to find where the function writes th

Re: [R] Convert data frame containing time stamps to time series

2009-04-08 Thread amvds
Converting dates is getting stranger still. I am coercing a data frame into a ts as follows: tst1<-as.POSIXct("1/21/09 5:01",format="%m/%d/%y %H:%M") tst2<-as.POSIXct("1/28/09 3:40",format="%m/%d/%y %H:%M") tsdat<-as.ts(dat,start=tst1,end=tst2,frequency=1) This generates a ts object. But strange

Re: [R] persp3d and rgl.viewpoint for rotating 3D plots

2009-04-08 Thread Camarda, Carlo Giovanni
Dear Duncan, thanks for your prompt reply. I was tempted to use movie3d, but below I copied what I get on my PC. Then, I have ImageMagick installed and, though I set convert equal to FALSE, I was not able to find where the function writes the .png files. Maybe I lack experience in manag

Re: [R] Howto Plot With Transparent Background

2009-04-08 Thread Christof Winter
Eik Vettorazzi wrote, On 08.04.2009 15:08: By default pdfs have a transparent background, see ?pdf and there the bg part, which can be proven by a minimal R+ LaTeX example #R code pdf("test.pdf") plot(1,1) dev.off() #minimal tex example \documentclass[a4paper,12pt]{article} \usepackage[svgname

[R] vectors on top of contours, and lattice

2009-04-08 Thread Cable, Samuel B Civ USAF AFMC AFRL/RVBXI
OK, I needed to plot a set of vectors on top of a contour plot. I figured out a way to do this. I create a panel function that calls "larrows()" with arguments constructed from my vector data. Then, when I go to do the contour plot, I call contourplot() with the "panel" argument set to point to

Re: [R] [OT ?] rant (was : Re: Conversions From standard to metric units)

2009-04-08 Thread Michael Dewey
At 00:48 04/04/2009, Duncan Murdoch wrote: On 03/04/2009 5:37 PM, Emmanuel Charpentier wrote: Le vendredi 03 avril 2009 à 14:17 -0400, stephen sefick a écrit : I am starting to use R for almost any sort of calculation that I need. I am a biologist that works in the states, and there is often

[R] predict "interval" for lmRob?

2009-04-08 Thread Galkowski, Jan
lm's "predict" function offers an "interval" parameter to choose between 'confidence' and 'prediction' bands. In the package "robust" and for "lmRob", there is also a "predict" but it lacks such a parameter, and the documented "type" parameter has only "response" offerred. Is there some way of

[R] Is a point into an ellipse

2009-04-08 Thread Alain Guillet
Hi, I drew an ellipse with the package ellipse. Now I would like to know if a point is inside the ellipse. Is any R functions to do it without computing the equation of the ellipse manually? Thanks. For example, if I do "plot(ellipse(0.8), type = 'l')", I would like to know if (0,1) belongs

Re: [R] persp3d and rgl.viewpoint for rotating 3D plots

2009-04-08 Thread Duncan Murdoch
On 4/8/2009 11:01 AM, Camarda, Carlo Giovanni wrote: Dear R-users, within the rgl-package, I would have a question about the usage of persp3d in combination of rgl.viewpoint. I am not able to figure out how to let a 3D plot rotating around likewise the example in ?rgl.viewpoint. It seems th

Re: [R] read.spss, locale and encodings

2009-04-08 Thread Hans Ekbrand
On Wed, Apr 08, 2009 at 04:17:51PM +0200, Peter Dalgaard wrote: > Hans Ekbrand wrote: >> Someone running foreign 8.34 that is willing to test my SPSS-file? > > Someone with an SPSS file problem willing to help test the prereleases? :-) http://sociologi.cjb.net/temp/test.sav -- Hans Ekbrand (http

[R] persp3d and rgl.viewpoint for rotating 3D plots

2009-04-08 Thread Camarda, Carlo Giovanni
Dear R-users, within the rgl-package, I would have a question about the usage of persp3d in combination of rgl.viewpoint. I am not able to figure out how to let a 3D plot rotating around likewise the example in ?rgl.viewpoint. It seems that when I use persp3d(...) I see something on my scr

Re: [R] Genstat into R - Randomisation test

2009-04-08 Thread Mike Lawrence
*sigh* and the elapsed time line should be: cat('Elapsed time:',proc.time()[1]-start.time) On Wed, Apr 8, 2009 at 11:35 AM, Mike Lawrence wrote: > *Hits head* > Of course, the approach taken by your Genstat code of only shuffling > one variable is sufficient and faster: > > n.obs = 100 > ID=rn

Re: [R] default print format for large numbers

2009-04-08 Thread Richard . Cotton
> Numbers like ``1239178547.653775" is inserted into a vector. I print > the vector: > > > route_9_80_end > [1] 1239178522 1239178526 1239178524 1239178524 1239178524 > 1239178523 1239178524 1239178522 1239178521 1239178565 1239178566 1239178566 > [13] 1239178565 1239178566 1239178566 123917856

  1   2   >