[R] Need Help with R.oo and "multiple inheritance"

2009-04-17 Thread Ken-JP
This is what I'm trying to do: HasPersistence - an Interface class which implements things like WriteToDisk(), ReadFromDisk() B isA A C isA A, but also implements HasPersistence My solution in R.oo is to have a root class called A which implements IsPersistent() by returning FALSE, but is overri

Re: [R] Tinn-R (Version 2.2.0.2) dose not support R 2.9.0 very well

2009-04-17 Thread Ken-JP
Hi, I used Tinn-R for a long time, but had real headaches on Vista (commands not being sent, etc...) that were not resolved since R 2.8 or so. Since then, I have switched to Eclipse/StatET. The setup requires more effort, but it is much easier to manage your own packages. With the Eclipse IDE

Re: [R] install raster package on ubuntu

2009-04-17 Thread milton ruser
Oops. I found and are working fine #install.packages("raster", repos="http://R-Forge.R-project.org ") Thanks a lot, milton On Sat, Apr 18, 2009 at 2:00 AM, milton ruser wrote: > Dear all, > > I am running R 2.8.1. under ubuntu, and I need to install > the package

[R] install raster package on ubuntu

2009-04-17 Thread milton ruser
Dear all, I am running R 2.8.1. under ubuntu, and I need to install the package "raster" but I get the following error: > install.packages("raster") Warning in install.packages("raster") : argument 'lib' is missing: using '/usr/local/lib/R/site-library' --- Please select a CRAN mirror for use i

Re: [R] Binomial simulation

2009-04-17 Thread Johannes Huesing
beetle2 [Fri, Apr 17, 2009 at 11:28:56PM CEST]: > > Hi Guy's > I was wondering if someone could point me in the right direction. > > dbinom(10,1,0.25) > > I am using dbinom(10,1,0.25) to calculate the probabilty of 10 judges > choosing a certain brand x times. dbinom returns the discrete dens

[R] Binomial simulation

2009-04-17 Thread beetle2
Hi Guy's I was wondering if someone could point me in the right direction. dbinom(10,1,0.25) I am using dbinom(10,1,0.25) to calculate the probabilty of 10 judges choosing a certain brand x times. I was wondering how I would go about simulating 1000 trials of each x value ? regards Brendan -

[R] plotting effect confidence intervals

2009-04-17 Thread John Christie
Hi, I'm trying to work out plotting effect confidence intervals for a mixed effects design. For example, when measuring heights over age one will get two kinds of confidence intervals from the resulting model (using intervals in lme), a broad inference interval from the random intercept,

[R] merging multiple data frames based on X and Y coordinates

2009-04-17 Thread ddepew
Hi all, I'm a little stumped on this. I have 5 data frames with continuous GPS coordinates at 5 to 10 m spacing. Due to the different GPS units used, data collected within one to two sec apart have coordinates that differ by 3 to 5 m on average. I'd like to aggrate the data frames relative t

[R] Tinn-R (Version 2.2.0.2) dose not support R 2.9.0 very well

2009-04-17 Thread LI Qi
Hi£¬ I found that Tinn-R (Version 2.2.0.2) dose not support R 2.9.0 very well. Maybe, somebody who have solved this problem can help me. Thanks for your attention! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

Re: [R] From daily series to monthly and viceversa

2009-04-17 Thread Gabor Grothendieck
Here is a partial solution: library(zoo) # z is CPI. Just use 1, 2, 3, ... for example. z <- zooreg(1:12, as.yearmon("2008-01"), freq = 12) days.in.month <- as.numeric(as.Date(time(z), frac = 1) - as.Date(time(z)) + 1) z2 <- cbind(z, z1 = lag(z, -1), z2 = lag(z, -2), z3 = lag(z, -3), days.in.mont

Re: [R] Loop question

2009-04-17 Thread Ben Bolker
Brendan Morse wrote: > > Hi everyone, I am trying to accomplish a small task that is giving me > quite a headache. I would like to automatically generate a series of > matrices and give them successive names. Here is what I thought at > first: > > t1<-matrix(0, nrow=250, ncol=1) > > for

Re: [R] Loop question

2009-04-17 Thread Jorge Ivan Velez
Dear Brendan, One way could be either bigt <- sapply(1:10,function(x) rnorm(250)) colnames(bigt) <- paste('t',1:10,sep="") bigt or bigt2 <- NULL for(i in 1:10) bigt2 <- cbind( bigt2, rnorm(250) ) colnames(bigt2) <- paste('t',1:10,sep="") bigt2 or bigt3 <- matrix(rnorm(250*10),ncol=10) colnames

Re: [R] source code for prompt()

2009-04-17 Thread Ben Bolker
Markus Loecher-4 wrote: > > Dear R community, > pardon my ignorance but how would you get the source code for"non-visible > functions" ? > > For example, I would like to see and modify the source code for the > prompt() > function. > > prompt() is visible: > prompt function (object, filena

Re: [R] source code for prompt()

2009-04-17 Thread ronggui
> prompt function (object, filename = NULL, name = NULL, ...) UseMethod("prompt") > methods("prompt") [1] prompt.data.frame* prompt.default* Non-visible functions are asterisked > getAnywhere("prompt.default") 2009/4/18 Markus Loecher : > Dear R community, > pardon my ignorance but how would

[R] Loop question

2009-04-17 Thread Brendan Morse
Hi everyone, I am trying to accomplish a small task that is giving me quite a headache. I would like to automatically generate a series of matrices and give them successive names. Here is what I thought at first: t1<-matrix(0, nrow=250, ncol=1) for(i in 1:10){ t1[i]<-rnorm(250) }

Re: [R] args and test of passed paramters

2009-04-17 Thread Gabor Grothendieck
Check out the getopt package. On Fri, Apr 17, 2009 at 11:39 AM, Juergen Rose wrote: > Hi, > I would like to call a R script sometimes with: >  R --slave --vanilla --args Debug=1 N=25 < test.R > and sometimes with >  R --slave --vanilla Debug=1 < test.R > or similar. > > Inside the R script I get

[R] source code for prompt()

2009-04-17 Thread Markus Loecher
Dear R community, pardon my ignorance but how would you get the source code for"non-visible functions" ? For example, I would like to see and modify the source code for the prompt() function. Thanks! Markus [[alternative HTML version deleted]] __

Re: [R] Create histogram from data matrix

2009-04-17 Thread David Winsemius
Looks to me that Holtman's solution was perfect: > fdf <- read.table(textConnection(txt), header=T) > fdf IDdt Temp N.fish 1 2007061835456 2 2007061835765 3 2007061834567 4 2007061833876 5 2007061833888 6 2007061832111 7 200706184

Re: [R] changing Swaeve output settings for .pdf and .eps - is there a way?

2009-04-17 Thread cls59
cameron.bracken wrote: > > I know the first time I set width=3 and the plot still spanned 80% of > the page threw me off. > I second this. - Charlie Sharpsteen Undergraduate Environmental Resources Engineering Humboldt State University -- View this message in context: http://www.nab

Re: [R] Mischief on legend when size=1 added to geom_line

2009-04-17 Thread Felipe Carrillo
Hi Arthur: # Just move size outside 'aes' like this: p <- ggplot(df1, aes(Year, PctProf, group = Group)) p + geom_line(aes(color = Group),size=1) # to make the background white just use the black and white theme: p <- ggplot(df1, aes(Year, PctProf, group = Group)) p + geom_line(aes(color = Group)

Re: [R] Reading in a large number of dbf files

2009-04-17 Thread Steve_Friedman
Duncan, Thank you very much. I did not have a chance to examine this approach today. I will because I need to have this functionality. I appreciate you time and insights Steve Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor

Re: [R] Separating variables in read.table

2009-04-17 Thread Richardson, Patrick
Yes. attach() was what I was needing. Thanks to all those who replied. Patrick -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Johannes Huesing Sent: Friday, April 17, 2009 4:18 PM To: r-help@r-project.org Subject: Re: [R] Separ

[R] Thank You All for the help

2009-04-17 Thread Rajat .......
Hi All, I wish to thank all you guys out there. This is because of the help from you guys I am able to learn how to use R in a short time. Thanking you again for the help and quick responses. Regards, Rajat -- Rajat, PhD student Industrial Engineering, Texas Tech University, Lubbock, TX, USA.

Re: [R] real numeric variable transforms into factor:

2009-04-17 Thread Aldi Kraja
Thank you Marc for your detailed and helpful info. Aldi Marc Schwartz wrote: On Apr 17, 2009, at 2:52 PM, Aldi Kraja wrote: Hi Test made in: R in windows Vista OS, R version 2.8.1 From FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f "It may happ

Re: [R] Separating variables in read.table

2009-04-17 Thread Johannes Huesing
Richardson, Patrick [Fri, Apr 17, 2009 at 09:31:35PM CEST]: > If I have a table (we'll call it, "test") containing seven columns (as below): > > i x1 x2 x3 x4 x5 y > 0 1.125 0.232 7.160 0.0859 8.905 1.5563 > 7 0.920 0.268 8.804 0.0865 7.388 0.8976

Re: [R] real numeric variable transforms into factor:

2009-04-17 Thread Marc Schwartz
On Apr 17, 2009, at 2:52 PM, Aldi Kraja wrote: Hi Test made in: R in windows Vista OS, R version 2.8.1 From FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f "It may happen that when reading numeric data into R (usually, when reading in a file), they come

Re: [R] Separating variables in read.table

2009-04-17 Thread Phil Spector
Patrick - There's no simple way to do what you want, because R discourages you from having lots of separate related objects. Instead, you are encouraged to store your objects in an organized form, such as a list, data frame or matrix. For your example, I'm assuming you are using the word "

Re: [R] ColorRamp different from ColorRampPalette

2009-04-17 Thread Etienne B. Racine
Thanks Hadley, Is it the solution you would recommend ? rgb(pal.cr((0:40)/40), maxColorValue=255) Etienne hadley wrote: > > Look at the output of pal.cr((0:40)/40) > Hadley > > On Fri, Apr 17, 2009 at 2:42 PM, Etienne B. Racine > wrote: >> >> I try to use ColorRamp as ColorRampPalette (i.e.

Re: [R] ColorRamp different from ColorRampPalette

2009-04-17 Thread hadley wickham
Look at the output of pal.cr((0:40)/40) Hadley On Fri, Apr 17, 2009 at 2:42 PM, Etienne B. Racine wrote: > > I try to use ColorRamp as ColorRampPalette (i.e. with the same gradient), but > it seems there is a nuance that I've missed. > > pal.crp<-colorRampPalette( c("blue", "white", "red"), space

[R] real numeric variable transforms into factor:

2009-04-17 Thread Aldi Kraja
Hi Test made in: R in windows Vista OS, R version 2.8.1 From FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f "It may happen that when reading numeric data into R (usually, when reading in a file), they come in as factors. If |f| is such a factor object

Re: [R] Separating variables in read.table

2009-04-17 Thread Etienne Bellemare Racine
see ?attach Etienne Richardson, Patrick a écrit : > If I have a table (we'll call it, "test") containing two columns (as below): > > i x1 x2 x3 x4 x5 y > 0 1.125 0.232 7.160 0.0859 8.905 1.5563 > 7 0.920 0.268 8.804 0.0865 7.388 0.8976 > 150.83

[R] ColorRamp different from ColorRampPalette

2009-04-17 Thread Etienne B. Racine
I try to use ColorRamp as ColorRampPalette (i.e. with the same gradient), but it seems there is a nuance that I've missed. pal.crp<-colorRampPalette( c("blue", "white", "red"), space = "rgb") plot(rep(0,40),pch=16,col=pal.crp(40)) # is great But, using the same gradient with colorRamp is giving

Re: [R] Separating variables in read.table

2009-04-17 Thread Jorge Ivan Velez
Dear Patrick, Perhaps attach might be what you are looking for. attach(test) i x1 x2 . . . y HTH, Jorge On Fri, Apr 17, 2009 at 3:23 PM, Richardson, Patrick < patrick.richard...@vai.org> wrote: > If I have a table (we'll call it, "test") containing two columns (as > below): > > i x1

[R] Separating variables in read.table

2009-04-17 Thread Richardson, Patrick
If I have a table (we'll call it, "test") containing seven columns (as below): i x1 x2 x3 x4 x5 y 0 1.125 0.232 7.160 0.0859 8.905 1.5563 7 0.920 0.268 8.804 0.0865 7.388 0.8976 15 0.835 0.271 8.108 0.0852 5.348 0.7482 22 1.000

Re: [R] Generate bivariate binomial data

2009-04-17 Thread Charles C. Berry
On Fri, 17 Apr 2009, ONKELINX, Thierry wrote: Dear all, Could someone point me to a function or algorithm to generate random bivariate binomial data? Some details about what I'm trying to do. I have a dataset of trees who were categorised as not damaged or damaged. Each tree is measured twice

[R] Matrix package,solve() errors and crashes"

2009-04-17 Thread Surendar Swaminathan
Hello All, I am working on graph object using IGRAPH package wanted to do Bonacich Power. This is my graph object. The file 'Graph.RData' (4.2 MB) is available for download at http://dropbox.unl.edu/uploads/20090424/cfe4fcb854bb17f2/Graph.RData Graph size Vertices: 20984 Edges: 326033 Direct

[R] Separating variables in read.table

2009-04-17 Thread Richardson, Patrick
If I have a table (we'll call it, "test") containing two columns (as below): i x1 x2 x3 x4 x5 y 0 1.125 0.232 7.160 0.0859 8.905 1.5563 7 0.920 0.268 8.804 0.0865 7.388 0.8976 15 0.835 0.271 8.108 0.0852 5.348 0.7482 22 1.000

Re: [R] changing Swaeve output settings for .pdf and .eps - is there a way?

2009-04-17 Thread cameron.bracken
Duncan Murdoch-2 wrote: > > There are other ways to control the size: it isn't always 80%. I > normally use something like \setkeys{Gin}{width=0.75\textwidth} to control > it. You can reset this a > number of times in the same document. (Read the LaTeX docs for graphicx > to see the other

Re: [R] Create histogram from data matrix

2009-04-17 Thread Paul Warren Simonin
Thank you all for your advice. I have received some good tips, but it was suggested I write back with a small simulated data set to better illustrate my needs. So, currently my data frame looks something like: ID (date) Temperature Number of fish 200706183 5 456 200706183

[R] Monotone Transformation

2009-04-17 Thread Feng Jingyu
Hi, I am trying to use R to mimic what I did in SAS. proc transreg data=x ; model identity(GSI)=monotone(group1); output out=d2 pprefix=M; run; Accroding to SAS documentation, the MONOTONE transfomation algorithm comes from (Kruskal 1964, secondary approach to ties). I have

Re: [R] From daily series to monthly and viceversa

2009-04-17 Thread manta
any update anybody? I'm really stucked! -- View this message in context: http://www.nabble.com/From-daily-series-to-monthly-and-viceversa-tp23064454p23103052.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] Lattice xyplot with text under x-axis

2009-04-17 Thread kate.m
Still on this question, I'm having problems with displaying the text when repeated values are present. For example: library(lattice) year<-c(2001,2002,2003,2001,2002,2003,2001,2002,2003,2001,2002,2003) fac<-c("arts","arts","arts","arts","arts","arts","sci","sci","sci","sci","sci","sci") type<-c("

Re: [R] Create histogram from data matrix

2009-04-17 Thread jim holtman
here is one way: > mydata <- data.frame(observ=sample(1:10,20,TRUE), value=sample(1:6,20,TRUE)) > > mydata observ value 1 3 6 2 4 2 3 6 4 4 10 1 5 3 2 6 9 3 7 10 1 8 7 3 9 7 6 10 1 3 11 3 3

[R] Margins in lattice and device resolution

2009-04-17 Thread Gustaf Rydevik
Hi all, I believe I've run into this before, but I seem to have totally forgotten. No headway in the last couple of hours either. How do I make sure that points and margins remain the same absolute size as I change the resolution of a device? (I'm running 2.9.1 patched, on a Win XP-machine) Many

Re: [R] numbers loop in R

2009-04-17 Thread hadley wickham
On Fri, Apr 17, 2009 at 12:19 PM, jim holtman wrote: > try this: > >> matrixx<-function(A){ > +     B=matrix(NaN,nrow=(A+1),ncol=4) > +     k <- 1 > +     for (i in 3:A){ > +         for (j in i:A) { > +             B[k,] <- c(NaN, i-2, i-1, j) > +             k <- k + 1 > +         } > +     } >

Re: [R] R on Windows and RMySQL

2009-04-17 Thread Duncan Murdoch
On 4/17/2009 12:26 PM, Duncan Murdoch wrote: On 4/17/2009 12:26 PM, Duncan Murdoch wrote: On 4/17/2009 6:48 AM, s...@access.unizh.ch wrote: I have successfully installed R (version 2.8.1) and RMySQL (version 0.7-4) on my PC (Windows). Now I have a problem running RMySQL on R. I constantly rec

Re: [R] Create histogram from data matrix

2009-04-17 Thread hadley wickham
On Fri, Apr 17, 2009 at 9:59 AM, Paul Warren Simonin wrote: > Hello! >  Thanks for reading this request for assistance. I have a question regarding > creating a histogram-like figure from data that are not currently in the > correct format for the "hist" command. >  Specifically, my data have been

Re: [R] numbers loop in R

2009-04-17 Thread jim holtman
try this: > matrixx<-function(A){ + B=matrix(NaN,nrow=(A+1),ncol=4) + k <- 1 + for (i in 3:A){ + for (j in i:A) { + B[k,] <- c(NaN, i-2, i-1, j) + k <- k + 1 + } + } + B + } > matrixx(5) [,1] [,2] [,3] [,4] [1,] NaN123 [

Re: [R] numbers loop in R

2009-04-17 Thread David Winsemius
I would have expected to see the assignment to B[k,] inside the loops. And to see some connection with the k index in the inner loops if you did not want all of the rows to be similar. Because the assignment is outside the loops, it happens only once. -- David Winsemius On Apr 17, 2009, a

Re: [R] Create histogram from data matrix

2009-04-17 Thread stephen sefick
It would be easier if you were to make a data frame of fake values to illustrate your point, so that we could just copy it into an R session and see if we can't get it to work. So, a stab in the dark would to look at ggplot2 specifically the hist argument in qplot and the facets, the lattice packa

Re: [R] Using trace

2009-04-17 Thread Stavros Macrakis
Yes, that is similar to the solution in my original posting, but doesn't solve the problem I was having with that solution, namely reporting on the return value. -s On Fri, Apr 17, 2009 at 11:28 AM, ronggui wrote: > Here is a partial solution: > >> trace(fact,quote({cat(sprintf("x= %i

Re: [R] matching subvectors in vector sets

2009-04-17 Thread jim holtman
How about this: > x <- "A00096:A00096:A00096:A00096:A02178:A02178:A07776" > x.s <- unlist(strsplit(x, ":")) > for (i in 2:length(x.s)){ + x.seq <- embed(length(x.s):1, i) + print(table(apply(x.seq, 1, function(z){ + paste(x.s[z], collapse=":") + }))) + } A00096:A00096 A00096:A

Re: [R] issue with L-BFGS-B in optim (optim just hangs)

2009-04-17 Thread Ravi Varadhan
Tiago, If you have an improper integral, i.e. with at least one of the limits being infinite, it is generally not a good idea to use large positive or negative values to compute such integrals. You should use "integrate" (calling it twice) to compute your double integral. This might solve your p

Re: [R] R on Windows and RMySQL

2009-04-17 Thread Duncan Murdoch
On 4/17/2009 6:48 AM, s...@access.unizh.ch wrote: I have successfully installed R (version 2.8.1) and RMySQL (version 0.7-4) on my PC (Windows). Now I have a problem running RMySQL on R. I constantly receive the following error-message: Error in utils::readRegistry("SOFTWARE\\MySQL AB", hive

Re: [R] Numeric data calculated in bwplot

2009-04-17 Thread Deepayan Sarkar
On 4/17/09, Yuri Volchik wrote: > > Hi, > > i was wondering if there is a way to extract statistic calculated by the > function bwplot in numeric format, i.e. a list with values of borders mean > etc. See ?boxplot.stats -Deepayan __ R-help@r-proje

[R] numbers loop in R

2009-04-17 Thread emj83
I would like to create a matrix in R that looks similar to this: [,1] [,2] [,3] [,4] [1,] NaN 1 2 3 [2,] NaN 1 2 4 [3,] NaN 1 2 5 [4,] NaN 2 3 4 [5,] NaN 2 3 5 [6,] NaN345 I have the loop below: where A for example is 5 matrixx<-function(A){ B=matrix(NaN,

[R] R on Windows and RMySQL

2009-04-17 Thread silv
I have successfully installed R (version 2.8.1) and RMySQL (version 0.7-4) on my PC (Windows). Now I have a problem running RMySQL on R. I constantly receive the following error-message: Error in utils::readRegistry("SOFTWARE\\MySQL AB", hive = "HLM", maxdepth = 2) : Registry-Schlüssel '

Re: [R] issue with L-BFGS-B in optim (optim just hangs)

2009-04-17 Thread Tiago Marques
Dear R-help list, Just a wrap up for this issue. Thanks to Ravi Varadan and Paul Smith for useful feedback (both on and off list). It seems like the culprit was another function being called within optim, namely adapt (used to solve numerically a double integral in the likelihood I am maximi

Re: [R] Generate bivariate binomial data

2009-04-17 Thread Christian Ritz
Hi Thierry, I think it should be possible to generate such correlated data using a mixed model approach: 1) Generate pairs of correlated linear predictor values using an ordinary linear mixed model setup (for example using rnorm() repeatedly) 2) Back-transform these values using the inverse l

[R] args and test of passed paramters

2009-04-17 Thread Juergen Rose
Hi, I would like to call a R script sometimes with: R --slave --vanilla --args Debug=1 N=25 < test.R and sometimes with R --slave --vanilla Debug=1 < test.R or similar. Inside the R script I get the arguments with: args=(commandArgs(TRUE)) if(length(args)==0){ print("===No arguments s

Re: [R] Using trace

2009-04-17 Thread ronggui
Here is a partial solution: > trace(fact,quote({cat(sprintf("x= %i\n",x));return}),print=T) [1] "fact" > fact(4) Tracing fact(4) on entry x= 4 Tracing fact(x - 1) on entry x= 3 Tracing fact(x - 1) on entry x= 2 Tracing fact(x - 1) on entry x= 1 Tracing fact(x - 1) on entry x= 0 [1] 24 2009/4/17

Re: [R] error bars in matplot

2009-04-17 Thread Tim Smith
Thanks Mathieu and Jim, That worked! From: Jim Lemon Cc: r Sent: Friday, April 17, 2009 7:45:39 AM Subject: Re: [R] error bars in matplot Tim Smith wrote: > Hi, > > I was trying to get error bars in my matplot. I looked at an earlier thread, > and the sa

[R] Generate bivariate binomial data

2009-04-17 Thread ONKELINX, Thierry
Dear all, Could someone point me to a function or algorithm to generate random bivariate binomial data? Some details about what I'm trying to do. I have a dataset of trees who were categorised as not damaged or damaged. Each tree is measured twice (once in two consecutive years). The trees can r

Re: [R] Using trace

2009-04-17 Thread Stavros Macrakis
Well, yes, of course I could add the code to the function by hand. I could also calculate square roots by hand. But -- as in every other basic programming environment -- there exists an R function 'trace' which appears to automate the process, and I can't figure out how to use it to handle this m

[R] Create histogram from data matrix

2009-04-17 Thread Paul Warren Simonin
Hello! Thanks for reading this request for assistance. I have a question regarding creating a histogram-like figure from data that are not currently in the correct format for the "hist" command. Specifically, my data have been processed and are in a matrix with columns containing the var

Re: [R] Color of points in a 3d plot of a PCA

2009-04-17 Thread Duncan Murdoch
On 4/17/2009 10:43 AM, Alejandro González wrote: Dear all, I'm trying to perform a principal components analysis of a sample of individuals, and to plot it in 3D, assigning different colors according to the population each individual belongs to. Given that the matrix I have to use for the PCA

Re: [R] Modular Arithmetic Error?

2009-04-17 Thread Marc Schwartz
On Apr 17, 2009, at 9:29 AM, iuhz7j...@sneakemail.com wrote: A few further oddities (no longer having to do with modular arithmetic): (0.3 * 3) == 0.9 [1] FALSE (0.2 * 6) == 1.2 [1] FALSE This is bad behavior, right? No... > (0.3 * 3) - 0.9 [1] -1.110223e-16 > (0.2 * 6) - 1.2 [1] 2.2

[R] Color of points in a 3d plot of a PCA

2009-04-17 Thread Alejandro González
Dear all, I'm trying to perform a principal components analysis of a sample of individuals, and to plot it in 3D, assigning different colors according to the population each individual belongs to. Given that the matrix I have to use for the PCA cannot contain cualitative variables (here, the p

Re: [R] Modular Arithmetic Error?

2009-04-17 Thread iuhz7j202
That explains it, thanks. all.equal() gets it right. I always knew I had to be careful with rounding errors, just not with something like (0.2*6)... I guess I'll just have to avoid using '%%' or '%/%' with non-integers, at least if I need it to sometimes come out even. Thanks again, Peter > That

Re: [R] Modular Arithmetic Error?

2009-04-17 Thread Dimitris Rizopoulos
check the R FAQ, and in particular entry 7.31: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f Best, Dimitris iuhz7j...@sneakemail.com wrote: A few further oddities (no longer having to do with modular arithmetic): (0.3 * 3) == 0.9 [1] FAL

Re: [R] Coloring X, Y and Main Label

2009-04-17 Thread Jorge Ivan Velez
Dear Gundala, See col.lab and col.main arguments in ?par. plot(1,col.lab='red',col.main='blue',main='Title here') HTH, Jorge On Fri, Apr 17, 2009 at 10:14 AM, Gundala Viswanath wrote: > Dear all, > > I have no problem coloring the axis and plot, > following these procedures: > > http://www.n

Re: [R] Modular Arithmetic Error?

2009-04-17 Thread Doran, Harold
You should read the FAQ 7.31 > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of > iuhz7j...@sneakemail.com > Sent: Friday, April 17, 2009 10:30 AM > To: r-help@r-project.org > Subject: Re: [R] Modular Arithmetic Error? > > A f

Re: [R] Modular Arithmetic Error?

2009-04-17 Thread ONKELINX, Thierry
That is more or less FAQ 7.31: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-the se-numbers-are-equal_003f ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nat

Re: [R] Modular Arithmetic Error?

2009-04-17 Thread iuhz7j202
A few further oddities (no longer having to do with modular arithmetic): > (0.3 * 3) == 0.9 [1] FALSE > (0.2 * 6) == 1.2 [1] FALSE This is bad behavior, right? I feel like I'm going crazy. I'm using R version 2.8.1 (2008-12-22). Thanks, Peter __ R-he

[R] Modular Arithmetic Error?

2009-04-17 Thread iuhz7j202
Hi, I'm using the '%%' operator in some code, and am running into the following erroneous outcome: > 1.2 %% 0.2 [1] 0.2 Unless I'm very mistaken, the result should be 0 (indeed, 12 %% 2 does result in 0). Furthermore: > 1.20001 %% 0.2 [1] 0.2 > (1.2+1e17) %% .2 [1] 0

[R] Coloring X, Y and Main Label

2009-04-17 Thread Gundala Viswanath
Dear all, I have no problem coloring the axis and plot, following these procedures: http://www.nabble.com/Coloring-X-and-Y-axis-tt22989739r0.html#a22989739 However the X,Y and Main Label stays in black. How can we change their colors? - Gundala Viswanath Jakarta - Indonesia ___

Re: [R] Lattice xyplot with text under x-axis

2009-04-17 Thread kate.m
A million thanks Deepayan! That works great. Deepayan Sarkar wrote: > > On Wed, Apr 15, 2009 at 8:59 AM, kate.m wrote: >> >> Hi All, >> >> I have a data set which I need to plot and show the values of one of the >> variables as a second x-axis. >> >> library(lattice) >> year<-c(2001,2002,2003

Re: [R] cast function in package reshape

2009-04-17 Thread hadley wickham
On Fri, Apr 17, 2009 at 8:38 AM, David Hajage wrote: > Hello R useRs, > > I have a function which returns a list of functions : > > freq1 <- function(x) { >  lev <- unique(x[!is.na(x)]) >  nlev <- length(lev) >  args <- alist(x=) > >  if (nlev == 1) { >    body <- c("{", "sum(!is.na(x))", "}") >  

Re: [R] S+FinMetrics

2009-04-17 Thread Patrick Burns
Resources include: * Rmetrics * The finance task view on CRAN * The R-sig-finance mailing list Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of "The R Inferno" and "A Guide for the Unwilling S User") Hassan Mohamed wrote: please !, what is the R equ

Re: [R] Presenting R Results in Webpages

2009-04-17 Thread David Hajage
and also R2HTML. 2009/4/17 David Hajage > You could perhaps use asciidoc and ascii > package (but I'm not sure you could > obtain exactly the layout you describe...). > > 2009/4/17 Jim Lemon > > Jason Rupert wrote: >> >>> I ap

[R] S+FinMetrics

2009-04-17 Thread Hassan Mohamed
please !, what is the R equivalents for the S-plus package : S+FinMetrics thanks hassan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

Re: [R] Presenting R Results in Webpages

2009-04-17 Thread David Hajage
You could perhaps use asciidoc and ascii package (but I'm not sure you could obtain exactly the layout you describe...). 2009/4/17 Jim Lemon > Jason Rupert wrote: > >> I apologize in advance that this question is not specific t

[R] cast function in package reshape

2009-04-17 Thread David Hajage
Hello R useRs, I have a function which returns a list of functions : freq1 <- function(x) { lev <- unique(x[!is.na(x)]) nlev <- length(lev) args <- alist(x=) if (nlev == 1) { body <- c("{", "sum(!is.na(x))", "}") f <- function() {} formals(f) <- as.pairlist(args) body(f)

Re: [R] matching subvectors in vector sets

2009-04-17 Thread Albert Vilella
Starting by the first entry: A00096:A00096:A00096:A00096:A02178:A02178:A07776 and supposing there aren't any other subvectors identical in the set, the algorithm will slide through the vector, first in pairs, then in trios, then in sets of four, etc, and count the occurrences: A00096:A00096 3 A00

Re: [R] Kruskal's MDS results

2009-04-17 Thread Dieter Vanderelst
Thank you for clearing this out. Jari Oksanen wrote: Dieter Vanderelst ua.ac.be> writes: The point is that the manual for the isoMDS function says it's stress output is in "percent". Does this mean, the stress reported by isoMDS is just the stress value in MASS (which ranges from 0 to 1)

[R] How to create the null distribution

2009-04-17 Thread Anders Bjorn
Hi, I want to bootstrap the likelihood ratio test for testing linear restrictions on the parameters of a regression model. The aim is to perform a size and power analysis. My question is, as indicated by the subject, how do I approximate the null distribution? The code that I ran looks like > boo

Re: [R] Numeric data calculated in bwplot

2009-04-17 Thread stephen sefick
library(lattice) x <- bwplot(voice.part ~ height, data=singer, xlab="Height (inches)") str(x) I have not done this before, but the output of str should give you a starting point for extracting numeric values contained in one of the numerous lists. hope this helps Stephen Sefick On Fri, Apr 17,

[R] Using spdep example data and R code : bbox should never contain infinite values

2009-04-17 Thread Dejan Gregor
Hi, I am facing with a problem when running a code against the sample data from spdep. I am getting "SpatialPoints" object : bbox should never contain infinite values In additionl Warning Messages: 1. In min(x): no non-missing arguments to min; returning Inf 2. In max(x): no non-missing arg...

Re: [R] Kruskal's MDS results

2009-04-17 Thread Jari Oksanen
Dieter Vanderelst ua.ac.be> writes: > > The point is that the manual for the isoMDS function says it's stress output is in "percent". Does this mean, > the stress reported by isoMDS is just the stress value in MASS (which ranges from 0 to 1) value multiplied by > 100? I've haven't been able to

Re: [R] multiplot plot spacing and text strip

2009-04-17 Thread jim holtman
?par(mar=...) ?mtext On Thu, Apr 16, 2009 at 11:31 PM, rajesh j wrote: > Hi everyone, > > I have a certain requirement and I'm not sure what to do.I need to reduce > the spacing between plots in a multiplot. Make them really close together > such that they almost touch. > Also, I need to add a re

Re: [R] How to control distance between rows of figures in multiple plots

2009-04-17 Thread jim holtman
?par look at the 'mar' parameter. On Thu, Apr 16, 2009 at 11:54 PM, Gundala Viswanath wrote: > Dear all, > > I have a plot with 2 x 2 figures matrix in it. > > pdf("~/Desktop/myplot.pdf",width=13,height=7) > par(mfrow=c(2,2)) > # follow by some code > > Now the distance between figures of row 1

[R] Numeric data calculated in bwplot

2009-04-17 Thread Yuri Volchik
Hi, i was wondering if there is a way to extract statistic calculated by the function bwplot in numeric format, i.e. a list with values of borders mean etc. Going through the help i couldn't find it, and text of the function itself(bwplot) is very long. Thanks -- View this message in context:

Re: [R] Manipulate single line in textfile

2009-04-17 Thread jim holtman
You can also read/write portions of the text till you get to the line you want to change, change it and then continue copying the lines. This is what would be done with any other software approach in trying to replace 'text' that may not be the same length. On Fri, Apr 17, 2009 at 4:20 AM, Guillau

Re: [R] Presenting R Results in Webpages

2009-04-17 Thread Jim Lemon
Jason Rupert wrote: I apologize in advance that this question is not specific to R, but I thought some R users may be using this in their work process flow. I would like to be able to have a tool (prefer "scriptable") that will take two images and some pre-written text and put it on an simple we

Re: [R] error bars in matplot

2009-04-17 Thread Jim Lemon
Tim Smith wrote: Hi, I was trying to get error bars in my matplot. I looked at an earlier thread, and the sample code that I made is: #-- library(plotrix) mat1 <- matrix(sample(1:30,10),nrow=5,ncol=2) ses <- matrix(sample(1:3,10,replace=T),nrow=5,ncol=2) vect <- seq(20,100,20)

Re: [R] Kruskal's MDS results

2009-04-17 Thread Jari Oksanen
Dieter Vanderelst ua.ac.be> writes: > > A few people suggested taking a look at Ripley's book MASS. I know the formula listed there. > > The point is that the manual for the isoMDS function says it's stress output is in "percent". Does this mean, > the stress reported by isoMDS is just the stre

Re: [R] map of china without regions

2009-04-17 Thread Roger Bivand
Ray Brownrigg ecs.vuw.ac.nz> writes: > > Sorry, can't be done at the moment with the maps package. > ... > > You *might* be able to achieve what you want by selecting only those line segments that > provide portions of the external border, but I would suggest that other packages (perhaps > s

Re: [R] changing Swaeve output settings for .pdf and .eps - is there a way?

2009-04-17 Thread Duncan Murdoch
cameron.bracken wrote: markheckmann wrote: The pdf() settings do not affect Sweave settings when producing a .pdf graphic. How can I change the Sweave default settings to e.g. 3 inch? Also, even if you set the width of your plot to 3 inches, the plot will be expanded to 80% of the te

[R] multiplot numbering

2009-04-17 Thread rajesh j
Hi, I have a multiplot in which i need to label each plot as (a) (b) etc. preferably on the right side of each plot. My layout is one plot below the other.How can i do this? -- Rajesh.J [[alternative HTML version deleted]] __ R-help@r-project

Re: [R] get() versus getAnywhere()

2009-04-17 Thread Duncan Murdoch
Benjamin Tyner wrote: Many thanks Duncan. Perhaps this merits a more explicit note in the documentation? The quote I gave is from the documentation. How could it be more explicit? Duncan Murdoch Duncan Murdoch wrote: On 4/16/2009 9:52 AM, Benjamin Tyner wrote: Hi Using R 2.8.1.

  1   2   >