Re: [R] error in passing an argument to do.call when do.call is in a for statement

2008-08-15 Thread Prof Brian Ripley
Your code is pretty much unreadable -- no spaces, not properly indented. Please see `Writing R Extensions' about how to prepare legible code. (If you want free consultancy, your potential helpers do expect this from you.) But I am prety sure that neither do.call() nor the for() loop are anythi

Re: [R] Convert text string to object pointer

2008-08-15 Thread caddr
Try this: x <- 1 z <- as.name ("x") eval (call ("<-", z, call ("attr<-", z, "foo", "bar"))) x [1] 1 attr(,"foo") [1] "bar" On 15 авг, 06:35, "Abiel Reinhart" <[EMAIL PROTECTED]> wrote: > I would like to use a text string to get a reference to an object whose name > is the text string. I have seen

Re: [R] autocorrelation in gams

2008-08-15 Thread Gavin Simpson
On Thu, 2008-08-14 at 16:12 +0100, Abigail McQuatters-Gollop wrote: > Hi, > > I am looking at the effects of two explanatory variables on chlorophyll. > The data are an annual time-series (so are autocorrelated) and the > relationships are non-linear. I want to account for autocorrelation in > my

[R] How to substitute special characters within a data frame?

2008-08-15 Thread Yingfu Xie
Hello all, I have a data frame in R, imported from an excel file in Swedish. The original file contains several columns that have special characters, such as \¨{a}, \¨{o}, and so on. After import such special characters are represented in the data frame by "\\345", "\\366" etc (don't ask me why

Re: [R] How to substitute special characters within a data frame?

2008-08-15 Thread Henrique Dallazuanna
Try this: gsub("345", "a", "H\\345rkan") But see: cat("H\345rkan\n") On Fri, Aug 15, 2008 at 6:54 AM, Yingfu Xie <[EMAIL PROTECTED]> wrote: > Hello all, > > I have a data frame in R, imported from an excel file in Swedish. The > original file contains several columns that have special char

Re: [R] How to substitute special characters within a data frame?

2008-08-15 Thread Prof Brian Ripley
You've not told us the 'at a minimum' information requested in the posting guide. What OS? What locale? And how did you 'import'? But here's a guess. If you change \\345 to \345, it should render correctly in a Latin-1 locale: "H\345rkan" [1] "Hårkan" If this a UTF-8 locale, convert it

[R] Row-Column design

2008-08-15 Thread Marc Moragues Canela
Dear list, I am trying to do the randomization of several field experiments using a row/column design. I found some functions in the past, but I do not remember what package it was and don't seem to find it again . Any information about this will be appreciated. Thanks. Marc. [[alternat

[R] Opening a web browser from R?

2008-08-15 Thread J . delasHeras
Hi, I was wondering if there's a way in R to open a web browser (such as Internet Explorer, or Firefox or whatever). I'm doing some analyses that have associated urls, and it would be nice to have the ability to directly open the relevant page from within R. I was looking at the help for '

[R] continuous coloring of a polygon

2008-08-15 Thread Roger Leenders
R2.7.1, WinXP Hi, I have a polygon inside a circle as follows: radius <- 3 x <- seq(-radius,radius,length=2000) y <- sqrt(radius^2-x^2) xx <- c(x,-x) yy <- c(y,-y) plot(xx,yy, xlim=c(-radius,radius),ylim=c(-radius,radius), type="l", ylab="", xlab="", axes=F) radius <- 2.7 x1 <- seq(-radius,

[R] Saving environment object

2008-08-15 Thread Benjamin Otto
Hi, When I create an environment object with new.env() and populate it with values then how can I save it into an .RData file properly, so it can be loaded later on in a new session? Saving an environment object with save() or save.image() results in an error message when loading again: Error: p

Re: [R] Department of Redundancy Department.

2008-08-15 Thread Liaw, Andy
I couldn't resist, either... > From: Henrik Bengtsson > > Hmm, > > couldn't resists: > > > X <- NA > > is.logical(X) > [1] TRUE > > (X == TRUE) > [1] NA > > > "==.MaybeNA" <- function(e1, e2) { !is.na(e1) && (e1 == e2) } > > X <- structure(NA, class="MaybeNA") > > is.logical(X) > [1] TRUE > >

[R] estimating the proportion without recurring ailment based on the nelson-aalen estimator

2008-08-15 Thread Vumani Dlamini
Dear useRs, I'm trying to estimate the proportion of individuals with a without a certain recurring ailment at several times points. The data are of the survival type, with "start"-"stop" dates and whether the individual had the ailment in that interval. Some cases are observed until database

Re: [R] Opening a web browser from R?

2008-08-15 Thread Erik Iverson
Hello - [EMAIL PROTECTED] wrote: Hi, I was wondering if there's a way in R to open a web browser (such as Internet Explorer, or Firefox or whatever). I'm doing some analyses that have associated urls, and it would be nice to have the ability to directly open the relevant page from within R.

Re: [R] Opening a web browser from R?

2008-08-15 Thread Henrique Dallazuanna
Use browseURL: browseURL('about:blank') On Fri, Aug 15, 2008 at 7:55 AM, <[EMAIL PROTECTED]> wrote: > > Hi, > > I was wondering if there's a way in R to open a web browser (such as > Internet Explorer, or Firefox or whatever). > I'm doing some analyses that have associated urls, and it would be

Re: [R] Opening a web browser from R?

2008-08-15 Thread Michael Lawrence
browseURL() On Fri, Aug 15, 2008 at 3:55 AM, <[EMAIL PROTECTED]> wrote: > > Hi, > > I was wondering if there's a way in R to open a web browser (such as > Internet Explorer, or Firefox or whatever). > I'm doing some analyses that have associated urls, and it would be nice to > have the ability to

Re: [R] Saving environment object

2008-08-15 Thread Luke Tierney
On Fri, 15 Aug 2008, Benjamin Otto wrote: Hi, When I create an environment object with new.env() and populate it with values then how can I save it into an .RData file properly, so it can be loaded later on in a new session? Saving an environment object with save() or save.image() results in a

Re: [R] Opening a web browser from R?

2008-08-15 Thread James W. MacDonald
?browseURL [EMAIL PROTECTED] wrote: Hi, I was wondering if there's a way in R to open a web browser (such as Internet Explorer, or Firefox or whatever). I'm doing some analyses that have associated urls, and it would be nice to have the ability to directly open the relevant page from within

Re: [R] Opening a web browser from R?

2008-08-15 Thread Christos Hatzis
Jose, I think shell.exec should do what you want: shell.exec("http://www.yahoo.com";) -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: Friday, August 15, 2008 6:56 AM > To: r-help@r-project.org > Subject: [R

Re: [R] How to substitute special characters within a data frame?

2008-08-15 Thread Yingfu Xie
Thanks to Prof. Ripley and Henrique, gsub does do the job. In addition, we can use like gsub("345","aa", the column of the data frame) to replace all such characters in this column. By the way, I am using Windows Vista, R 2.6.1, in Sweden. As for the \\345 instead of \345, that is because,

Re: [R] Saving environment object

2008-08-15 Thread Erik Iverson
Benjamin Otto wrote: Hi, When I create an environment object with new.env() and populate it with values then how can I save it into an .RData file properly, so it can be loaded later on in a new session? Saving an environment object with save() or save.image() results in an error message when l

[R] post hoc tests two way repeated measures anova

2008-08-15 Thread Jean-Pierre Bresciani
Hi, is there a specific/appropriate function/package to perform post hoc tests when running a two way repeated measures anova? I'm looking for something that will be equivalent to the 'TukeyHSD()' for between subjects anova (with 'aov()'). For one way repeated measures anova, the 'pairwise.t.test

Re: [R] problem to load the RGrace package

2008-08-15 Thread Tomas Lanczos
If anybody is interested (maybe not :-)): finally I found a workaround: reinstalling R (in my case building R-devel from source) and then run update.packages(). But what exactly was the problem remain mystery (for me). Have a nice day folks tomas Tomas Lanczos wrote: Hello everybody, it l

Re: [R] Opening a web browser from R?

2008-08-15 Thread J . delasHeras
Fantastic! That's perfect. how didn't I find that??? Thank you! Jose Quoting Henrique Dallazuanna <[EMAIL PROTECTED]>: Use browseURL: browseURL('about:blank') On Fri, Aug 15, 2008 at 7:55 AM, <[EMAIL PROTECTED]> wrote: Hi, I was wondering if there's a way in R to open a web browser (

Re: [R] Saving environment object

2008-08-15 Thread Benjamin Otto
Hi Erik, Yes this is what I was trying and your example or the one of luke is working fine with me. So now I'm not sure if this is due to an environment which takes too much space. The environment troubling me has 644276 entries. Is this too much? Benjamin -Ursprüngliche Nachricht- Von:

Re: [R] cor() btwn columns in two matrices - no complete element pairs

2008-08-15 Thread rcoder
Is there any way to increment the loop when the error occurs, returning an NA in the results matrix. I have included an if starement to only calculate cor() when columns are !all(is.na()), but I still exit out with this error, albeit after some loops through the matrix - i.e. when the condition is

[R] cor() btwn columns in two matrices - no complete element pairs

2008-08-15 Thread rcoder
Hi everyone, I'm trying to calculate correlation coefficients between corresponding columns in two matrices with identical dimensions but different data. The problem is that the matrices contain NAs in different locations. I am using the following code to try to calculate correlations between com

Re: [R] Saving environment object

2008-08-15 Thread Erik Iverson
Of course you said when you load it again. I just now loaded it, without error. FYI, my sessionInfo(), which I realize is not the latest version. sessionInfo() R version 2.7.0 (2008-04-22) i686-pc-linux-gnu locale: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;L

Re: [R] Saving environment object

2008-08-15 Thread Prof Brian Ripley
Not so in general, so we need the details asked for in the posting guide, including a reproducible example. (Environments get saved all the time: they are a fundamental part of R's operations.) On Fri, 15 Aug 2008, Benjamin Otto wrote: Hi, When I create an environment object with new.env()

Re: [R] Maximum likelihood estimation

2008-08-15 Thread Peter Dalgaard
Jurica Brajković wrote: > Hello, > > I am struggling for some time now to estimate AR(1) process for commodity > price time series. I did it in STATA but cannot get a result in R. > > The equation I want to estimate is: p(t)=a+b*p(t-1)+error > Using STATA I get 0.92 for a, and 0.73 for b. > > C

[R] map("state" ...) Is the USA cracking up?

2008-08-15 Thread John P. Burkett
Running R version 2.6.1 under Linux, I'm trying to use the maps and mapdata packages and the state database to produce a thematic map of the USA. My problem is that cracks (white spaces) appear between some states--e.g. between Colorado and Utah and between Michigan and Indiana. The resulting

[R] Boot warning messages

2008-08-15 Thread ACroske
Hello, I am attempting to run a bootstrap on a data frame, but something is going wrong. I have 2 data frames: AB V1 V2 V3V1 V2 V3 1 1471 10 13 16 2 2582 11 14 17 3 3693 12 15 18 Over each

[R] dbConnect

2008-08-15 Thread Christiane Reuter
Hi everybody, I'm having a problem with connecting to my MySQL database. Each time I try to connect library(RMySQL) m <- dbDriver("MySQL") con <- dbConnect (m, host="my_host",username="my_username", password="my_password", dbname="name_of_db") it says Fehler in mysqlNewConnection(drv, ...) :

Re: [R] Opening a web browser from R?

2008-08-15 Thread Prof Brian Ripley
If this is Windows, see shell.exec. On any platform, see browseURL. Does help.search("url") not get you there? On Fri, 15 Aug 2008, [EMAIL PROTECTED] wrote: Hi, I was wondering if there's a way in R to open a web browser (such as Internet Explorer, or Firefox or whatever). I'm doing some an

Re: [R] Saving environment object

2008-08-15 Thread Henrik Bengtsson
Hi, can you please give a reproducible example and what's your sessionInfo()? Many years ago when I started to develop the Object class in R.oo, which is using environments, I also had problems saving environments directly. I my case I think it was when I added a class attribute to an environmen

Re: [R] Opening a web browser from R?

2008-08-15 Thread J . delasHeras
Thanks to everyone who replied to me, both on and off-list. Indeed, searching for "url" alone finds 'browseURL' and the very interesting 'shell.exec'... I must have had a "fuzzy moment" because I did not see it when I first looked, but yes, there they are! So, apologies for asking somethin

[R] Design-consistent variance estimate

2008-08-15 Thread Doran, Harold
Dear List: I am working to understand some differences between the results of the svymean() function in the survey package and from code I have written myself. The results from svymean() also agree with results I get from SAS proc surveymeans, so, this suggests I am misunderstanding something. I

[R] nls errors

2008-08-15 Thread Laura Cordero Llana
Hi, I am trying to use a non linear regresion form like: f(x) ~ fmax*(1-exp(-a*(x-c)). > nls.NEE.fill <- nls(NEE ~ -NEE.max*(1-exp(-alpha*(PAR-I))), > start=list(NEE.max=-25,alpha=5,I=20)) I have given random values to a and c (alpha and I). But it gives my an error: Error in nlsModel(f

Re: [R] Convert text string to object pointer

2008-08-15 Thread Henrik Bengtsson
See the Object class in the R.oo package. /Henrik On Thu, Aug 14, 2008 at 7:35 PM, Abiel Reinhart <[EMAIL PROTECTED]> wrote: > I would like to use a text string to get a reference to an object whose name > is the text string. I have seen people using get() for this purpose, but as > far as I can

[R] Strange error message from geoR´s likfit ( ) lik. max. func.

2008-08-15 Thread Ruben Roa Ureta
ComRades: I am geeting the error message Error in ldots[[which(MET)]] : attempt to select less than one element when I try to fit the geostatistical model with the likfit() function of geoR. I have tried with old data for which likfit() successfully maximised the likelihood in previous versions of

Re: [R] Row-Column design

2008-08-15 Thread Dieter Menne
Marc Moragues Canela gmail.com> writes: > I am trying to do the randomization of several field experiments using a > row/column design. I found some functions in the past, but I do not remember > what package it was and don't seem to find it again Package AlgDesign might do what you want. Diete

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Dieter Menne
Roger Leenders rug.nl> writes: > > I have a polygon inside a circle as follows: > .. Example code removed (but it's nice you included it) > (the graph much resembles a speed dial inside a car). > Now I want to fill the polygon with color, such that it starts on the > left with red and ends on

Re: [R] Saving environment object

2008-08-15 Thread Prof Brian Ripley
Having been told that this was a particular very large environment, Luke's comments in serialize.c wouild seem to apply: The output format for dotted pairs writes the ATTRIB value first rather than last. This allows CDR's to be processed by iterative tail calls to avoid recursion stack

[R] stopifnot message mutation

2008-08-15 Thread Vadim Organovich
Dear R-users, Could someone please explain why the message printed by function stopifnot2, see below, is different from that of stopifnot itself? Thank you for your help, Vadim > stopifnot2 <- function(...) stopifnot(...) > stopifnot(F) Error: F is not TRUE > stopifnot2(F) Error: ..1 is not TR

[R] data types in R

2008-08-15 Thread Amanda1988
I was having a problem with a little simple function I wrote in R and I think the problem was that R is representing fractional numbers in binary floating point and not decimal notation, so sometimes I was having extra data points counted. Is there a way to cast a number stored in a variable as an

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Aiste Aistike
Hello, I slightly altered your code, but I hope that's what you want: l <- 1000 radius <- 3 x <- seq(-radius,radius,length=l) y <- sqrt(radius^2-x^2) xx <- c(x,-x) yy <- c(y,-y) plot(xx,yy, xlim=c(-radius,radius),ylim=c(-radius,radius), type="l", ylab="", xlab="", axes=F) radius <- 2.7 x1 <- seq

[R] ylab with an exponent

2008-08-15 Thread stephen sefick
plot(1,2, ylab= paste("insects", expression(m^2), sep=" ")) I get insects m^2 I would like m to the 2 what is the problem? -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We a

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Roger Leenders
Hi Aiste, Thank you. It may be slow, but it is exactly what I was looking for! I'd be interested if anyone has a faster solution, but this already does the trick well. Of course there will be additional elements in the figure, but it is the coloring I was struggling with. thanks, Roger Ai

[R] Rcommander installation fails on Fedora 9

2008-08-15 Thread John Sorkin
Fedora 9 R 2.7.1 I tried to install R on my Linux system using install.packages("Rcmdr", dependencies=TRUE). I received many, many, many error messages. I hope someone can suggest a fix. The output from warnings() is listed below. A more detailed list of errors from one of the failed installa

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Earl F. Glynn
"Roger Leenders" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Now I want to fill the polygon with color, such that it starts on the left > with red and ends on the right with green, following the coloring of the > rainbow. I'd recommend using polar coordinates, like shown belo

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Johannes Hüsing
Am 15.08.2008 um 14:00 schrieb Roger Leenders: I can draw the polygon as above, but I don't know how to do the coloring. It is easy to give the polygon only one color (e.g. through polygon(c(x1,x2),c(y1,y2), col="red")), but I need a way in which to color the polygon such that the color moves

[R] Combination with repetition

2008-08-15 Thread Jose Luis Aznarte M.
Hi there! I can't find any information about creating combinations with repetitions in R. The function combn() does create combinations, but _without_ repetitions. Here is what I need to do: svIter <- 1000 xx <- matrix(rnorm(m*n), c(m, n)) sequence <- seq(range(xx)[1], range(xx)[2], length

Re: [R] Saving environment object

2008-08-15 Thread Luke Tierney
On Fri, 15 Aug 2008, Prof Brian Ripley wrote: Having been told that this was a particular very large environment, Luke's comments in serialize.c wouild seem to apply: The output format for dotted pairs writes the ATTRIB value first rather than last. This allows CDR's to be processed by it

Re: [R] ylab with an exponent

2008-08-15 Thread Mark Difford
>> what is the problem? A solution is: plot(1,2, ylab=expression(paste("insects ", m^2))) The problem is very much more difficult to determine. stephen sefick wrote: > > plot(1,2, ylab= paste("insects", expression(m^2), sep=" ")) > > I get insects m^2 > I would like m to the 2 > > what is

[R] Design-consistent variance estimate

2008-08-15 Thread Doran, Harold
Dear List: (reposting due to word wrap problems, my apologies) I am working to understand some differences between the results of the svymean() function in the survey package and from code I have written myself. The results from svymean() also agree with results I get from SAS proc surveymeans, s

[R] Pdf file size for very scatter plots

2008-08-15 Thread Nazareno Andrade
Dear all, I am plotting a scatter plot for a large sample (1e+05 ordered pairs). This produces a large (~5MB) file in a pdf or postscript terminal, and I am wondering whether there are methods for reducing the size of the resulting file so that it is easier to include it in a document. I'd rather

Re: [R] Pdf file size for very scatter plots

2008-08-15 Thread jim holtman
Have you tried using pch='.'? Also you might consider using 'hexbin' for creating the scatter plot. On Fri, Aug 15, 2008 at 12:24 PM, Nazareno Andrade <[EMAIL PROTECTED]> wrote: > Dear all, > > I am plotting a scatter plot for a large sample (1e+05 ordered pairs). > This produces a large (~5MB)

Re: [R] stopifnot message mutation

2008-08-15 Thread Charles C. Berry
On Fri, 15 Aug 2008, Vadim Organovich wrote: Dear R-users, Could someone please explain why the message printed by function stopifnot2, see below, is different from that of stopifnot itself? Refer to the source page(stopifnot,'print') Then consider this: foo <- function(...) mat

Re: [R] ylab with an exponent

2008-08-15 Thread stephen sefick
solution plot(1,2, ylab= expression("insects"*" "*m^2)) On Fri, Aug 15, 2008 at 12:26 PM, stephen sefick <[EMAIL PROTECTED]> wrote: > plot(1,2, ylab= paste("insects", expression(m^2), sep=" ")) > > I get insects m^2 > I would like m to the 2 > > what is the problem? > > -- > Let's not spend our t

Re: [R] autocorrelation in gams

2008-08-15 Thread Kingsford Jones
Keeping Gavin's advice in mind, you may also want to look at ?acf (and see section 14.1 of MASS) and help(ACF, package=nlme) (see section 5.3 of MEMSS). These are useful functions for exploring the 1d empirical autocorrelation structure of model residuals. hth, Kingsford Jones On Fri, Aug 15, 20

[R] x-axis with month and year

2008-08-15 Thread Schreiber, Stefan
Hey list! I have a csv-file with two variables: (Date,CMI) Date,CMI Jan-93,3.24 Feb-93,-2.56 . . . Dec-06, 8.25 When I want to plot this dataset, R is sorting the date in alphabetical order. Is there any way to tell R not to do it? I know it is probably an easy issue but I couldn't find a solu

Re: [R] Combination with repetition

2008-08-15 Thread Dimitris Rizopoulos
you could use something like the following: expand.grid(rep(list(1:3), 4)) I hope it helps. Best, Dimitris Jose Luis Aznarte M. wrote: Hi there! I can't find any information about creating combinations with repetitions in R. The function combn() does create combinations, but _without_ re

Re: [R] Saving environment object

2008-08-15 Thread Henrik Bengtsson
On Fri, Aug 15, 2008 at 6:43 AM, Benjamin Otto <[EMAIL PROTECTED]> wrote: > Hi Erik, > > Yes this is what I was trying and your example or the one of luke is working > fine with me. > > So now I'm not sure if this is due to an environment which takes too much > space. The environment troubling me h

Re: [R] Design-consistent variance estimate

2008-08-15 Thread Stas Kolenikov
Harold, in design-based estimation, thinking in terms of "what is my (effective) sample size" rarely works out. First of all, unless you have a fixed sample size design, your sample size itself is a random variable. You can hope for fixed sample sizes with some excruciatingly controlled clinical

Re: [R] Combination with repetition

2008-08-15 Thread Charles C. Berry
On Fri, 15 Aug 2008, Jose Luis Aznarte M. wrote: Hi there! I can't find any information about creating combinations with repetitions in R. The function combn() does create combinations, but _without_ repetitions. Here is what I need to do: svIter <- 1000 xx <- matrix(rnorm(m*n), c(m, n))

Re: [R] Saving environment object

2008-08-15 Thread Benjamin Otto
Hi Luke, hi all, You have been right guys, the hashing solved the problem. Thanks for your hard efforts. :) Best regards Benjamin -Ursprüngliche Nachricht- Von: Luke Tierney [mailto:[EMAIL PROTECTED] Gesendet: Friday, August 15, 2008 6:29 PM An: Prof Brian Ripley Cc: Benjamin Otto; R-H

Re: [R] Pdf file size for very scatter plots

2008-08-15 Thread Nazareno Andrade
Jim, Thanks for the answer. Using pch="." reduces the file to ~3MB... Still large. I'll look into hexbins, but if I understand it right, it would 'round' points which are nearby into a same hexagon, right? Couldn't that result in an inaccurate view of a scatter plot? Here's the code I'm using:

[R] Question on default link directory

2008-08-15 Thread Yevhen Yankovskyy
Hi, I have got a problem with running WinBugs from R. Following WinBugs project recommendations for Vista Microcoft, I installed my Winbugs software at C:\ (not at C:\Program Files). However, when I run the attached code in R, R still looks for Winbugs at C:\Program Files and ends up in numerous

[R] Handling Runtime Error Messages

2008-08-15 Thread Jorge Cardoso
I'm writing a C++ application using R-embedding to do some forecast process. I also use R_tryEval instead of R_Eval to run my R-script, so that in case of error I know exactly in which line number was the last error. In particular, from time in time y get some error messages refering an excepti

Re: [R] data types in R

2008-08-15 Thread jim holtman
faq 7.31 On Fri, Aug 15, 2008 at 9:16 AM, Amanda1988 <[EMAIL PROTECTED]> wrote: > > I was having a problem with a little simple function I wrote in R and I think > the problem was that R is representing fractional numbers in binary floating > point and not decimal notation, so sometimes I was havi

Re: [R] x-axis with month and year

2008-08-15 Thread Ben Bolker
Schreiber, Stefan ales.ualberta.ca> writes: > > Hey list! > > I have a csv-file with two variables: (Date,CMI) > > Date,CMI > Jan-93,3.24 > Feb-93,-2.56 > . > . > . > Dec-06, 8.25 > > When I want to plot this dataset, R is sorting the date in alphabetical > order. Is there any way to te

Re: [R] Pdf file size for very scatter plots

2008-08-15 Thread Ben Bolker
Nazareno Andrade lsd.ufcg.edu.br> writes: > > Jim, > > Thanks for the answer. Using pch="." reduces the file to ~3MB... Still large. > > I'll look into hexbins, but if I understand it right, it would 'round' > points which are nearby into a same hexagon, right? Couldn't that > result in an ina

Re: [R] Rcommander installation fails on Fedora 9

2008-08-15 Thread Paul Smith
On Fri, Aug 15, 2008 at 6:15 PM, John Sorkin <[EMAIL PROTECTED]> wrote: > Fedora 9 > R 2.7.1 > > I tried to install R on my Linux system using > install.packages("Rcmdr", dependencies=TRUE). > > I received many, many, many error messages. I hope someone can suggest a > fix. > > The output from warn

Re: [R] ylab with an exponent

2008-08-15 Thread Henrique Dallazuanna
Try this: plot(1,2, ylab=expression(insects~m^2)) On Fri, Aug 15, 2008 at 1:26 PM, stephen sefick <[EMAIL PROTECTED]> wrote: > plot(1,2, ylab= paste("insects", expression(m^2), sep=" ")) > > I get insects m^2 > I would like m to the 2 > > what is the problem? > > -- > Let's not spend our time and

Re: [R] continuous coloring of a polygon

2008-08-15 Thread hadley wickham
It rather sounds like you might be designing a gauge display for a dashboard. If that's the case, I'd recommend checking out: Information Dashboard Design: The Effective Visual Communication of Data Stephen Few http://www.amazon.com/dp/0596100167 as well as some of his online writings: http://w

Re: [R] data types in R

2008-08-15 Thread Mike Prager
Amanda1988 <[EMAIL PROTECTED]> wrote: > > I was having a problem with a little simple function I wrote in R and I think > the problem was that R is representing fractional numbers in binary floating > point and not decimal notation, so sometimes I was having extra data points > counted. Is there

Re: [R] Pdf file size for very scatter plots

2008-08-15 Thread Nazareno Andrade
Jim, Thanks for the answer. Using pch="." reduces the file to ~3MB... Still large. I'll look into hexbins, but if I understand it right, it would 'round' points which are nearby into a same hexagon, right? Couldn't that result in an inaccurate view of a scatter plot? Here's the code I'm using:

[R] error: bad value ???

2008-08-15 Thread dylan boyd
I'm running R 2.7.1 on Windows XP. Lately and spontaneously, it will give an "error: bad value" message in response to any command. I have to restart R to (temporarily) fix the problem. There are two other threads I've found on the issue here: http://tolstoy.newcastle.edu.au/R/e4/help/08/01/075

[R] Extracting dataset from lm output

2008-08-15 Thread Roberts, Kyle
Dear All, I want to extract the original dataset from a lm output. I know that I can get most of it from model.matrix(lm.out) but I need the dependent variable to be in the first column. Any ideas? Thanks, Kyle Roberts __ R-help@r-project.org mailing

Re: [R] Design-consistent variance estimate

2008-08-15 Thread Doran, Harold
Thank you, Stas. This is helpful. A few thoughts. 1) In this linearization, I do treat N (population) size as a known constant. I thought that is what svymean() and SAS proc surveymeans did as well. So, this is a simple univariate expansion since I only take the derivative w.r.t to Y, the popul

Re: [R] Question on default link directory

2008-08-15 Thread Henrique Dallazuanna
Try change the bugs.directory argument in bugs function: AR1bugs.sim <- bugs(data, inits, parameters, "D:AR1GammaModel.txt", n.chains=3, n.iter=1000,bugs.directory="c:/WinBUGS14/", working.directory=NULL, clearWD=TRUE, debug=TRUE) On Fri, Aug 15, 2008 at 1:54 PM, Yevhen Yankovskyy <[EMAIL

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Greg Snow
Here are a couple of other solutions, use whichever works best for you (after modifications, changing increments, etc.). radius <- 3 x <- seq(-radius,radius,length=2000) y <- sqrt(radius^2-x^2) xx <- c(x,-x) yy <- c(y,-y) plot(xx,yy, xlim=c(-radius,radius),ylim=c(-radius,radius), type="l", ylab="

Re: [R] x-axis with month and year

2008-08-15 Thread Gabor Grothendieck
Check out the zoo package: Lines <- "Date,CMI Jan-93,3.24 Feb-93,-2.56 Dec-06, 8.25" library(zoo) z <- read.zoo(textConnection(Lines), FUN = as.yearmon, format = "%b-%y", sep = ",", header = TRUE) plot(z) On Fri, Aug 15, 2008 at 1:12 PM, Schreiber, Stefan <[EMAIL PROTECTED]> wrote: > Hey li

Re: [R] Extracting dataset from lm output

2008-08-15 Thread Roberts, Kyle
Thanks for the suggestions. I needed it to be a little more generic to capture lm models where the dataset may or may not have been attached. Also, if they specified any interaction effects, I needed to capture them, so model.frame wouldn't work. With Henrique's help, I did this: new<-model.mat

Re: [R] Rcommander installation fails on Fedora 9

2008-08-15 Thread Peter Dalgaard
John Sorkin wrote: Fedora 9 R 2.7.1 I tried to install R on my Linux system using install.packages("Rcmdr", dependencies=TRUE). I received many, many, many error messages. I hope someone can suggest a fix. Looks like you forgot to install the R-devel package. (And yes, the error message

Re: [R] stopifnot message mutation

2008-08-15 Thread Vadim Organovich
Thank you very much Charles! I probably should stop passing the dots to subfunctions and rather doctor the results of as.list(match.call()), e.g. mc <- as.list(match.call()) mc[[1]] <- stopifnot eval(as.call(mc)) This looks safer. Thanks again, Vadim F

Re: [R] Extracting dataset from lm output

2008-08-15 Thread Prof Brian Ripley
Look at the help page: Value: model: if requested (the default), the model frame used. The model frame is a data frame containing all the variables used to fit the model. On Fri, 15 Aug 2008, Roberts, Kyle wrote: Dear All, I want to extract the original dataset from a lm output. I know

Re: [R] Extracting dataset from lm output

2008-08-15 Thread Henrique Dallazuanna
Try this: lm.out$model On Fri, Aug 15, 2008 at 4:48 PM, Roberts, Kyle <[EMAIL PROTECTED]> wrote: > Dear All, > > I want to extract the original dataset from a lm output. I know that I > can get most of it from > > model.matrix(lm.out) > > but I need the dependent variable to be in the first colum

Re: [R] Extracting dataset from lm output

2008-08-15 Thread Dimitris Rizopoulos
try this: x1 <- rnorm(30) x2 <- rnorm(30) x3 <- rnorm(30) y <- 0.5 + x1 - 2*x2 + 3*x3 + rnorm(30) fm <- lm(y ~ x1 + x2 + x3) model.frame(fm) I hope it helps. Best, Dimitris Roberts, Kyle wrote: Dear All, I want to extract the original dataset from a lm output. I know that I can get most o

Re: [R] map("state" ...) Is the USA cracking up?

2008-08-15 Thread John P. Burkett
The problem was solved by specifying resolution=0 in the map() function. Would that saving the union had always been so easy and bloodless. -John John P. Burkett wrote: Running R version 2.6.1 under Linux, I'm trying to use the maps and mapdata packages and the state database to produce a themat

Re: [R] Department of Redundancy Department.

2008-08-15 Thread Greg Snow
Look at: > library(fortunes) > fortune(69) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Rolf Turner > Sent: Thursday, August 14,

[R] exporting adaBoost model

2008-08-15 Thread Bob Flagg
Dear all, I'm using adaBoost from the ada package to build a classification model. After training the model in R I'd like to use it in a Python application. Is it possible to export the model in some way to make translating into python easier? Any help would be greatly appreciated. Thanks. Bo

Re: [R] Pdf file size for very scatter plots

2008-08-15 Thread Stephen Tucker
I thought running it through latex will compress the pdf - but this post nicely summarizes some options: http://tolstoy.newcastle.edu.au/R/e2/help/07/05/17475.html I personally prefer the pdftk approach* over the ghostscript option** as the latter seems to give me a number of problems on Windo

Re: [R] Design-consistent variance estimate

2008-08-15 Thread Stas Kolenikov
On 8/15/08, Doran, Harold <[EMAIL PROTECTED]> wrote: > 1) In this linearization, I do treat N (population) size as a known > constant. I thought that is what svymean() and SAS proc surveymeans did as > well. So, this is a simple univariate expansion since I only take the > derivative w.r.t to Y, t

Re: [R] Rcommander installation fails on Fedora 9

2008-08-15 Thread John Sorkin
Paul, I installed R-devel as root, and then re-tried to install R-cmdr as a regular users. Unfortunately I still receive multiple error messages. Any suggestions? I have pasted on set of error messages below: * DONE (multcomp) * Installing *source* package 'party' ... ** libs gcc -m32 -std=gnu99 -

[R] Cairo installation process fails "compile a simple Cairo program" step

2008-08-15 Thread Rand, Hugh
Hi, I am having trouble getting Cairo properly installed for R. The details (what I tried, what I got, and my system info) are below. Any ideas would be appreciated. Hugh Rand How I tried to install it: install.packages('Cairo',,'http://www.rforge.net/')? What the message was: * Installi

Re: [R] Rcommander installation fails on Fedora 9

2008-08-15 Thread Paul Smith
John, I am not sure whether the following solves the problem, but you could try it: yum install gcc-gfortran Best, Paul On Fri, Aug 15, 2008 at 10:02 PM, John Sorkin <[EMAIL PROTECTED]> wrote: > Paul, > I installed R-devel as root, and then re-tried to install R-cmdr as a > regular users. Unf

Re: [R] Documenting a function: How to get the comments in a function similar to args()

2008-08-15 Thread Carl Witthoft
Along the lines of Gabor's method, presumably you could put a "spare" argument in your function: foo<- function(x,help=FALSE,...) { helpout<-c(comment, comment, end of comments) if(something_is_wrong_with_inputs || help=TRUE) { print(helpout) stop #or trycatch, or whatev

Re: [R] sem & testing multiple hypotheses with BIC

2008-08-15 Thread jebyrnes
Not that I know of. However, remember, the RAM format is just a matrix. It's fairly simple to write some code to scan through and make changes to models. For example, here's something to delete a specified path. It should be fairly simple to run through a set of paths, delete them piecewise, f

Re: [R] error in passing an argument to do.call when do.call is in a for statement

2008-08-15 Thread Smits N
Dear Dr. Ripley, Thank you very much for your comments concerning do.call and call. Obviously, until this week I was fully unaware of the existence of both functions. I changed the following code x<-do.call(method,methodArgs) into x<-call(method,Path) eval(x) and after deleting `

Re: [R] AOV and Error

2008-08-15 Thread Peter Dalgaard
Prof Brian Ripley wrote: See the reference on ?aov, and MASS (the book, see the FAQ). I think you need to understand the underlying theory first, and that is no longer (even for my time) part of a statistical education. I learnt it from Bill Venables who has educated in the 1960s -- so his a

  1   2   >