Re: [R] Boxplot problem

2011-03-09 Thread Dennis Murphy
Hi: A box plot is based on a five number summary, so you need at a minimum five observations (and preferably at least twice that) to make a box plot a viable summary measure for a continuous variable. Consider other graphical summaries for these data - perhaps a strip chart or a simple scatterplot

Re: [R] Boxplot problem

2011-03-09 Thread Lao Meng
No,even there's only one observation,boxplot can still be drawn. x<-1 boxplot(x) or x<-1:3 boxplot(x) ... 2011/3/9 Dennis Murphy > Hi: > > A box plot is based on a five number summary, so you need at a minimum five > observations (and preferably at least twice that) to make a box plot a > v

Re: [R] Teaching R: To quote, or not to quote?

2011-03-09 Thread Ingmar Visser
> FWIW, the style for JSS now enforces (via Achimitization) the use of quotes > as you show above. > An excellent candidate for the fortunes package! best, Ingmar [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https:

Re: [R] Teaching R: To quote, or not to quote?

2011-03-09 Thread Liviu Andronic
On Wed, Mar 9, 2011 at 9:57 AM, Ingmar Visser wrote: >> FWIW, the style for JSS now enforces (via Achimitization) the use of quotes >> as you show above. >> > > An excellent candidate for the fortunes package! > We should probably address Achim for that. :) Regards Liviu > best, Ingmar > >    

[R] rms: getting adjusted R^2 from ols object

2011-03-09 Thread Mark Seeto
How can I extract the adjusted R^2 value from an ols object (using rms package)? library(rms) x <- rnorm(10) y <- x + rnorm(10) ols1 <- ols(y ~ x) Typing "ols1" displays adjusted R^2 among other things, but how can I assign it to a variable? I tried str(ols1) but couldn't see where to go from the

Re: [R] rms: getting adjusted R^2 from ols object

2011-03-09 Thread Martyn Byng
Hi, If you look in the print.ols function you can see that the adjusted R^2 is not stored in the ols object but calculated on the fly, the relevant code snippet from that function looks to be: x <- ols1 stats <- x$stats resid <- x$residuals n <- length(resid) ndf <- stats["d.

Re: [R] plotCI() with ggplot2

2011-03-09 Thread Kohske Takahashi
Hi, try this: d <- rbind(data.frame(M=1, v=1:2, m1), data.frame(M=2, v=1:2, m2)) ggplot(d, aes(v, ymin=lo, y=m, ymax=hi, colour=factor(M))) + geom_line(position=position_dodge(width=0.1)) + geom_pointrange(position=position_dodge(width=0.1)) -- Kohske Takahashi Research Center for Advance

[R] Getting the source file's name where the custom function is written

2011-03-09 Thread raymondowf
Dear R experts, I've written some functions in a few source files (such as main.R, control.R ...). After loading them into R, how do I retrieve which functions are loaded from which source file? For example: main.R has functions: myPrint(), myScan() control.R has functions: setPrinter(), se

[R] trunc function

2011-03-09 Thread Luis Felipe Parra
Hello. I would like to know if there exists in R a function like trunc but where i can choose how many decimal places can I stay with in the number I have (sort of the same as the trunc function in excel). I would like, for example if I have the number 0.974678 and I choose to stay with 3 decimal p

Re: [R] Getting the source file's name where the custom function is written

2011-03-09 Thread Ivan Calandra
Hi, There might be better solution, but I think this works (got it by searching "source function" with RSiteSearch()): attr(body(myPrint), "srcfile") Here is the original answer: http://finzi.psych.upenn.edu/Rhelp10/2010-February/227805.html HTH, Ivan Le 3/9/2011 10:19, raymondowf a écrit :

Re: [R] trunc function

2011-03-09 Thread Carlos Ortega
Hola Felipe, Sí, la función es round(). Por cierto, tenemos una lista de ayuda del R en español. Te puedes suscribir aquí: https://stat.ethz.ch/mailman/listinfo/r-help-es Saludos, Carlos Ortega www.qualityexcellence.es On Wed, Mar 9, 2011 at 10:36 AM, Luis Felipe Parra < felipe.pa...@quantil.

Re: [R] NaNs in Nested Mixed Model

2011-03-09 Thread ONKELINX, Thierry
Dear Johan, A few remarks. - R-sig-mixed models is a better list for asking questions about mixed model. - I presume that Nymphs is the number of insects? In that case you need a generalised linear (mixed) model with poisson family - What are you interessed in? The variability among genotypes or

Re: [R] Boxplot problem

2011-03-09 Thread Gaurav Kumar
Dear Lao and Dennis, Thanks for your reply, now it is working as expected by using height=cbind(c(data[1,],data[2,],data[3,]) Gaurav Kumar www.gauravkumar.org PhD Student, Chemistry and Biomolecular Sciences, Macquarie , Sydney, Australia. MS (Computational Biology), NCBS-TIFR, Bangalore, India

Re: [R] trunc function

2011-03-09 Thread Petr Savicky
On Wed, Mar 09, 2011 at 05:36:35PM +0800, Luis Felipe Parra wrote: > Hello. I would like to know if there exists in R a function like trunc but > where i can choose how many decimal places can I stay with in the number I > have (sort of the same as the trunc function in excel). I would like, for >

[R] JRI; call user defined function

2011-03-09 Thread wesley mathew
Dear All I would like to know how can I call user defined R function from JRI. I stored my function (UCS) in the working directory and I load that function into the program using Rengine re=*new* Rengine(args, *false*, *null*); re.eval("source('UCS')") * *But *re.eval("UCS()")*, is not working.

Re: [R] Venn Diagram corresponding to size in R

2011-03-09 Thread Karl Brand
Hi Shira, Check out "venneuler" http://cran.r-project.org/web/packages/venneuler/index.html Labelling can be a little tricky, but if you search this forum for "venneuler" you'll find some tips which helped me. hth, karl On 03/09/2011 02:25 AM, Shira Rockowitz wrote: I was wondering if an

Re: [R] Teaching R: To quote, or not to quote?

2011-03-09 Thread Uwe Ligges
On 09.03.2011 10:00, Liviu Andronic wrote: On Wed, Mar 9, 2011 at 9:57 AM, Ingmar Visser wrote: FWIW, the style for JSS now enforces (via Achimitization) the use of quotes as you show above. An excellent candidate for the fortunes package! We should probably address Achim for that. :)

Re: [R] Getting the source file's name where the custom function is written

2011-03-09 Thread Duncan Murdoch
On 11-03-09 4:41 AM, Ivan Calandra wrote: Hi, There might be better solution, but I think this works (got it by searching "source function" with RSiteSearch()): attr(body(myPrint), "srcfile") That's the right way, but it only works if srcrefs (debug information) is kept. By default source()

Re: [R] rms: getting adjusted R^2 from ols object

2011-03-09 Thread Peter Ehlers
On 2011-03-09 01:25, Martyn Byng wrote: Hi, If you look in the print.ols function you can see that the adjusted R^2 is not stored in the ols object but calculated on the fly, the relevant code snippet from that function looks to be: x<- ols1 stats<- x$stats resid<- x$residuals

Re: [R] rms: getting adjusted R^2 from ols object

2011-03-09 Thread Mark Difford
On Mar 09, 2011; 11:09am Mark Seto wrote: >> How can I extract the adjusted R^2 value from an ols object (using rms >> package)? >> library(rms) >> x <- rnorm(10) >> y <- x + rnorm(10) >> ols1 <- ols(y ~ x) ## ols1$stats ols1$stats[4] Regards, Mark. -- View this message in context: http:/

Re: [R] Getting the source file's name where the custom function is written

2011-03-09 Thread raymondowf
Thanks Ivan! You've solved my problem!! -- View this message in context: http://r.789695.n4.nabble.com/Getting-the-source-file-s-name-where-the-custom-function-is-written-tp3343135p3343197.html Sent from the R help mailing list archive at Nabble.com. _

[R] Cleaning date columns

2011-03-09 Thread Newbie19_02
Hi Everyone, I have the following problem: data <- structure(list(prochi = c("IND1", "IND1", "IND1", "IND2", "IND2", "IND2", "IND2", "IND3", "IND4", "IND5"), date_admission = structure(c(6468, 6470, 7063, 9981, 9983, 14186, 14372, 5129, 9767, 11168), class = "Date")), .Names = c("prochi", "da

Re: [R] Boxplot problem

2011-03-09 Thread Peter Ehlers
On 2011-03-09 00:17, Lao Meng wrote: No,even there's only one observation,boxplot can still be drawn. x<-1 boxplot(x) or x<-1:3 boxplot(x) ... Well, yes, it *can* be drawn. But it shouldn't be. A boxplot based on fewer than, say, 10 values is just nonsense. Even 10 is pretty dubious. Anyway,

Re: [R] positions and margins differ between X11 and SVG device

2011-03-09 Thread tospo
Thanks Allen, my R installation: platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 2 minor 11.1 year 2010 month 05 day31 svn rev52157 language R version.string R ve

[R] Regular Expressions in Column Headings

2011-03-09 Thread Matthew DeAngelis
Hi all, I am hoping that someone can help me with a problem I am having with column headings. I have read a table into R using read.table: the rows are documents, and the columns are counts of regular expression matches (so that the column heading is the given regular expression). My problem is

[R] Rearranging the data

2011-03-09 Thread Vincy Pyne
Dear R helpers, xx = data.frame(country = c("USA", "UK", "Canada"), x = c(10, 50, 20), y = c(40, 80, 35), z = c(70, 62, 10)) > xx        country  x y    z 1  USA    10    40  70 2  UK  50   80   62 3 Canada    20   35   10 I need to arrange this as a new data

Re: [R] Rearranging the data

2011-03-09 Thread Santosh Srinivas
reshape2 Like this? > require(reshape2) Loading required package: reshape2 > melt(xx) Using country as id variables country variable value 1 USAx10 2 UKx50 3 Canadax20 4 USAy40 5 UKy80 6 Canaday35 7 U

Re: [R] Regular Expressions in Column Headings

2011-03-09 Thread Gabor Grothendieck
On Wed, Mar 9, 2011 at 8:52 AM, Matthew DeAngelis wrote: > Hi all, > > I am hoping that someone can help me with a problem I am having with column > headings.  I have read a table into R using read.table: the rows are > documents, and the columns are counts of regular expression matches (so that >

[R] Extracting only odd columns from a matrix

2011-03-09 Thread Nixon, Matthew
Hi, This might seem like a simple question but at the moment I am stuck for ideas. The columns of my matrix in which some data is stored are of this form: X1 Y1 X2 Y2 X3 Y3 ... Xn Yn with n~100. I would like to look at just the X values (i.e. odd column numbers)

Re: [R] Extracting only odd columns from a matrix

2011-03-09 Thread Sarah Goslee
oddvals <- seq(1, ncol(mydata), by=2) mydata[,oddvals] On Wed, Mar 9, 2011 at 9:20 AM, Nixon, Matthew wrote: > Hi, > > This might seem like a simple question but at the moment I am stuck for > ideas. The columns of my matrix in which some data is stored are of this form: > > X1     Y1     X2    

Re: [R] Extracting only odd columns from a matrix

2011-03-09 Thread Dimitris Rizopoulos
one way is using the seq(), e.g., say 'm' is your matrix, then try: m[, seq(1, ncol(m), by = 2)] I hope it helps. Best, Dimitris On 3/9/2011 3:20 PM, Nixon, Matthew wrote: Hi, This might seem like a simple question but at the moment I am stuck for ideas. The columns of my matrix in which

[R] Problem with vegan package instalation on linux

2011-03-09 Thread Ronaldo Reis-Jr.
Hi, I try to install vegan package on debian linux and I give this error: = * installing *source* package 'vegan' ... ** libs make: *** No rule to make target `cepin.o', needed by `vegan.so'. Stop. *** arch - Rgnome Warning in file(con, "r") : ca

[R] How does the cex parameter scale circles?

2011-03-09 Thread Al Roark
I'm wondering how the cex parameter is used to scale circles (i.e. does it scale the radius, diameter, area, circumference, etc.?). In my case I'm using lattice with filled circles (pch=19). Based on example, it looks like R scales the radius of the circle: library(lattice) dta<-data.frame(x

Re: [R] Problem with vegan package instalation on linux

2011-03-09 Thread Gavin Simpson
On Wed, 2011-03-09 at 11:41 -0300, Ronaldo Reis-Jr. wrote: > Hi, > > I try to install vegan package on debian linux and I give this error: Have you got a fortran compiler installed on your system? gcc-gfortran is the package on my Fedora laptop. G > =

[R] Complex sampling?

2011-03-09 Thread Hosack, Michael
R users, I am trying to generate a randomized weekday survey schedule that ensures even coverage of weekdays in the sample, where the distribution of variable DOW is random with respect to WEEK. To accomplish this I need to randomly sample without replacement two weekdays per week for each of

Re: [R] Problem with vegan package instalation on linux

2011-03-09 Thread Ronaldo Reis Junior
Gavin, yes, I have GCC, Gfortran, [root@amandix ~]# gcc --version gcc (Debian 4.5.2-5) 4.5.2 [root@amandix ~]# gfortran --version GNU Fortran (Debian 4.5.2-5) 4.5.2 [root@amandix ~]# make --version GNU Make 3.81 I have another linux installed that I dont have any problem, the installations a

[R] intamap plot : specifying cutoffs

2011-03-09 Thread GOUACHE David
Hello all, A question for plotting of intamap results : Is it possible, and in so, how, to specify the cutoff points for changing colors of plots ? Using the example : data(meuse) meuse$value = log(meuse$zinc) data(meuse.grid) coordinates(meuse) = ~x+y coordinates(meuse.grid) = ~x+y object = in

Re: [R] R Commander QQ Plot with triangular distribution

2011-03-09 Thread Richard and Barbara Males
Thank you for your prompt reply, I apologize for posting as an R Commander question. Your response is pointing me in the right direction, but I am still not quite there. The triangle package has a qtriangle and dtriangle. The formal arguments are a, b, and c. (formals(qtriangle)) When I use R

Re: [R] R Commander QQ Plot with triangular distribution

2011-03-09 Thread John Fox
Dear Dick, > -Original Message- > From: Richard and Barbara Males [mailto:rbma...@gmail.com] > Sent: March-09-11 10:54 AM > To: John Fox > Cc: r-help@r-project.org > Subject: Re: [R] R Commander QQ Plot with triangular distribution > > Thank you for your prompt reply, I apologize for post

Re: [R] Date arithmetic coerces POSIXlt to POSIXct?

2011-03-09 Thread MacQueen, Don
(Just expanding a bit on the previous response) "weird" is in the eye of the beholder... A POSIXlt object is actually a list, and subtracting a number from a list [as in an expression like list(a=1,b=2) - 3] does not make sense. But POSIXct objects are actually numbers, and adding a number to a n

Re: [R] R Commander QQ Plot with triangular distribution

2011-03-09 Thread Peter Ehlers
On 2011-03-09 07:53, Richard and Barbara Males wrote: Thank you for your prompt reply, I apologize for posting as an R Commander question. Your response is pointing me in the right direction, but I am still not quite there. The triangle package has a qtriangle and dtriangle. The formal argum

Re: [R] Problem with vegan package instalation on linux

2011-03-09 Thread Prof Brian Ripley
Try the posting guide, and do remember to give the 'at a minumum' information you were asked for. I suspect this is not a recent version of R (but you were asked to update before posting). If it is, please explain what /usr/local/bin/Rgnome is doing in the R installation -- it was last suppo

Re: [R] How does the cex parameter scale circles?

2011-03-09 Thread Prof Brian Ripley
'cex' means character expansion. It is linear magnification: that is all linear dimensions (including height and width) are proportional to cex). You are confusing matters by giving a lattice example. 'cex' is a concept from base graphics (see ?par, which I believe is unambiguous in saying

Re: [R] R Commander QQ Plot with triangular distribution

2011-03-09 Thread Richard and Barbara Males
Wow, quick response, works perfectly, just as needed. Thanks to both of you for pointing me in the right direction, and for your contributions to the R community. Dick On Wed, Mar 9, 2011 at 11:21 AM, Peter Ehlers wrote: > On 2011-03-09 07:53, Richard and Barbara Males wrote: >> >> Thank you fo

Re: [R] Problem with vegan package instalation on linux

2011-03-09 Thread Ronaldo Reis Junior
Hi, I try with --no-multiarch and it work now. I use the same R version in both systems: R version 2.12.2 (2011-02-25) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) Now, how to make the --no-multiarch option default to R in

Re: [R] Complex sampling?

2011-03-09 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Hosack, Michael > Sent: Wednesday, March 09, 2011 7:34 AM > To: r-help@R-project.org > Subject: [R] Complex sampling? > > R users, > > I am trying to generate a randomized weekda

Re: [R] Multiple testing corrections on very large vector

2011-03-09 Thread Jorge Ivan Velez
Hi terdon, Very happy to help and know it worked. Honestly, I do not know exactly where the differences are, but it is not hard to check the sources and compare both algorithms. When doing this, you can can see that p.adjust() uses vectorization whereas mt.rawp2adjp() does not. Perhaps that is th

[R] system(..., invisible=FALSE, show.output.on.console=FALSE) in Windows 7

2011-03-09 Thread Ralph Olsson
Hello, I work for a company in which a number of employees use R. Many of them like to run executables via the system function in such a way that the output of that executable is displayed in a separate window. To give an example of the behavior they require, the following command can be run in

Re: [R] minimum distance between line segments

2011-03-09 Thread Hans W Borchers
Darcy Webber gmail.com> writes: > Dear R helpers, > > I think that this may be a bit of a math question as the more I > consider it, the harder it seems. I am trying to come up with a way to > work out the minimum distance between line segments. For instance, > consider 20 random line segments:

Re: [R] Extracting only odd columns from a matrix

2011-03-09 Thread rex.dwyer
Or, if X1 Y1 X2 Y2... are really your column names m[, grep("X",colnames(m)) ] or m[, grepl("X",colnames(m)) ] -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dimitris Rizopoulos Sent: Wednesday, March 09, 2011 9:36 AM To: Nixon, Ma

[R] Complex sampling?

2011-03-09 Thread Hosack, Michael
> -Original Message- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] > On Behalf Of Hosack, Michael > Sent: Wednesday, March 09, 2011 7:34 AM > To: r-help at R-project.org > Subject: [R] Complex sampling? > > R users, > > I am trying to generate a randomiz

Re: [R] Complex sampling?

2011-03-09 Thread rex.dwyer
It sounds like you want a bunch of random permutations of 1:7. Try order(runif(7)) If you need, say, 10 of them: as.vector(sapply(1:10,function(i) order(runif(7 Is it more complicated than that? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org

Re: [R] Complex sampling?

2011-03-09 Thread Aaron Mackey
What I think you need is something along the lines of: matrix(c(sample(3:7), sample(3:7), sample(3:7), sample(3:7), ...), nrow=2) now, each column are your random pairs. -Aaron On Wed, Mar 9, 2011 at 1:01 PM, Hosack, Michael wrote: > > -Original Message- > > From: r-help-bounces at r-

Re: [R] Complex sampling?

2011-03-09 Thread Bert Gunter
Rex: sample(n) is a much better way to get random permutations of 1:n. To be clear, this is sample(n,replace = FALSE) , the default. (I have no idea whether this is what the poster needs. I just wanted to correct the clumsy order(runif) construction). -- Bert On Wed, Mar 9, 2011 at 10:28 AM,

Re: [R] Extracting only odd columns from a matrix

2011-03-09 Thread Henrique Dallazuanna
Try this: m <- matrix(rnorm(12), ncol = 4) m[,c(FALSE, TRUE)] On Wed, Mar 9, 2011 at 11:20 AM, Nixon, Matthew wrote: > Hi, > > This might seem like a simple question but at the moment I am stuck for > ideas. The columns of my matrix in which some data is stored are of this > form: > > X1 Y1

Re: [R] Rearranging the data

2011-03-09 Thread Henrique Dallazuanna
Try this: reshape(xx, direction = "long", varying = list(2:4), idvar = "country") On Wed, Mar 9, 2011 at 11:15 AM, Vincy Pyne wrote: > Dear R helpers, > > xx = data.frame(country = c("USA", "UK", "Canada"), x = c(10, 50, 20), y = > c(40, 80, 35), z = c(70, 62, 10)) > > > xx >country

Re: [R] repeat matrix column within each array third dimension

2011-03-09 Thread Uwe Ligges
See ?aperm for changing the dimensions afterwards. Uwe Ligges On 08.03.2011 10:14, Folkes, Michael wrote: Hello all, I'm working with a matrix that will have varying dimensions. It will populate an array such that the number of matrix columns will determine the number of 3rd dimension level

Re: [R] How to enforce location of installation of downloaded packages

2011-03-09 Thread Uwe Ligges
install.packages(, lib='/usr/local/lib/R/site-library') otherwise you have to ensure that this library is the first one in .libPaths() and watch out that it is not changed by any of the many mechanisms that allow for adding libraries to the search path. Uwe On 09.03.2011 00:53, Frank Ha

Re: [R] system(..., invisible=FALSE, show.output.on.console=FALSE) in Windows 7

2011-03-09 Thread jim holtman
I see something similar on my system. Running your command line, I can see the command window flashup and then disappear. > sessionInfo() R version 2.12.1 (2010-12-16) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 [

Re: [R] Complex sampling?

2011-03-09 Thread Hosack, Michael
I want to thank everyone who offered advice for the assistance, but the responses so far have not taken into account that the sampling needs to progress through weeks, retaining information from one week to the next. I represented that retained information by a vector that when full is equal

[R] Loop Through Columns to Remove Rows

2011-03-09 Thread Sam Albers
Hello Venerable List, I am trying to loop (I think) an operation through a list of columns in a dataframe to remove set of #DIV/0! values. I am trying to do this like so: #Data.frame test <- read.csv("http://dl.dropbox.com/u/1574243/sample_data.csv";, header=TRUE, sep=",") #This removes all the

Re: [R] Complex sampling?

2011-03-09 Thread Jonathan P Daily
-- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 "Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it." - Jubal E

[R] collapse a data column into a row

2011-03-09 Thread Fahim Mohammad
I have a file with a data in columnar format like below: probeID rc_AI104113_at rc_AI178259_f_at rc_AI179134_i_at rc_AI179134_f_at rc_AI104113_at rc_AA819429_f_at How can I rewrite it in the format below: 'rc_AI104113_at', 'rc_AI178259_f_at', 'rc_AI179134_i_at', 'rc_AI179134_f_at', 'rc_AI104113_

[R] state.x77 dataset

2011-03-09 Thread rbaer
I tried: > data(state.x77) Warning message: In data(state.x77) : data set 'state.x77' not found data(iris) seems to work fine, but the other state datasets (which I haven’t every tried before) don’t seem to be available on my windows 7 running R 2.12.2 installation. ?state brings up the sta

Re: [R] collapse a data column into a row

2011-03-09 Thread Ista Zahn
Hi, On Wed, Mar 9, 2011 at 3:35 PM, Fahim Mohammad wrote: > I have a file with a data in columnar format like below: > > probeID > rc_AI104113_at > rc_AI178259_f_at > rc_AI179134_i_at > rc_AI179134_f_at > rc_AI104113_at > rc_AA819429_f_at > > How can I rewrite it in the  format below: > 'rc_AI104

Re: [R] system(..., invisible=FALSE, show.output.on.console=FALSE) in Windows 7

2011-03-09 Thread Duncan Murdoch
On 09/03/2011 2:34 PM, jim holtman wrote: I see something similar on my system. Running your command line, I can see the command window flashup and then disappear. We have had issues in the past with setting the input file handle for external commands to an empty stream. Then cmd reads from

Re: [R] state.x77 dataset

2011-03-09 Thread Ista Zahn
Hi Rob, I'm not sure exactly what state is, but this works: data(state) head(state.x77) #or whatever Best, Ista On Wed, Mar 9, 2011 at 3:45 PM, wrote: > I tried: >> data(state.x77) > Warning message: > In data(state.x77) : data set 'state.x77' not found > > data(iris)  seems to work fine, b

[R] Vector of weekly dates starting with a given date

2011-03-09 Thread Dimitri Liakhovitski
Hello! I have a date (a Monday): date<-20081229 mydates<-as.Date(as.character(date),"%Y%m%d") What package would allow me to create a vector that starts with that date (mydates) and contains dates for 51 Mondays that follow it (so, basically, 51 dates separated by a week)? Thanks a lot for the

Re: [R] Loop Through Columns to Remove Rows

2011-03-09 Thread Jorge Ivan Velez
Hi Sam, How about this? test[apply(test, 1, function(x) !any(x == '#DIV/0!')), ] HTH, Jorge On Wed, Mar 9, 2011 at 3:29 PM, Sam Albers <> wrote: > Hello Venerable List, > > I am trying to loop (I think) an operation through a list of columns in a > dataframe to remove set of #DIV/0! values. I

Re: [R] Vector of weekly dates starting with a given date

2011-03-09 Thread Dimitri Liakhovitski
I realize I can do something like this: date<-20081229 mydates<-as.Date(as.character(date),"%Y%m%d") for(i in 1:52){ # mydates<-c(mydates,mydates[length(mydates)]+7) } I just thought maybe there is a more elegant way... Thank you! Dimitri On Wed, Mar 9, 2011 at 4:04 PM, Dimitri Liakhovitski

Re: [R] Vector of weekly dates starting with a given date

2011-03-09 Thread Hadley Wickham
On Wed, Mar 9, 2011 at 3:04 PM, Dimitri Liakhovitski wrote: > Hello! > > I have a date (a Monday): > > date<-20081229 > mydates<-as.Date(as.character(date),"%Y%m%d") > > What package would allow me to create a vector that starts with that > date (mydates) and contains dates for 51 Mondays that fol

[R] R console Mac

2011-03-09 Thread Unger, Kristian, Dr.
Hi there, I recently switched to Mac and I wonder if there is any way to get the R console to autocomplete names of list objects or slots of objects. The command line version allows to type e.g. list$ and two times the tab button and then comes up with the names of the list objects. Same for slots

[R] Frailty model -- Conditional or Marginal?

2011-03-09 Thread hongsheng wu
Dear all, When I ran a frailty model like, model <- coxph(Surv(Day, Indicator) ~ trt + frailty(group, distribution="gaussian")) The variance of effect estimate of trt was estimated by conditional model or marginal model? Thanks. Alex [[alternative HTML version deleted]] _

[R] SQLDF - Submitting Queries with R Objects as Columns

2011-03-09 Thread Mike Schumacher
Fellow R programmers, I'd like to submit SQLDF statements with R objects as column names. For example, I want to assign "X" to "var1" (var1<-"X") and then refer to "var1" in the SQLDF statement. SQLDF needs to understand that when I reference "var1", it should look for "X" in the dataframe. Th

[R] java+R+serverEval failed+request status: control pipe to master process is closed/broken

2011-03-09 Thread fengshengshi8888_r
hi: when I run the example program on windows XP+NetBeans: Rserve_0.6-3\Rserve\src\client\javanew\Rserve\test\test.java { // test control commands (works only when enabled and in Rserve 0.6-0 and higher only) - must be the last test since it closes the connection and shuts down the server Syst

[R] Error: evaluation nested too deeply: infinite recursion / options(expressions=)?

2011-03-09 Thread rivercode
Hi, I am processing tick data and my code has stopped working as I have increased the size of data being processed. Now I am receiving error for basic tasks in RConsole: > a = c(1:1000) Error: evaluation nested too deeply: infinite recursion / options(expressions=)? My R code worked fine with 5

[R] biplot breakdown help

2011-03-09 Thread chris20
Hi, I am trying to understand how the biplot.prcomp is constructed so I can manipulate it to emphasise particular observations and reduce the number of variables shown. The prcomp model I have ran has cor=TRUE and scale=TRUE I have worked out from looking at str(prcomp.model) that... prcomp.mode

Re: [R] Any interim update for the basic packages distributed with R?

2011-03-09 Thread jeanneyue
Thank you very much, Professor Ripley. Date: Tue, 8 Mar 2011 22:54:38 -0800 From: ml-node+3342906-500442411-213...@n4.nabble.com To: jeanne...@hotmail.com Subject: Re: Any interim update for the basic packages distributed with R? This is what the R-patched and R-devel versions of R are for.

[R] No response after click the "show Rules" button on Tab "Associate".

2011-03-09 Thread Xiaobo Gu
Hi, I am using Rattle 2.6.4 with R 2.12.2 on win64, is this a bug ? Following is the content after execute the associate analysis process: Summary of the Apriori Association Rules: Number of Rules: 23351 Summary of the Measures of Interestingness: support confidence lift Min.

Re: [R] R-help Digest, Vol 97, Issue 11

2011-03-09 Thread John Maindonald
You might look at the function confusion() in the DAAGxtras package. John Maindonald email: john.maindon...@anu.edu.au phone : +61 2 (6125)3473fax : +61 2(6125)5549 Centre for Mathematics & Its Applications, Room 1194, John Dedman Mathematical Sciences Building (Building 27) Austr

[R] Differences per group

2011-03-09 Thread rens_1112
Dear all, Probably a rather stupid question, but I couldn't find the answer.. I currently have a dataframe with customers' id's and purchase amount, what I would like to do is to show the difference between amount purchased compared to the month before per customer. I have made some attempts my

Re: [R] cv.lm syntax error

2011-03-09 Thread John Maindonald
It means that dat$v1, dat$v2, . . . are not columns in the data frame df Specify the formula as v1 ~ v2+v2+v3+v4+v5+factor Then (assuming that factor is a column object of the right length) you should be fine. John Maindonald email: john.maindon...@anu.edu.au phone : +61 2 (6125)3473

Re: [R] collapse a data column into a row

2011-03-09 Thread Dennis Murphy
Hi: I'm not quite sure what you have in mind, but... Input data strdat.txt: probeID rc_AI104113_at rc_AI178259_f_at rc_AI179134_i_at rc_AI179134_f_at rc_AI104113_at rc_AA819429_f_at strg <- paste(scan('strdat.txt', what = '', skip = 1), collapse = ',') strg [1] "rc_AI104113_at,rc_AI178259_f_at,r

Re: [R] compiling r with icc

2011-03-09 Thread Henrik Schmiediche
The compiler/optimization flags I use (or am experimenting with are) for the Linux 64bit Intel XE compilers and R-2.12.2 are: -O3 -ipo -msse3 -fp-model precise export AR=xiar # not needed when using -ip instead of -ipo #export MAIN_LDFLAGS="-limf -lpthread"

Re: [R] R console Mac

2011-03-09 Thread Ista Zahn
Hi, The r-sig-mac mailing list is probably a better bet for this sort of question. https://stat.ethz.ch/mailman/listinfo/r-sig-mac Best, Ista On Wed, Mar 9, 2011 at 9:47 AM, Unger, Kristian, Dr. wrote: > Hi there, > > I recently switched to Mac and I wonder if there is any way to get the R > cons

Re: [R] Error: evaluation nested too deeply: infinite recursion / options(expressions=)?

2011-03-09 Thread rivercode
For further info, I cannot check my memory usage or even use ls() : > memory.limit Error: evaluation nested too deeply: infinite recursion / options(expressions=)? > ?memory.limit Error: evaluation nested too deeply: infinite recursion / options(expressions=)? > ls() Error: evaluation nested too d

Re: [R] minimum distance between line segments

2011-03-09 Thread Mike Marchywka
> To: r-h...@stat.math.ethz.ch > From: hwborch...@googlemail.com > Date: Wed, 9 Mar 2011 17:45:53 + > Subject: Re: [R] minimum distance between line segments > > Darcy Webber gmail.com> writes: > > > Dear R helpers, > > > > I think that this may b

Re: [R] state.x77 dataset

2011-03-09 Thread peter dalgaard
On Mar 9, 2011, at 21:57 , Ista Zahn wrote: > Hi Rob, > I'm not sure exactly what state is, but this works: > > > data(state) > > head(state.x77) #or whatever Actually, you don't even need data(state); state.* are available as lazy-loaded objects. However, if you do, you get copies of the o

Re: [R] This is supposed to predict a time series?!

2011-03-09 Thread John Stollberg
There does seem to be something odd about StructTS, or perhaps the methodology. Try: > data(AirPassengers) > ap <- log10(AirPassengers)-2 > (fit <- StructTS(ts(ap[1:138], freq=12), type="BSM")) Call: StructTS(x = ts(ap[1:138], freq = 12), type = "BSM") Variances: level slope

Re: [R] Differences per group

2011-03-09 Thread Jorge Ivan Velez
Hi Rens, One way would be x$difference <- do.call(c, with(x, tapply(amount, customer, function(x) c(0, diff(x) x Take a look at ?tapply and ?aggregate for more information. HTH, Jorge On Wed, Mar 9, 2011 at 10:27 AM, rens_1112 <> wrote: > Dear all, > > Probably a rather stupid question,

Re: [R] SQLDF - Submitting Queries with R Objects as Columns

2011-03-09 Thread Gabor Grothendieck
On Wed, Mar 9, 2011 at 11:41 AM, Mike Schumacher wrote: > Fellow R programmers, > > I'd like to submit SQLDF statements with R objects as column names. > > For example, I want to assign "X" to "var1"  (var1<-"X") and then refer to > "var1" in the SQLDF statement.  SQLDF needs to understand that wh

Re: [R] SQLDF - Submitting Queries with R Objects as Columns

2011-03-09 Thread Rob Tirrell
You're submitting queries for SQLDF to execute as strings. So, if you want to use a variable column name, sprintf() or paste() your statement together, like: sqldf(sprintf('select sum(%s) as XSUM, Y as Y from testdf group by Y', var1)) -- Robert Tirrell | r...@stanford.edu | (607) 437-6532 Progra

Re: [R] collapse a data column into a row

2011-03-09 Thread Fahim Mohammad
Hi Dennis and Ista, Thanks a lot. The solution is great. Actually I am trying to do bulk select from database and it require where clause in this form only. inpData = read.csv('./rugitSrc/testFile.csv', header= TRUE) idList = as.character(inpData[,1]) 1> idList [1] "rc_AI104113_at" "rc_AI178259

Re: [R] Vector of weekly dates starting with a given date

2011-03-09 Thread Gabor Grothendieck
On Wed, Mar 9, 2011 at 4:13 PM, Dimitri Liakhovitski wrote: > I realize I can do something like this: > date<-20081229 > mydates<-as.Date(as.character(date),"%Y%m%d") > for(i in 1:52){  # >  mydates<-c(mydates,mydates[length(mydates)]+7) > } > > I just thought maybe there is a more elegant way...

Re: [R] Complex sampling?

2011-03-09 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Hosack, Michael > Sent: Wednesday, March 09, 2011 11:59 AM > To: r-help@R-project.org > Subject: Re: [R] Complex sampling? > > > > I want to thank everyone who offered advice f

Re: [R] Differences per group

2011-03-09 Thread Dennis Murphy
Hi: Here's another approach: purchase_amount <- transform(purchase_amount, diff = with(purchase_amount, ave(amount, customer, FUN = function(x) c(0, diff(x) purchase_amount HTH, Dennis On Wed, Mar 9, 2011 at 7:27 AM, rens_1112 wrote: > Dear all, > > Probably a rather stupid quest

[R] Help with read.csv

2011-03-09 Thread Giovanni Petris
Hello, I have a file that looks like this: Date,Hour,DA_DMD,DMD,DA_RTP,RTP,, 1/1/2006,1,3393.9,3412,76.65,105.04,, 1/1/2006,2,3173.3,3202,69.20,67.67,, 1/1/2006,3,3040.0,3051,69.20,77.67,, 1/1/2006,4,2998.2,2979,67.32,69.10,, 1/1/2006,5,3005.8,2958,65.20,68.34,, where the ',' is the separator a

[R] Sapply for descriptive statistics

2011-03-09 Thread Tomii
I try to calculate descriptive statistics for one of the variables in the data frame, however command sapply calculates these statistics for every value of the variable separately. How to make it calculate range (as well as other statistics) for all column? Here are commands and results: > as1$tr

Re: [R] How to enforce location of installation of downloaded packages

2011-03-09 Thread Frank Harrell
Thanks Uwe. Too bad there is no system option I can set one time, that will always take precedence. Frank Uwe Ligges-3 wrote: > > install.packages(, lib='/usr/local/lib/R/site-library') > > otherwise you have to ensure that this library is the first one in > .libPaths() and watch out th

Re: [R] Help with read.csv

2011-03-09 Thread jim holtman
Easiest is to use 'header = TRUE' and use the data from the file as the header (remove the skip=1). Let the system determine what it should be and then you can change it later. On Wed, Mar 9, 2011 at 5:32 PM, Giovanni Petris wrote: > > Hello, > > I have a file that looks like this: > > Date,Hour

  1   2   >