Re: [R] A plot similar to violin plot

2011-03-09 Thread Tal Galili
Hello C.H. I've also been curious about this plot a while ago. Your question today inspired me to collect all that I've came by in one post, and I published it here: http://www.r-statistics.com/2011/03/scatter-dot-beeswarm-box-violin-plot-and-plotting-it-with-r/ I hope it might help you or other

[R] using lapply

2011-03-09 Thread Arun Kumar Saha
On reply to the post http://r.789695.n4.nabble.com/using-lapply-td3345268.html Dear Kushan, this may be a good start: ## assuming 'instr.list' is your list object and you are applying my.strat() function on each element of that list, you can use lapply function as lapply(instr.list, function(x)

Re: [R] aggregate by part of a field

2011-03-09 Thread Dennis Murphy
Hi: Here's one approach, although I imagine there are more efficient ways. # A function to strip spaces and return the first three non-blank elements of a string keyset <- function(x) substr(gsub(' ', '', x)[1], 1, 3) # Apply the function to the data frame to generate the key: a$key <- sapply(a$

Re: [R] still a problem remainingRE: Data lebals xylattice plot: RE: displaying label meeting condition (i.e. significant, i..e p value less than 005) in plot function

2011-03-09 Thread Umesh Rosyara
Lattice-experts: Thank you for those who have responded earlier. I have not got a perfect solution yet but tried several ways, unless anybody really lattice killer steps up, I will leave it and see alternatives. Sorry to send it again. #Data name <- c(paste ("M", 1:1000, sep = "")) xvar <- s

[R] using lapply

2011-03-09 Thread Kushan Thakkar
I have a function with the follow signare: apply.strategy(instr, strat) where instr and strat are both objects of classes instrument and strategy respectively. I want to apply this function to a list that holds objects of the class instrument. Currently I am doing this by explicit looping: for

[R] aggregate by part of a field

2011-03-09 Thread Hui Du
Hi All, I have a data frame like a = data.frame(date = c(20081201, 20081202, 20081201), product = c("a b c d e", "a b c g h t", "d e h a c e h g"), sales = c(1, 2, 3)) Now I want to aggregate the sales by part of the a$product. 'Product' is the product name, a

Re: [R] cv.lm syntax error

2011-03-09 Thread agent dunham
Yea, sorry, that's what I mean, and v1,...,v5 and factor have the same length, that's why I don't understand the error > dfmod.1 <- data.frame(v1,v2,v3,v4, v5,factor) > CVlm(df= dfmod.1, form.lm = formula(v1 ~ v2+v3+ v4+ v5+ factor), m=3, > seed=29, plotit=TRUE, printit =TRUE) Error en `[.dat

[R] Theil Kendall line as fit?

2011-03-09 Thread jonbfish
I found some code to compute a Kendall-Theil slope estimate and want to add it to a scatter plot. Is there a way to make it appear like a regression fit instead of a line that extends from the edges of the plot? I would like to have the OLS appear as a dotted line and the KT a solid line but as it

[R] Help writing a Scheffe Contrast function for R

2011-03-09 Thread Tyler Rinker
Hello, As a new user of R (less than a month) I have got my hands on several books and am pouting through the net looking for help in gaining understanding of this powerful tool. I am becoming more proficient with using basic functions to conduct basic statistics. I am now looking t

Re: [R] Help with read.csv

2011-03-09 Thread David Wolfskill
On Wed, Mar 09, 2011 at 04:32:29PM -0600, Giovanni Petris wrote: > > 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

[R] How can I manipulate a data.frame that is just created by assign() while still being in the loop?

2011-03-09 Thread Johann Kim
Hello everyone, I want to use a loop to load many files, each into a seperate variable (data.frames) and then - still in the loop - manipulate the present variable/data.frame. So far this works: for (i in 1:2){ var <- paste("var",i,sep="") fileName <- paste(i,"rating.txt", sep="_

Re: [R] PROC NLMIXED what package equivalent in R?

2011-03-09 Thread Bert Gunter
Google on "R mixed effects" ! (or you could use R's search tools -- ?help ) -- Bert On Wed, Mar 9, 2011 at 4:58 PM, Chris Buddenhagen wrote: > To account for likely differences between > families in naturalization rates, we fitted a > generalized linear mixed model, using > PROC NLMIXED in SAS

Re: [R] R console Mac

2011-03-09 Thread Unger, Kristian, Dr.
Thanks Isa. I will post my request to the list that you suggest. Best wishes Kristian Sent from my HTC - Reply message - From: "Ista Zahn" Date: Wed, Mar 9, 2011 22:49 Subject: [R] R console Mac To: "Unger, Kristian, Dr." Cc: "r-help@r-project.org" Hi, The r-sig-mac mailing list is

[R] confidence intervals when using polr()

2011-03-09 Thread Joe P King
Hello, I am running a model with four categories and want predicted probabilities in each category. Now for this example I wont give a counterfactual just the training data is fine but is there anyway to get a confidence interval around the predicted probabilities in each group? I have tried but it

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

2011-03-09 Thread Matt Shotwell
Try here: https://stat.ethz.ch/pipermail/r-help/2003-February/029393.html On Tue, 2011-03-08 at 20:25 -0500, Shira Rockowitz wrote: > I was wondering if anyone could help me figure out how to make a Venn > diagram in R where the circles are scaled to the size of each dataset. I > have looked at

Re: [R] Loop Through Columns to Remove Rows

2011-03-09 Thread Sam Albers
Many thanks for this Jorge. Exactly what I was looking for. I've never encountered any() before. Quite useful. Thanks again! Sam On Wed, Mar 9, 2011 at 1:05 PM, Jorge Ivan Velez wrote: > Hi Sam, > > How about this? > > test[apply(test, 1, function(x) !any(x == '#DIV/0!')), ] > > HTH, > Jorge >

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

2011-03-09 Thread Bill.Venables
Xonly <- XY[, grep("^X", dimnames(XY)[[2]])] -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Nixon, Matthew Sent: Thursday, 10 March 2011 12:20 AM To: r-help@R-project.org Subject: [R] Extracting only odd columns from a matrix H

Re: [R] Cleaning date columns

2011-03-09 Thread Bill.Venables
Here is one possible way (I think - untested code) cData <- do.call(rbind, lapply(split(data, data$prochi), function(dat) { dat <- dat[order(dat$date), ] while(any(d <- (diff(dat$date) <= 3))) dat <- dat[-(min(which(d))+1), ]

[R] PROC NLMIXED what package equivalent in R?

2011-03-09 Thread Chris Buddenhagen
To account for likely differences between families in naturalization rates, we fitted a generalized linear mixed model, using PROC NLMIXED in SAS10, with the naturalization rate per genus (that is, the number of naturalized species in a genus as a proportion of the total number of introduced specie

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

2011-03-09 Thread Duncan Murdoch
On 11-03-09 1:05 PM, rivercode wrote: 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(expr

Re: [R] Frailty model -- Conditional or Marginal?

2011-03-09 Thread Thomas Lumley
On Thu, Mar 10, 2011 at 6:33 AM, hongsheng wu wrote: > 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? The f

Re: [R] Help with read.csv

2011-03-09 Thread Phil Spector
Giovanni - If you change "int" (which has no meaning in R) to "integer" in your second example, it should work. - Phil Spector Statistical Computing Facility Department o

[R] extracting half the rows with unique values from data.frame

2011-03-09 Thread Nicolas Gutierrez
hey!! Another data.frame question: I have the following data.frame (pop) pp=textConnection(" + xloc yloc gonad indEneW Agent + 123 20 516.74 1 0.02 20.21 0.25 + 223 20 1143.20 1 0.02 20.21 0.50 + 323 20 250.00 1 0.02 20.21 0.25 + 422 15

Re: [R] Sapply for descriptive statistics

2011-03-09 Thread David Winsemius
Sent from my iPhone On Mar 9, 2011, at 6:13 PM, David Winsemius wrote: > > > Sent from my iPhone > > On Mar 9, 2011, at 5:59 PM, Tomii wrote: > >> I try to calculate descriptive statistics for one of the variables in the >> data frame, however command sapply calculates these statistics fo

Re: [R] Help with read.csv

2011-03-09 Thread Gabor Grothendieck
On Wed, Mar 9, 2011 at 5:32 PM, Giovanni Petris wrote: > > 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

Re: [R] Sapply for descriptive statistics

2011-03-09 Thread Dennis Murphy
Hi: Perhaps something like this? m <- matrix(rnorm(100, m = 10, s = 2), ncol = 5) colnames(m) <- paste('V', 1:5, sep = '') # Summary function: summs <- function(x) c(mean = mean(x), sd = sd(x), range = diff(range(x))) # Apply to columns of m and transpose the result: t(apply(m, 2, summs)) For

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

2011-03-09 Thread Gabor Grothendieck
On Wed, Mar 9, 2011 at 6:09 PM, Frank Harrell wrote: > Thanks Uwe.  Too bad there is no system option I can set one time, that will > always take precedence. > You could use the Defaults package to change the default value of the lib argument of install.packages. That is put this in your .Rprofi

Re: [R] Sapply for descriptive statistics

2011-03-09 Thread David Winsemius
Sent from my iPhone On Mar 9, 2011, at 5:59 PM, Tomii wrote: > 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 > o

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

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

[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

[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

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

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

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

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

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

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

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

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

[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

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

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

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

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

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:

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

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

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

[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

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

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    

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

  1   2   >