Re: [R] how to increase the limit for max.print in R

2009-03-31 Thread pooja arora
Hey , Thanks for the command I tried the same function as u mentioned I got a warning like Warning message: NAs introduced by coercion Any pointers what does that mean? I am using a 64 bit Linux(red hat) machine Thanks and Regards, Pooja Arora -Original Message- From: r-help-boun.

[R] repeated measures ANOVA - among group differences

2009-03-31 Thread Jessica L Hite/hitejl/O/VCU
I have data on the proportion of clutches experiencing different fates (e.g., 4 different sources of mortality) for 5 months . I need to test 1) if the overall proportion of these different fates is different over the entire study and 2) to see if there are monthly differences within (and among)

Re: [R] Merge two variables together

2009-03-31 Thread jimdare
Thanks guys jimdare wrote: > > Hello, > > If I have two variables: > > v1<-c(2,4,2,3,7,8) > v2<-c(0,0,0,0,0,0) > > how can I merge them to form > > v3<-2,0,4,0,2,0,3,0,7,0,8,0 > > I am trying to use this to get an xyplot to label every second x tick mark > (i.e. by replacing v1 with every

[R] Variable Wildcard Value

2009-03-31 Thread Francis Smart
Is there a wildcard value for vector values in r? For instance: > M <- *wildcard > (M==1) TRUE >(M=="peanut butter") TRUE >is.na(M) FALSE thanks, Francis -- Francis Smart (406) 223-8108 cell __ R-help@r-project.org mailing list https://stat.ethz.

Re: [R] Deriving Samples from specific, not implemented PDF for a QQ-Plot

2009-03-31 Thread David Winsemius
On Mar 31, 2009, at 11:53 AM, Arndt Zimmermann wrote: this is my first post to the R-help, so please don't be too strict. Reproducible examples should not be too much to expect, since that is requested in the posting guide and multiple other locations. My problem concerns a QQ-Plot: I

[R] problems with package tutorial

2009-03-31 Thread markleeds
Hi: Here's my revised attempt at explaining my problem. Hopefully it won't get sent out weirdly like it did earlier.  The link to what I'm trying to follow is http://www.stat.columbia.edu/~gelman/stuff_for_blog/AlanRPackageTutorial.pdf  I've been going through the tutorial but wh

Re: [R] Fedora 10 KDE plasma font rendering issue

2009-03-31 Thread dfermin
Nope. I checked this. Both those fonts are installed. Martyn Plummer-2 wrote: > > Quoting dfermin : >> >> Hello. >> >> I've got a new workstation running Fedora 10 linux and I use the KDE 4.2 >> desktop which uses some kind of new desktop environment called 'plasma'. >> >> If I start up R and

Re: [R] error message obtained when plotting survival curves (error not previously obtained)

2009-03-31 Thread David Winsemius
I cannot reproduce the error: > sessionInfo() R version 2.8.1 Patched (2009-01-19 r47650) i386-apple-darwin9.6.0 locale: en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] splines stats graphics grDevices utils datasets methods base other attached

Re: [R] Adjusting font size in a lattice graph

2009-03-31 Thread David Winsemius
On Mar 31, 2009, at 10:38 PM, David Winsemius wrote: > tp1.nDai=xyplot(value ~ yr | Name, data = nDai,type = 'o') Error in eval(substitute(groups), data, environment(x)) : object "nDai" not found > update(tp1.nDai, aspect = c(0.8), layout = c(4, 4)) Error in update(tp1.nDai, aspect = c(0.8), l

Re: [R] Selecting Bootstrap Statistics in the boot package

2009-03-31 Thread Jorge Ivan Velez
Many, many thanks to Phil Spector and David Winsemius for their helpful advice regarding this. Phil Spector suggested me to use library(boot) xx = getAnywhere('print.boot') myprint = xx$objs[[1]] myprint = edit(myprint,editor='notepad') vi(myprint) to edit the function deleting the original func

Re: [R] Adjusting font size in a lattice graph

2009-03-31 Thread David Winsemius
> tp1.nDai=xyplot(value ~ yr | Name, data = nDai,type = 'o') Error in eval(substitute(groups), data, environment(x)) : object "nDai" not found > update(tp1.nDai, aspect = c(0.8), layout = c(4, 4)) Error in update(tp1.nDai, aspect = c(0.8), layout = c(4, 4)) : object "tp1.nDai" not found (Not

Re: [R] Selecting Bootstrap Statistics in the boot package

2009-03-31 Thread David Winsemius
Greetings Jorge; There certainly did not seem to be something readily apparent with str(bmean), so the next logical place to look would be for a print method. If you look at print.boot with: getAywhere(print.boot) ... you see that the first portion sets up an internal structure called "

Re: [R] RMySQL compile

2009-03-31 Thread sten...@go.com
Jeff, it still cannot find mysql.h * Installing to library '/export/home/scb/R/i386-pc-solaris2.11-library/2.8' * Installing *source* package 'RMySQL' ... checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works...

[R] Adjusting font size in a lattice graph

2009-03-31 Thread Andrew McFadden
Hi all I have created a lattice graph but the text appears too big. Just wondering if there was a way I could change the font size. tp1.nDai=xyplot(value ~ yr | Name, data = nDai,type = 'o') update(tp1.nDai, aspect = c(0.8), layout = c(4, 4)) I would appreciate your help. Kind regards andy A

Re: [R] scope of variables in R

2009-03-31 Thread Stavros Macrakis
On Tue, Mar 31, 2009 at 3:41 PM, Wacek Kusnierczyk < waclaw.marcin.kusnierc...@idi.ntnu.no> wrote: > Stavros Macrakis wrote: > > ...All that being said, programming with global variables makes certain > classes of bug much more likely > > ... in a language like r, that heavily relies on settin

Re: [R] convert table to list

2009-03-31 Thread herwig
Thanks a lot, Problem solved, Herwig :-D -- View this message in context: http://www.nabble.com/convert-table-to-list-tp22810143p22815557.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://sta

[R] Multicollinearity with brglm?

2009-03-31 Thread woodbomb
I'm running brglm with binomial loguistic regression. The perhaps multicollinearity-related feature(s) are: (1) the k IVs are all binary categorical, coded as 0 or 1; (2) each row of the IVs contains exactly C (< k) 1's; (3) k IVs, there are n * k unique rows; (4) when brglm is run, at least

Re: [R] unicode only works with a second one

2009-03-31 Thread Paul Murrell
Hi Thomas Steiner wrote: > unfortunately in my.symbols there are no zodiac signs, so I have to > choose unicode which does not work for me yet. Another workaround is to use the Hershey fonts. For example ... plot(c(-1,1),c(-4,-2),type="n") text(x=0, y=-3.0, "\\VE \\MA", family="HersheySerif",

Re: [R] how to increase the limit for max.print in R

2009-03-31 Thread Bernardo Rangel Tura
On Tue, 2009-03-31 at 15:51 +0530, pooja arora wrote: > Thanks, it Worked. > Do you have any idea how much is the max limit for max.print > > > Thanks and Regards, > Pooja Arora Hi Pooja, In this case max is; options(max.print=.Machine$double.xmax) In my case I have a compiled R 2.8.1 in AMD

Re: [R] Merge two variables together

2009-03-31 Thread jim holtman
try this: > v1<-c(2,4,2,3,7,8) > v2<-c(0,0,0,0,0,0) > as.vector(rbind(v1,v2)) [1] 2 0 4 0 2 0 3 0 7 0 8 0 On Tue, Mar 31, 2009 at 7:46 PM, jimdare wrote: > > Hello, > > If I have two variables: > > v1<-c(2,4,2,3,7,8) > v2<-c(0,0,0,0,0,0) > > how can I merge them to form > > v3<-2,0,4,0,2,0,3,0

Re: [R] ggplot: order of numeric factor levels?

2009-03-31 Thread hadley wickham
On Tue, Mar 31, 2009 at 5:01 PM, Marianne Promberger wrote: > Hi, > > I'm having problems with qplot and the order of numeric factor levels. > > Factors with numeric levels show up in the order in which they appear > in the data, not in the order of the levels (as far as I understand > factors!) >

Re: [R] Doubt(load large amount of data) -reg

2009-03-31 Thread jim holtman
I assume that you mean a file sie of 566MB? Is this the size of the text file? If so how is the text file structured? What type of system are you running? How much physical memory do you have? What kind of processing do you want to do with the data? Do you have to have all of it at once? For

[R] Merge two variables together

2009-03-31 Thread jimdare
Hello, If I have two variables: v1<-c(2,4,2,3,7,8) v2<-c(0,0,0,0,0,0) how can I merge them to form v3<-2,0,4,0,2,0,3,0,7,0,8,0 I am trying to use this to get an xyplot to label every second x tick mark (i.e. by replacing v1 with every second year and v2 with ""). -- View this message in cont

Re: [R] error when going through Alan Lenarcic's package Tutorial

2009-03-31 Thread markleeds
apologies for my screwed up send. it looks really funked when I read it so my mail settings must be messed up. I'll resend it later tonight from a different computer. On Mar 31, 2009, markle...@verizon.net wrote: Hi Everyone: I've been going through Alan Lenarcic's package tu

[R] error when going through Alan Lenarcic's package Tutorial

2009-03-31 Thread markleeds
Hi Everyone: I've been going through Alan Lenarcic's package tutorial but when I did R CMD SHLIB Xdemo.cc Xdemo_main.cc -o Xdemo.dll I got the following error: XDemo_res.rc:15:38: warning: missing terminating " character XDemo_res.rc:23:34: warning: missing terminating ' charact

Re: [R] Reading from Google Docs

2009-03-31 Thread Farrel Buchinsky
It worked. Thank you Gabor Grothendieck. I have very little idea of what I did but I did it and it works. It is working well when I limit getDocs to documents only. However if I include everything in my request or just limit it to spreadsheets I get the following error. getDocs(con, what = "http

[R] using "substitute" inside a legend

2009-03-31 Thread Mathew Fox
Hello list, I have a linear regression: mylm = lm(y~x-1) I've been reading old mail postings as well as the plotmath demo and I came up with a way to print an equation resulting from a linear regression: model = substitute(list("y"==slope%*%"x", R^2==rsq), list(slope=round(mylm$coefficients[[1]

Re: [R] unicode only works with a second one

2009-03-31 Thread Thomas Steiner
unfortunately in my.symbols there are no zodiac signs, so I have to choose unicode which does not work for me yet. Thomas 2009/3/31 Thomas Steiner : > Thanks for the feedback. > I did now try Vista (2.8.1), XP (2.9.0alpha) and Win2000 (2.8.1) and > non did work compeletely, only on Vista/2.8.1 I

[R] ggplot: order of numeric factor levels?

2009-03-31 Thread Marianne Promberger
Hi, I'm having problems with qplot and the order of numeric factor levels. Factors with numeric levels show up in the order in which they appear in the data, not in the order of the levels (as far as I understand factors!) Here is a minimal example: library(ggplot2) y <- c(-1,2,0,0,-2,-1) z <-

Re: [R] Fedora 10 KDE plasma font rendering issue

2009-03-31 Thread plummer
Quoting dfermin : > > Hello. > > I've got a new workstation running Fedora 10 linux and I use the KDE 4.2 > desktop which uses some kind of new desktop environment called 'plasma'. > > If I start up R and generate a plot (for example: hist(rnorm(1, mean=0, > sd=1), breaks=100) ). The plot appea

[R] Selecting Bootstrap Statistics in the boot package

2009-03-31 Thread Jorge Ivan Velez
Dear all, Let's say I have the following: # Loading the boot package # install.packages(boot) library(boot) # Generating data set.seed(123) x <- rnorm(100) # Bootstrap for the sample mean bmean <- boot(x, function(x,d) mean(x[d]), R=1000) bmean # #ORDINARY NONPARAMETRIC BOOTSTRAP # # #Call: #bo

[R] How to load data from BLS web

2009-03-31 Thread guox
I would like to load the producer price indexes of BLS (Bureau of Labor Statistics) into R: For example, Commodity Data in http://www.bls.gov/ppi/ There are many tables there. I was wondering if you knew some R-package/function that can do this or any basic idea onwriting functions to load data t

Re: [R] How to generate natural cubic spline in R?

2009-03-31 Thread Frank E Harrell Jr
David Winsemius wrote: The splinefun documentation indicates that "natural" is one of the types of cubic spline options available. Does rcs actually do fitting? Such would not be my expectation on reading the documentation and I do not see any examples of such functionality in the help pages.

[R] error message obtained when plotting survival curves (error not previously obtained)

2009-03-31 Thread Bob Green
Hello, I now receive an error message when obtaining a survival plot, which was not previously received with the same code. I recently updated all my packages. It does not seem to be a peculiarity of my data as I receive the error using data available in R. A plot is produced but I am uncert

[R] joint distribution of ordered normal random variables

2009-03-31 Thread li li
Hi Does anyone know whether in R there is a function for the joint distribution of the ordered normal random variables? Thanks a lot! Hannah [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz

Re: [R] convert table to list

2009-03-31 Thread Peter Alspach
Tena koe Herwig I am guessing that you are not using the terms 'table' and 'list' in the R sense, and suggest you might want either the reshape() function or Hadley Wickham's 'reshape' package. For the former, if your data is in a data.frame (which is a special type of list) then: > herwig A

[R] [R-pkgs] WriteXLS: New version 1.6.0 - Binary CRAN packages available and other changes

2009-03-31 Thread Marc Schwartz
Hi all, A new version of the WriteXLS package, 1.6.0, is making its way around the CRAN mirrors and should be generally available in the next 24-48 hours. The WriteXLS package provides a cross-platform perl based R function to create Excel (XLS) files from one or more data frames. Each da

Re: [R] Lomb periodograms

2009-03-31 Thread Josué Polanco
Hi All, hi Bernardo, I think that the problem is when you remove 2*n data, then the problem is when the number of the frequencies is computed. Look in the source code, may be there is the key. If you have further problems, you could consider to use a Lomb-Scargle function that I wrote, send me an

Re: [R] scope of variables in R

2009-03-31 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: > > this is where multiple assignment might be your friend: > > source('http://miscell.googlecode.com/svn/rvalues/rvalues.r') > c(foo, bar, gee) := local({ > shared = 0 > foo = function() shared <<- 0 > bar = function(bar) shared <<- bar >

Re: [R] CV and GCV for finding smoothness parameter

2009-03-31 Thread Simon Wood
`gam' in package `mgcv' will let you supply any smoothing parameter you want (via argument `sp') and will get the fit and corresponding GCV score for you (`gcv.ubre' in the `gam' object). The CV score you'd have to calculate yourself, but `influence.gam' will extract the necessary H_ii. See the

Re: [R] How to generate natural cubic spline in R?

2009-03-31 Thread Stephan Kolassa
Hi David, David Winsemius schrieb: The splinefun documentation indicates that "natural" is one of the types of cubic spline options available. That sounds good, didn't know that... rcs() has the advantage of coming with a book (Harrell's "Regression Modeling Strategies"). Does rcs actually

[R] Fedora 10 KDE plasma font rendering issue

2009-03-31 Thread dfermin
Hello. I've got a new workstation running Fedora 10 linux and I use the KDE 4.2 desktop which uses some kind of new desktop environment called 'plasma'. If I start up R and generate a plot (for example: hist(rnorm(1, mean=0, sd=1), breaks=100) ). The plot appears but all text (the x/y axes,

[R] convert table to list

2009-03-31 Thread herwig
Hi there, This is probably a rather simple question - but I was not able to solve it so far. I would like to convert the following table: A B C D x 10 20 30 40 y 11 21 31 41 z 12 32 42 to a list with three columns like: A x 10 A y 11 A z 12 B x 20 . . . Any hints how do do t

Re: [R] Does R support double-exponential smoothing?

2009-03-31 Thread David Winsemius
?HoltWinters On Mar 31, 2009, at 5:25 AM, minben wrote: I want to use double-exponential smoothing to forecast time series datas,but I couldn't find it in the document,does R support this method? David Winsemius, MD Heritage Laboratories West Hartford, CT __

Re: [R] How to generate natural cubic spline in R?

2009-03-31 Thread David Winsemius
The splinefun documentation indicates that "natural" is one of the types of cubic spline options available. Does rcs actually do fitting? Such would not be my expectation on reading the documentation and I do not see any examples of such functionality in the help pages. -- David Winsemius

Re: [R] Generating EPS figures automatically (like Sweave)

2009-03-31 Thread Gábor Csárdi
Hmmm, I am not quite sure what you mean by 'automatically', but maybe you want to read ?postscript. (Although this is still not automatic, the machine cannot really do it without you pressing the keys on the keyboard in the right order.) Best, Gabor On Tue, Mar 31, 2009 at 9:27 PM, eariasca wro

Re: [R] viewport bug in 2.8.0?: Error: Cannot pop the top-level viewport (grid and graphics output mixed?)

2009-03-31 Thread Paul Murrell
Hi jonathan.sh...@hsbcib.com wrote: > I get the following error message followed by instability in R after the > error message: > > Error: Cannot pop the top-level viewport (grid and graphics output > mixed?) > > Have reduced something much more complex in my code to a simple test cas

[R] Lomb periodograms

2009-03-31 Thread Garcia Carreras, Bernardo
Hi, I have recently used the CTS package in order to use the Lomb-Scargle periodogram (spec.ls) function. I have noticed an issue that I hoped you may be able to explain. If a regularly spaced time series has two points removed, one at either side of a single data point (thus making an irregula

[R] Generating EPS figures automatically (like Sweave)

2009-03-31 Thread eariasca
Hello, Is there a way to generate EPS figures automatically out of a chunk of code? Basically, I would like to do something like Sweave does (I just find it a little cumbersome to create a .Rnw file and then keep track of the figure numbering). Thanks for your time. Ery Arias-Castro __

Re: [R] model selection using ANOVA

2009-03-31 Thread Stephan Kolassa
Hi Alina, your approach sounds problematic - you can always get a smaller RSS if you add terms to your model, so your approach will always go for larger models, and you will end up overfitting. Consider information criteria, e.g., AIC or BIC, which "penalize" larger models. References for AIC

Re: [R] List assignment in a while loop and timing

2009-03-31 Thread Adrian Dragulescu
Saptarhi, Here are some observations. It seems to me that your question is about assignment into long lists. 1) Initialize your list with a vector of NULLs. 2) If you can, try to use vectors rather then lists. It's faster by more than 30%. 3) If you get rid of the i <- i+1, you go even fas

Re: [R] Does R support double-exponential smoothing?

2009-03-31 Thread Stephan Kolassa
Hi, ets() in Hyndman's forecast package allows you to specify which one of the many smoothing variants (additive/multiplicative season, damped trend, additive/multiplicative errors) you want. HTH, Stephan minben schrieb: I want to use double-exponential smoothing to forecast time series da

Re: [R] How to generate natural cubic spline in R?

2009-03-31 Thread Stephan Kolassa
Hi, if you are looking for *natural* cubic splines (linear beyond the outer knots), you could use rcs() in Frank Harrell's Design package. HTH, Stephan David Winsemius schrieb: If one enters: ??"spline" ... You get quite a few matches. The one in the stats functions that probably answers

Re: [R] scope of variables in R

2009-03-31 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > On Tue, Mar 31, 2009 at 7:10 AM, wrote: > > >> I need to allocate (using C nomenclature) a set of "global" variables, some >> integer scalars and some double vectors. >> ... >> > > My question is: how can I have R interpreter allocate "global"variables > >> vis

[R] About the proportion of data

2009-03-31 Thread Tammy Ma
Hi, All. I have scatterplot in 2-D I'd like to see which proportion of data goes into a range. How shall I figure it out? Perhaps some accumulative graph or something? Kind regards, Tammy _ Drag n’ drop—Get easy photo sharing wi

Re: [R] Using apply to get group means

2009-03-31 Thread David Winsemius
That is precisely the reason for the existence of the ave function. Using Wickham's example: > x1 <- rep(c("A", "B", "C"), 3) > x2 <- c(rep(1, 3), rep(2, 3), 1, 2, 1) > x3 <- c(1, 2, 3, 4, 5, 6, 2, 6, 4) > df <- data.frame(x1, x2, x3) > df$grpx3 <- ave(df$x3, list(x1,x2)) > df x1 x2 x3 grpx

Re: [R] labeling panels in lattice plots

2009-03-31 Thread Coltrey Mather
Converting rain.stats$year to a factor yields the results you seem to want: xyplot(rain.stats$min+ rain.stats$max + rain.stats$ave ~ rain.stats$month |as.factor(rain.stats$year), lty = 1, data = rain.stats, type = c("l","l", "l"), col = c("red", "blue", "green"), distribute.type = TRU

Re: [R] 3d cloud plot with point size reflecting variable value

2009-03-31 Thread Deepayan Sarkar
On Tue, Mar 31, 2009 at 11:49 AM, Deepayan Sarkar wrote: > On Tue, Mar 31, 2009 at 8:57 AM, Dieter Menne > wrote: >> R User R User googlemail.com> writes: >> >>> I'm using the cloud function to plot the iris data as per the document: >>> http://www.stat.ucl.ac.be/ISpersonnel/lecoutre/stats/fichi

Re: [R] 3d cloud plot with point size reflecting variable value

2009-03-31 Thread Deepayan Sarkar
On Tue, Mar 31, 2009 at 8:57 AM, Dieter Menne wrote: > R User R User googlemail.com> writes: > >> I'm using the cloud function to plot the iris data as per the document: >> http://www.stat.ucl.ac.be/ISpersonnel/lecoutre/stats/fichiers/_gallery.pdf >> >> I'd like to change the point size to reflec

[R] Last month on the Revolutions blog

2009-03-31 Thread David M Smith
I write about R every weekday at http://blog.revolution-computing.com . In case you missed them, here are some articles from the past month that may be of particular interest to r-help: * http://tinyurl.com/cz3jmk REvolution Computing is hiring! We are looking for enthusiastic and talented people

[R] viewport bug in 2.8.0?: Error: Cannot pop the top-level viewport (grid and graphics output mixed?)

2009-03-31 Thread jonathan . shore
I get the following error message followed by instability in R after the error message: Error: Cannot pop the top-level viewport (grid and graphics output mixed?) Have reduced something much more complex in my code to a simple test case. I run the following and then resize the window

Re: [R] Can not get a prediction interval from Predict

2009-03-31 Thread Sundar Dorai-Raj
?predict.glm has no "interval" argument. Perhaps you're thinking of ?predict.lm, which is different. To get intervals in glm, I've used: example(predict.glm) pr <- predict(budworm.lg, se.fit = TRUE) family <- family(budworm.lg) lower <- family$linkinv(pr$fit - qnorm(0.95) * pr$se.fit) upper <- fa

Re: [R] error during DPpackage compilation

2009-03-31 Thread Uwe Ligges
Alexandre Aguiar wrote: Dear All, I've had trouble compiling DPpackage as a user in one system. It works fine as root in other machines. I can see any clues in error messages My guess is that it is a permissions matter. Any help is appreciated. OS: Linux Kernel: 2.6.27 SMP Arch: Intel 64 b

Re: [R] naming vectors/ matrices in R

2009-03-31 Thread Erich Neuwirth
This is probably what you want mydf<-as.data.frame(matrix(1:60,10)) for (i in (1:dim(mydf)[2])) assign(letters[i],mydf[,i]) I would not, however, recommend it. It really does not produce very readable code. emj83 wrote: > I would like to create a series of vectors in a loop and name them with

Re: [R] 'for Loop'

2009-03-31 Thread Erich Neuwirth
If you add 2 numbers a and b and divide this sum by the mean of these 2 number, you will always get 2 (a+b)/((a+b)/2) always simplifies to 2. Alan O'Loughlin wrote: > Hello, > > I'm trying to create a for loop for a data set, I have a list of results in > this data set and I want to take the

Re: [R] Package candisc

2009-03-31 Thread Uwe Ligges
MarcioRibeiro wrote: Hi listers, I am working on an canonical discriminant analysis, but I am having some trouble to use the CANDISC function... I just installed the last R version and installed the package CANDISC... But, I am getting the following message because about a permission: The down

[R] Can not get a prediction interval from Predict

2009-03-31 Thread Taylor Davis
I am trying to get a prediction interval from a glm regression. With newdat being my set of values to be fitted, and glmreg the name of my regression, I am using the following code. predict(glmreg, newdat, se.fit = TRUE, interval = "confidence", level = 0.90) The problem is that I am only gettin

Re: [R] Using apply to get group means

2009-03-31 Thread Domenico Vistocco
Sorry, there was a mistake in the previous mail: Domenico Vistocco wrote: A different solution (using aggregate for the table of means and merge for adding it to the dataframe): x1<-rep(c("A","B","C"),3) x2<-c(rep(1,3),rep(2,3),1,2,1) x3<-c(1,2,3,4,5,6,2,6,4) x<-data.frame(x1,x2,x3) #here usi

Re: [R] Bug in col2rgb?

2009-03-31 Thread Duncan Murdoch
On 3/31/2009 12:29 PM, hadley wickham wrote: col2rgb("#0079", TRUE) [,1] red 0 green0 blue 0 alpha 121 col2rgb("#0080", TRUE) [,1] red255 green 255 blue 255 alpha0 col2rgb("#0081", TRUE) [,1] red 0 green0 blue 0 alpha 129

Re: [R] 'for Loop'

2009-03-31 Thread Jun Shen
Al, Say, your data file is 'test', execute the following in sequence, aggregate(test[1],test[2],mean)->inter names(inter)[2]='mean' merge(test,inter,all=T)->inter2 inter2$RSV=inter2$Result/inter2$mean The column 'RSV' in inter2 should be what you want. Jun On Tue, Mar 31, 2009 at 11:11 AM, Al

Re: [R] Using apply to get group means

2009-03-31 Thread Domenico Vistocco
A different solution (using aggregate for the table of means and merge for adding it to the dataframe): x1<-rep(c("A","B","C"),3) x2<-c(rep(1,3),rep(2,3),1,2,1) x3<-c(1,2,3,4,5,6,2,6,4) x<-data.frame(x1,x2,x3) #here using data.frame the x1 variable is directly converted to factor x3means <-

Re: [R] Reshape: 'melt' numerous objects

2009-03-31 Thread hadley wickham
On Tue, Mar 31, 2009 at 11:12 AM, Steve Murray wrote: > > Dear R Users, > > I'm trying to use the reshape package to 'melt' my gridded data into column > format. I've done this before on individual files, but this time I'm trying > to do it on a directory of files (with variable file names) - th

Re: [R] Using apply to get group means

2009-03-31 Thread hadley wickham
On Tue, Mar 31, 2009 at 11:31 AM, baptiste auguie wrote: > Not exactly the output you asked for, but perhaps you can consider, > > library(doBy) >> summaryBy(x3~x2+x1,data=x,FUN=mean) >> >>  x2 x1 x3.mean >> 1  1  A     1.5 >> 2  1  B     2.0 >> 3  1  C     3.5 >> 4  2  A     4.0 >> 5  2  B     5.

Re: [R] Using apply to get group means

2009-03-31 Thread baptiste auguie
Not exactly the output you asked for, but perhaps you can consider, library(doBy) > summaryBy(x3~x2+x1,data=x,FUN=mean) x2 x1 x3.mean 1 1 A 1.5 2 1 B 2.0 3 1 C 3.5 4 2 A 4.0 5 2 B 5.5 6 2 C 6.0 the plyr package also provides similar functionality, as do t

[R] Bug in col2rgb?

2009-03-31 Thread hadley wickham
> col2rgb("#0079", TRUE) [,1] red 0 green0 blue 0 alpha 121 > col2rgb("#0080", TRUE) [,1] red255 green 255 blue 255 alpha0 > col2rgb("#0081", TRUE) [,1] red 0 green0 blue 0 alpha 129 Any ideas? Thanks, Hadley -- http://had.co

[R] model selection using ANOVA

2009-03-31 Thread Alina Sheyman
I've created a number of models using lm and now want to pick one with the smallest standard error or the smallest RSS, I can get a list of RSS using anova function, but is the any way I can then select one with the smallest RSS from the list? [[alternative HTML version deleted]]

[R] USING MULTILEVEL PACKAGE AND WABA FUNCTION

2009-03-31 Thread Analisi Dati
Dear friends, this time I have a problem with using waba function. Firstly, I'll explain you my situation. In the survey a gruop of supervisors judge the dipendents of a company. One supervisor reported on more than one subordinate. Thus, I need to show that lack of independence is not a problem

[R] Reshape: 'melt' numerous objects

2009-03-31 Thread Steve Murray
Dear R Users, I'm trying to use the reshape package to 'melt' my gridded data into column format. I've done this before on individual files, but this time I'm trying to do it on a directory of files (with variable file names) - therefore I have to also use the 'assign' command. I have come up

[R] Using apply to get group means

2009-03-31 Thread Alan Cohen
Hi all, I'm trying to improve my R skills and make my programming more efficient and succinct. I can solve the following question, but wonder if there's a better way to do it: I'm trying to calculate mean by several variables and then put this back into the original data set as a new variable

Re: [R] Factor Analysis Output from R and SAS

2009-03-31 Thread William Revelle
At 8:17 AM -0400 3/31/09, John Fox wrote: Dear TY, Considering that you used different methods -- maximum-likelihood factor analysis in R and principal components analysis in SAS -- the results are quite similar (although the three rotated factors/components come out in different orders). I hop

Re: [R] 3d cloud plot with point size reflecting variable value

2009-03-31 Thread Dieter Menne
R User R User googlemail.com> writes: > I'm using the cloud function to plot the iris data as per the document: > http://www.stat.ucl.ac.be/ISpersonnel/lecoutre/stats/fichiers/_gallery.pdf > > I'd like to change the point size to reflect a fourth variable, as done here > http://www.cis.hut.fi/pr

Re: [R] 'for Loop'

2009-03-31 Thread Jun Shen
Al, Is there any "ID" index for the pairs? For example, if the first pair can be labeled "a", and second pair labeled "b" etc., then you can add an index column or you may already have such a column in your list. Then run aggregate(your.data.column, by=index.column, FUN=mean). Or you can just add

[R] Deriving Samples from specific, not implemented PDF for a QQ-Plot

2009-03-31 Thread Arndt Zimmermann
Dear All, this is my first post to the R-help, so please don't be too strict. My problem concerns a QQ-Plot: I want to show how well empirical samples match with a theoretical distribution. The theoretical distribution has got several parameters, but I made it to fit via ML. Anyway

[R] 'for Loop'

2009-03-31 Thread Alan O'Loughlin
Hello, I'm trying to create a for loop for a data set, I have a list of results in this data set and I want to take the 1st two add them together and divide by the mean of the 1st to, then do the same for the 3rd and 4th values in the list and so on and each time return a value for the calcul

Re: [R] help about: anova and population no normal

2009-03-31 Thread Mike Lawrence
Oh, and to answer your question more directly, the randomization test permits testing hypotheses using any metric, so scale & shape are definitely testable. Typically one is interested in means, so on each iteration of the test loop one computes the group/condition means. However, it's simple to i

Re: [R] Nonparametric analysis of repeated measurements dat a with sm library

2009-03-31 Thread Dieter Menne
Alphonse Monkamg yahoo.fr> writes: > Does anybody know how to get more evaluation points in performing Nonparametric analysis of repeated measurements data with "sm" library. Try ... paramter ngrid: ngrid the number of divisions of the above interval to be considered. Default: ngrid=20.

Re: [R] target of assignment expands to non-language object

2009-03-31 Thread Stavros Macrakis
On Tue, Mar 31, 2009 at 10:05 AM, Alina Sheyman wrote: > I'm running the following code > > numbers <- 1:50 > for (i in 1:50) > > assign(paste("model",numbers[i]),i)<-(lm(temp$Overall.Scaled.Score~temp$raw.score)) > a) What is the purpose of numbers? Why not write paste("model",i) b) Why a

Re: [R] scope of variables in R

2009-03-31 Thread Stavros Macrakis
On Tue, Mar 31, 2009 at 7:10 AM, wrote: > I need to allocate (using C nomenclature) a set of "global" variables, some > integer scalars and some double vectors. > ... My question is: how can I have R interpreter allocate "global"variables > visible and accessible by all the functions in the same

Re: [R] naming vectors/ matrices in R

2009-03-31 Thread Dieter Menne
emj83 shef.ac.uk> writes: > > > I would like to create a series of vectors in a loop and name them with > letters. > > I know the command letters gives me the 26 letters of the alphabet. > > For example, I have a dataframe, called A, with 6 columns. > > >B<-length(A) > >C<-letters(1:B) > [1]

Re: [R] Problem with mathematical expression and loop

2009-03-31 Thread Duncan Murdoch
On 3/31/2009 9:15 AM, Denis Aydin wrote: Hi to all I use a loop to plot 9 different histograms of 9 different transformations of one dataset (x). I want to label the histograms with the mathematical expression of each transformation (e.g. x^3). For that I've prepared a vector with the label

Re: [R] help about: anova and population no normal

2009-03-31 Thread Mike Lawrence
Those with more formal statistical backgrounds may provide better advice, but in my own informal training I've come to wonder why parametric stats persist in the face of modern computing power. As I understand it, Fisher developed ANOVA as low-computation method of approximating the Randomization T

[R] Connecting C# to R via rscproxy.dll does not return all results

2009-03-31 Thread Stan Hirsh
Hi there, I am using http://www.nabble.com/Using-R.dll-in-.NET-IPC-td13265477.html this solution to hook a C# Application to R via rscproxy.dll. So far it all works fine, except for the fact that whenever a line in the result vector contains more than 1 return parameter (e.g. ttest´s confide

Re: [R] RMySQL compile

2009-03-31 Thread Jeffrey Horner
sten...@go.com wrote on 03/31/2009 08:11 AM: Jeff, Thank you so much for responding. I am ready to do a lot of tweaking. From your message it looks like you are asking me to provide assignments on the same line as R CMD but precede the command. I am using bash and the usual thing would be to

[R] portable R editor

2009-03-31 Thread Mayeul Kauffmann
Several messages last week debated about a portable R with Tinn-R. I made such an app just a few weeks ago. It's called R-TinnR-portables and is available here: http://otan.ecoledelapaix.org/spip.php?article102 Simply unzip the file downloadable under the name "R-2.8.1TinnR-portables". You'll have

[R] HELP WITH SEM LIBRARY AND WITH THE MODEL'S SPECIFICATION

2009-03-31 Thread Analisi Dati
Dear John I want to thank you so much for the help. I've solved my problem following your instructions. The matrix S of the cov was singular because i had few complete observation. I have included 2 wrongs item, because (in the majority of cases) when one is inputed, the other one is "NA", so i

[R] Problem with mathematical expression and loop

2009-03-31 Thread Denis Aydin
Hi to all I use a loop to plot 9 different histograms of 9 different transformations of one dataset (x). I want to label the histograms with the mathematical expression of each transformation (e.g. x^3). For that I've prepared a vector with the labeling names for "expression". > trans.expr

[R] CV and GCV for finding smoothness parameter

2009-03-31 Thread Nora Velvet
I received an assignment that I have to do in R, but I'm absolutely not very good at it. The task is the following: http://www.nabble.com/file/p22804957/question8.jpg To do this, we also get the following pieces of code (not in correct order): http://www.nabble.com/file/p22804957/hints.jpg I'

Re: [R] Upgrade through the R interface?

2009-03-31 Thread Alexandre Aguiar
Hi. Em Terça 31 Março 2009, stephen sefick escreveu: > I was just curious. I use a bash script [http://asaguiar.med.br/modules.php?name=Downloads&d_op=getit&lid=41] that checks for availability of upgrades and, if it is the case, downloads, compiles and install the newest R version. It could b

Re: [R] How to generate natural cubic spline in R?

2009-03-31 Thread spencerg
Hello: If B-splines will suffice, there are many capabilities in R for that. My favorite is the 'fda' package, but 'splines' and other packages are also good. The "splinefun" function in the "base" package returns a function to compute spline interpolations optionally using a

Re: [R] Upgrade through the R interface?

2009-03-31 Thread stephen sefick
I was just curious. For a couple of times a year building from the sources doesn't make this a super high priority for me to write such a function (assuming I have the skills to do this anyway) as the core team makes it quite easy to just download whatever I need. Thanks for all of the help, Ste

  1   2   >