Re: [R] Vectorization of duration of the game in the gambler ruin's problem

2008-08-15 Thread Moshe Olshansky
Hi Jose, If you are only interested in the expected duration, the problem can be solved analytically - no simulation is needed. Let P be the probability to get total.capital (and then 1-P is the probability to loose all the money) when starting with initial.capital. This probability P is well

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

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 people using get() for

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 characters, such

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] 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 -

[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:

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 (X == TRUE) [1] FALSE Ta da

[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 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

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, for

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

[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

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

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-

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

[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

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:

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. Code that

[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

[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, ...) : RS-DBI

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

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 something

[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.

[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

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 tell

[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

Re: [R] Row-Column design

2008-08-15 Thread Dieter Menne
Marc Moragues Canela marc.moragues at 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

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Dieter Menne
Roger Leenders r.t.a.j.leenders at 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

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

[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 TRUE

[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

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 -

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

[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

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 below.

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],

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

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 the problem?

[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,

[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) file

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(...)

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 time and resources

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,

[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

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: [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 has

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;

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

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 having

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

2008-08-15 Thread Ben Bolker
Schreiber, Stefan Stefan.Schreiber at 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

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

2008-08-15 Thread Ben Bolker
Nazareno Andrade nazareno at 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

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 warnings() is

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 resources

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:

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] 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

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

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 list! I

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:

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 messages

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

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 column. Any

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 of it

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

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, 2008

[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.

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

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, the

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: *

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.

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 whatever

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,

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

[R] simple shaded rectangle overlay on plots

2008-08-15 Thread Simon Melov
Hi, I'm sure this is pretty straightforward, but I cant seem to figure it out after playing around with grid, and a number of other packages for graphing I have data of the following type (much larger of course, and in this case is named Medoid4). The first column defines the x-axis, while

Re: [R] Problem with using read.csv with web address

2008-08-15 Thread Peter Dalgaard
Barry Rowlingson wrote: 2008/8/12 Aiste Aistike [EMAIL PROTECTED]: Hello, I have a problem with using read.csv(). I want to read a table from the ONS neighborhood statistics website which has an address: [snippage] There's also bits of JavaScript and other cruft in there. I can't

[R] x axis with multhist

2008-08-15 Thread Nathan Clement
I have lots of data that needs to be viewed as a histogram, and I've found the multhist package to work quite nicely--for the most part. The only problem is that I can't figure out a way to get the x-axis to make any logical sense. I have a data set with exactly 26 different values, but

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

2008-08-15 Thread Schreiber, Stefan
Thanks for steering me in the right direction! However, I did it slightly different: require(zoo) x - yearmon(1993 + seq(0, 167)/12) plot(mydata$CMI~x) Thanks! Stefan -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Friday, August 15, 2008 2:06 PM To:

Re: [R] Frequency vector

2008-08-15 Thread emir.toktar
Hi Dennis, you could get the result using 2 approachs: 1) a - c(1,1,1,1,2,3,4,5,5) b - table(a) print (b[1]) 1 4 Now, print (b[[1]]) 4 rownames(b) [1] 1 2 3 4 5 c =rownames(b) print(c[1]) 1 2) b= tabulate(a) b [1] 4 1 1 1 2 print(b[1]) [1] 4 Emir Toktar -Original

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

2008-08-15 Thread Gabor Grothendieck
Note that this works: y - rnorm(168) z - zooreg(y, start = as.yearmon(1993), freq = 12) plot(z) and this also works and does not require zoo but won't automatically put ticks on the months: tt - ts(y, start = 1993, freq = 12) plot(tt) On Fri, Aug 15, 2008 at 7:13 PM, Schreiber, Stefan [EMAIL

Re: [R] dbConnect

2008-08-15 Thread Paul Gilbert
Christiane Reuter wrote: 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

[R] How to remove white spaces

2008-08-15 Thread Bos, Roger
All, I am storing a string of email addresses in a table and when I retrieve them using a RODBC statement such as: test = sqlQuery(xf, select specialist from roger_sector_specialist)$specialist 'test' is of mode list and includes a bunch of white space. As a work-around I convert 'test' to a

[R] Multiple Regression with Correlation Matrix

2008-08-15 Thread Linda Zientek
Hello,   In SPSS, a multiple regression can be conducted by inputting the means, standard deviations, sample size, and correlation matrix without actually using the raw dataset. Is it possible to do the same in R?   Thanks in advance for your assistance.   Linda [[alternative HTML

  1   2   >