Re: [R] Restricted Least Squares

2008-08-15 Thread Prof Brian Ripley
On Sat, 16 Aug 2008, Nelson Villoria wrote: Dear R experts: Is there any package that estimates Restricted Least Squares? Specifically, If I want to fit: G = b0 + b1(Y) + a1(X1) + a2(X2) + a3(X3) + a4(X4) where Y, X1 to X4 are variables and b's and a's parameters to be estimated. I want to i

[R] Restricted Least Squares

2008-08-15 Thread Nelson Villoria
Dear R experts: Is there any package that estimates Restricted Least Squares? Specifically, If I want to fit: G = b0 + b1(Y) + a1(X1) + a2(X2) + a3(X3) + a4(X4) where Y, X1 to X4 are variables and b's and a's parameters to be estimated. I want to impose a1 + a2 + a3 + a4 = 0. Thanks, Nelson

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

2008-08-15 Thread Jim Holtman
The best way is to try it and see if you like it. I have used it on plots with 150,000 point and it provided a good picture of what was going on. Sent from my iPhone On Aug 15, 2008, at 13:52, Stephen Tucker <[EMAIL PROTECTED]> wrote: I thought running it through latex will compress the pdf

[R] Lattice: problem using panel.superpose and panel.groups

2008-08-15 Thread Michael Braun
Hi. I'm embarking on my first attempt at creating my own panel function for lattice graphics, and despite all of my online research and pouring through the documentation, I cannot figure out how to solve my particular problem. Hopefully, a generous fellow R user can help. I have some da

Re: [R] Multiple Regression with Correlation Matrix

2008-08-15 Thread William Revelle
Linda, At 4:36 PM -0700 8/15/08, Linda Zientek wrote: 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 yo

Re: [R] Multiple Regression with Correlation Matrix

2008-08-15 Thread Prof Brian Ripley
On Fri, 15 Aug 2008, Linda Zientek wrote: 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? Yes, it is possible, up to a point (

Re: [R] How to remove white spaces

2008-08-15 Thread Prof Brian Ripley
On Fri, 15 Aug 2008, Bos, Roger wrote: 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

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

2008-08-15 Thread Paulo Justiniano Ribeiro Jr
Ruben it is a bug I will upload a new version of geoR. Meanwhile please download the version with the fix from the geoR web page at www.leg.ufpr.br/geoR Paulo Justiniano Ribeiro Jr LEG (Laboratorio de Estatistica e Geoinformacao) Universidade Federal do Parana Caixa Postal 19.081 CEP 81.531-990

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

[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

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 mys

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

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

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

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

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 f

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

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

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

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

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

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

[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

[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

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:

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

[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

[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

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:

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

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

[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

[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

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

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

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

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

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

[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

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

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

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

[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

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

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

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

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

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

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

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

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

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

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

  1   2   >