[R] Change current plot window size. Or - saving/loading current device plotting history

2010-03-02 Thread Tal Galili
Hello dear R-help members, Very soon I am to give a lecture on R. And in that lecture I intend to move between: par(mfrow = c(1,1)) to par(mfrow = c(1,2)) back and forth. I anticipate this will damage the image proportions and will force me to resize the window. So far I have found it is possible

[R] [R-pkgs] Version 1.4.7 of package vars

2010-03-02 Thread Matthieu Stigler
Dear useRs, The package vars, implementing multivariate time series models VAR and VECM, has been updated to version 1.4.7 The new changes are: -the compatibility with the sandwich/lmtest package, which allows to use heteroskedasticity consistent (HC) covariance estimators, to do inference

[R] Trouble With for() Loops

2010-03-02 Thread Milo Phillips-Brown
Hello, I'm trying to learn R (for fun!), and I've tried to find any previous discussion of this problem (or something like it) and haven't found one. When I run the following command, R seems to simply stop. I get no error message, but I also have no ">" or "+" to type after (although I can

Re: [R] bigglm Memory Issues

2010-03-02 Thread Ian Renner
Anybody? To: r-help@r-project.org Sent: Tue, March 2, 2010 2:23:19 PM Subject: bigglm Memory Issues Hi all, I'm somewhat of a novice in terms of programming, so I thought I'd come here to seek some help with an issue I'm having. [[elided Yahoo spam]] Here

Re: [R] Working with combinations

2010-03-02 Thread David Winsemius
On Mar 2, 2010, at 9:15 PM, Herm Walsh wrote: I am working with the combinations function (available in the gtools package). However, rather than store all of the possible combinations I would like to check each combination to see if it meets a certain criteria. If it does, I will then s

Re: [R] Working with combinations

2010-03-02 Thread Duncan Temple Lang
I think there are several packages that implement combinations and several that allow you to specify a function to be called when each vector of combinations is generated. I can't recall the names of all such packages, but the Combinations package on www.omegahat.org/Combinations is one. D.

[R] Output from test script during R CMD check

2010-03-02 Thread DarioAustralia
Hello, In the .R file I put in the tests directory, I have a number of cat("My text here") type statements, that explain when a certain test completed successfully but everything I tried so far (like putting sink(NULL) at the top of the .R file) hasn't worked. Does someone know what to do here ?

Re: [R] Output to sequentially numbered files... also, ideas for running R on Xgrid

2010-03-02 Thread Mario Valle
write.csv(x, file=sprintf("prefix%05d.csv", n)) On 02-Mar-10 23:26, JWC wrote: Hello, I have some code to run on an XGrid cluster. Currently the code is written as a single, large job... this is no good for trying to run in parallel. To break it up I have basically taken out the highest lev

Re: [R] Help with Loading a Package

2010-03-02 Thread Ista Zahn
Hi Stephanie, You can load() the data file: load("/path/to/drosEmbryoRMA.rda") or install the package as instructed: install.packages("/path/to/drosEmbryo.tar.gz", repos=NULL) # linux or mac :-) install.packages("/path/to/drosEmbryo.zip", repos=NULL) # windows :-( Best, Ista On Tue, Mar 2, 201

[R] Help with Loading a Package

2010-03-02 Thread Stephanie Cooke
I am trying to use these commands to load a package: library(Biobase) library(limma) library(drosEmbryo) data(drosEmbryoRMA) The drosEmbryoRMA is .rda file. I have always loaded .txt files and I have never heard of a .rda file and I can not figure out how to load it. This file comes in a zip f

Re: [R] turn character string into unevaluated R object

2010-03-02 Thread Sharpie
Tim Calkins-2 wrote: > > fortune('parse') > -- > Tim Calkins > 0406 753 997 > Or would that be: fortune( 106 ) ? - Charlie Sharpsteen Undergraduate-- Environmental Resources Engineering Humboldt State University -- View this message in context: http://n4.nabble.com/turn-character-str

[R] Working with combinations

2010-03-02 Thread Herm Walsh
I am working with the combinations function (available in the gtools package).  However, rather than store all of the possible combinations I would like to check each combination to see if it meets a certain criteria.  If it does, I will then store it. I have looked at the combinations code but

[R] R beginner

2010-03-02 Thread azman
hello, i'am is new in R software.i have try to make a function but it can't give what it should.i dunno what have to do next. Can somebody help me to solve it.i'll very appreciate... ##GEV simulation(Non-stationary) dsim<-function(n, alpha, beta,sca,sha){ t <- 1:n location <- alpha + beta*t inv.d

[R] Help with multtest (rawp2adjp)

2010-03-02 Thread Sahil Seth
Hello R experts, I am trying to analyze this dataset and am stuck on this problem for quite some time now. I am using mt.rawp2adjp. the output that came out was a matrix with two colums since I had asked it to calculate the adjusted p values using one method. so it has the two columns as: rawp BH

[R] Output to sequentially numbered files... also, ideas for running R on Xgrid

2010-03-02 Thread JWC
Hello, I have some code to run on an XGrid cluster. Currently the code is written as a single, large job... this is no good for trying to run in parallel. To break it up I have basically taken out the highest level for-loop and am planning on batch-running many jobs, each one representing an in

[R] Correct nested design for GLM

2010-03-02 Thread Rebecca Lawrence
Hi, I am currently running the following negative binomial GLM: glm89.nb <- glm.nb(AvGUD ~ Year*Trt*Micro + (0 + Micro/Trt/Year)) where Year has 3 levels, Trt has 2 levels, and Micro has 3 levels. >From what I have read the above model has a 3 way interaction (Year*Trt*Micro), and Micro is nest

[R] Indexing zoo objects

2010-03-02 Thread Worik R
I have a zoo object z z Value 2003-11-15 2.22 2003-11-17 2.26 2003-11-19 2.28 2003-11-22 2.54 2003-11-26 2.55 I wish to find the entry 2 entries before "2003-11-26". How do I do this? I thought I might be able to say index(z["2003-11-26"]) and have it return 5 so I could then s

Re: [R] distribution for random effects?

2010-03-02 Thread Ben Bolker
Maureen Ryan ucdavis.edu> writes: > > Hi R users, > > I am using the following model to analyze data from a factorial experiment > (randomized complete block design with no replication within blocks): > > model <- glm(survival ~ density * vegetation + (1|block), data=sal2005, > family="binomia

Re: [R] two questions for R beginner

2010-03-02 Thread David Winsemius
On Mar 2, 2010, at 8:01 AM, Paul Hiemstra wrote: Brandon Zicha wrote: Hey Paul, Hey Brandon, (adding R-help in the cc) I agree with you that the documentation of R could be better, especially with more examples in code showing not only the common cases, but also more esoteric cases. It w

Re: [R] R / R+ Webminar *** R-PLUS Rocks: Interactive, Comprehensible and Highly Visual. March 12th @ 12PM ET (USA Time)

2010-03-02 Thread Kim Jung Hwa
Is R-PLUS free as R is? Thanks, On Tue, Mar 2, 2010 at 4:28 PM, s...@xlsolutions-corp.com < s...@xlsolutions-corp.com> wrote: > Welcome to R/ R-PLUS Webminar Series. R-PLUS 3.3 Rocks: Interactive, > Comprehensible and Highly Visual. > http://www.xlsolutions-corp.com/webminar.asp. > > March 12th @

Re: [R] parallel computing--help

2010-03-02 Thread Adam D. I. Kramer
Hi Sayan, Just stumbled upon this email, three months old, since I was having the same problem, and noticed you hadn't been answered. I was able to solve this problem by noting that the "snow" library was not installed on the nodes--it has to be installed everywhere. So, you need to ssh

Re: [R] help with lattice boxplots...

2010-03-02 Thread Kim Jung Hwa
Thanks a lot All ! On Mon, Mar 1, 2010 at 12:22 PM, Walmes Zeviani wrote: > > In complement to Dallazuanna's solution, use box.umbrella=list() inside > par.settings() to change the default color and line type specification: > > bwplot(y~x, data=ex, pch="|", > par.settings=list(box.rectangle

Re: [R] bwplot() {lattice}

2010-03-02 Thread Peng Cai
Thanks Deepayan ! On Sun, Feb 28, 2010 at 2:08 PM, Deepayan Sarkar wrote: > On Sat, Feb 27, 2010 at 8:14 PM, Peng Cai > wrote: > > Thanks a lot Deepayan, one question: > > > > Is it possible to place these barplots side-by-side instaed of super > > imposing? Something like this: > > http://www.i

[R] missing time intervals in data frame

2010-03-02 Thread Kindra Martinenko
Hi All, I am looking for the exact same solution for times as for dates found in the thread located here http://www.mail-archive.com/r-help@r-project.org/msg84833.html What I need is to merge specified data frame of seven 10 minute intervals between 5:00 PM (17:00) and 6:00 PM (18:00) 5:00:00 PM

Re: [R] turn character string into unevaluated R object

2010-03-02 Thread Tim Calkins
fortune('parse') But if you have a vector of file names you can create a blank list and read.table each file into a list. I generally find that if I'm reading a bunch of files in at the same time they are probably related and I will end up coming back and putting them all in to a list anyways. f

Re: [R] data.table evaluating columns

2010-03-02 Thread Tom Short
On Tue, Mar 2, 2010 at 7:09 PM, Rob Forler wrote: > Hi everyone, > > I have the following code that works in data frames taht I would like tow > ork in data.tables . However, I'm not really sure how to go about it. > > I basically have the following > > names = c("data1", "data2") > frame = data.f

Re: [R] Three most useful R package

2010-03-02 Thread Sharpie
Ralf B wrote: > > Hi R-fans, > > I would like put out a question to all R users on this list and hope > it will create some feedback and discussion. > > 1) What are your 3 most useful R package? and > > 2) What R package do you still miss and why do you think it would make > a useful addition

Re: [R] Three most useful R package

2010-03-02 Thread Cedrick Johnson
I think it depends on your particular domain, mine is in finance: Quantmod PerformanceAnalytics And Diethelm Wuertz's collection of packages (fOptions, fPortfolio,etc) Rgds, C On 3/2/10, Ralf B wrote: > Hi R-fans, > > I would like put out a question to all R users on this list and hope > it wil

Re: [R] test the goodness of it for negative binomial type 2

2010-03-02 Thread Achim Zeileis
On Tue, 2 Mar 2010, casperyc wrote: [code]library(MASS) x=c(rep(0,8096), rep(1,1629), rep(2,233), rep(3,38), rep(4,4) ) x.bar=round(mean(x),4) x.var=round(var(x),4) p.hat=round(x.bar/x.var,4) alpha.hat=round(x.bar*p.hat/(1-p.hat),4) fitdistr(x, "Negative Bi

[R] data.table evaluating columns

2010-03-02 Thread Rob Forler
Hi everyone, I have the following code that works in data frames taht I would like tow ork in data.tables . However, I'm not really sure how to go about it. I basically have the following names = c("data1", "data2") frame = data.frame(list(key1=as.integer(c(1,2,3,4,5,6)), key2=as.integer(c(1,2,3

[R] test the goodness of it for negative binomial type 2

2010-03-02 Thread casperyc
[code]library(MASS) x=c(rep(0,8096), rep(1,1629), rep(2,233), rep(3,38), rep(4,4) ) x.bar=round(mean(x),4) x.var=round(var(x),4) p.hat=round(x.bar/x.var,4) alpha.hat=round(x.bar*p.hat/(1-p.hat),4) fitdistr(x, "Negative Binomial") fitdistr(x, "Poisson")[/c

Re: [R] Binding a matrix to a matrix

2010-03-02 Thread Rolf Turner
On 3/03/2010, at 12:14 PM, Peter Ehlers wrote: > On 2010-03-02 15:32, Rolf Turner wrote: >> >> On 3/03/2010, at 11:22 AM, Luis Felipe Parra wrote: >> >>> Hello I have a 2x10x200 matrix and I would like to bind to it another 2x10 >>> matrix in order to end up with an 2x10x2001 matrix, which comm

Re: [R] turn character string into unevaluated R object

2010-03-02 Thread Liviu Andronic
On 3/2/10, carol white wrote: > How to turn a character string into an unevaluated R object? I want to load > some > I'm not sure if this is what you're looking for: > as.name("iris") iris > parse(text="iris") expression(iris) attr(,"srcfile") > head(eval(as.name("iris"))) Sepal.Length Sepal.

Re: [R] Binding a matrix to a matrix

2010-03-02 Thread Peter Ehlers
On 2010-03-02 15:32, Rolf Turner wrote: On 3/03/2010, at 11:22 AM, Luis Felipe Parra wrote: Hello I have a 2x10x200 matrix and I would like to bind to it another 2x10 matrix in order to end up with an 2x10x2001 matrix, which command should i use in order to do this? Thank you (a) It's not a

Re: [R] Random real numbers

2010-03-02 Thread Carl Witthoft
Well, to be mathematically correct, you cannot choose random real numbers for the simple reason that we don't even have names for all the reals. As all of you know (I hope :-) ), there are the same number (aleph-1) of reals in any length line segment you wish. Aside from the unlikelihood that

Re: [R] turn character string into unevaluated R object

2010-03-02 Thread Duncan Murdoch
On 02/03/2010 5:42 PM, carol white wrote: Hi, How to turn a character string into an unevaluated R object? I want to load some files in a directory into data matrix R objects. I could do this with read.table and assign (see below). Then, I want to turn the character string representing a file

Re: [R] Binding a matrix to a matrix

2010-03-02 Thread Bert Gunter
Because you're binding on the last dimension, the default ordering of arrays will do the job for you, so that the following works without abind(): ## a1 is your 2 x 10 x 200 array ## m1 is your 2 x 10 matrix. ## Then the 2 x 10 x 201 array your want (note the 2001 typo in your note ) is: NewArra

[R] turn character string into unevaluated R object

2010-03-02 Thread carol white
Hi, How to turn a character string into an unevaluated R object? I want to load some files in a directory into data matrix R objects. I could do this with read.table and assign (see below). Then, I want to turn the character string representing a file name (the evaluated expression of i) into an

Re: [R] Binding a matrix to a matrix

2010-03-02 Thread Rolf Turner
On 3/03/2010, at 11:22 AM, Luis Felipe Parra wrote: > Hello I have a 2x10x200 matrix and I would like to bind to it another 2x10 > matrix in order to end up with an 2x10x2001 matrix, which command should i > use in order to do this? Thank you (a) It's not a ***matrix***. Matrices are ***two***

Re: [R] Three most useful R package

2010-03-02 Thread Tal Galili
Hi Ralf, My list would probably be: reshape + plyr lattice / ggplot2 and maybe Car / Hmisc BUT, I think the real answer would come from further use of the community of: http://crantastic.org/ (Or if that website could have collected and presented some data automatically...) Tal ---

Re: [R] Binding a matrix to a matrix

2010-03-02 Thread Greg Snow
If it is 3 dimensional then it is an array, not a matrix. The abind function in the abind package is probably what you want. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-

[R] Binding a matrix to a matrix

2010-03-02 Thread Luis Felipe Parra
Hello I have a 2x10x200 matrix and I would like to bind to it another 2x10 matrix in order to end up with an 2x10x2001 matrix, which command should i use in order to do this? Thank you Felipe Parra [[alternative HTML version deleted]] __ R-help

[R] selection simulation

2010-03-02 Thread vasquez
Hi, I was having trouble developing a looping function in a selection simulation that I'm trying to develop and I was hoping if someone could help. Basically, I have a matrix with a random generated numbers representing scores on the variables. The rows represent applicants and columns represent t

[R] Creating a timeSeries "Data Frame"

2010-03-02 Thread Luis Felipe Parra
Hello I have 2000 univariate timeSeries of about 20 observations each, as the following, I would like to store all of them in one object, sort of a data frame, and to be able to recall each by its column name, which by the way is the same as the first date. Do you know how can I do this. Thank you

[R] R / R+ Webminar *** R-PLUS Rocks: Interactive, Comprehensible and Highly Visual. March 12th @ 12PM ET (USA Time)

2010-03-02 Thread s...@xlsolutions-corp.com
Welcome to R/ R-PLUS Webminar Series. R-PLUS 3.3 Rocks: Interactive, Comprehensible and Highly Visual. http://www.xlsolutions-corp.com/webminar.asp. March 12th @ 12PM ET (USA Time) Increase your productivity with R-PLUS 3.3 by attending the webminar and learning how to: 1. Interactively clicki

Re: [R] variable substitution in for loops

2010-03-02 Thread Jon Erik Ween
Friends Seems I've run into another snag. More of the nitty-gritty r-details I don't understand. So, as I mentioned below, dataset[[var_sub]] seems to be understood well by the functions I previously used and I was able to run my loop successfully with the [[var_sub]] as a variable-substitutio

Re: [R] problem with choose.files

2010-03-02 Thread jim holtman
Try this; specify where you want the second one to start: files.a <- choose.files() # now change to the directory of the first file name to continue search files.b <- choose.files(paste(dirname(files.a[1L]), "*", sep='/')) On Tue, Mar 2, 2010 at 12:17 PM, Caleb Rounds wrote: > I have recently up

Re: [R] add a header to a forest plot (metafor)

2010-03-02 Thread Viechtbauer Wolfgang (STAT)
Hi Sebastian, Here is an example showing a forest plot with some column headings: library(metafor) data(dat.bcg) dat <- dat.bcg res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, measure="RR") windows(width=6.5, he

Re: [R] Gradient Boosting Trees with correlated predictors in gbm

2010-03-02 Thread Max Kuhn
On Tue, Mar 2, 2010 at 2:43 PM, Liaw, Andy wrote: > In most implementations of boosting, and for that matter, single tree, > the first variable wins when there are ties. They must be in a union :-) >> What happens if there's a third? If they were P perfectly correlated predictors, the importanc

[R] Three most useful R package

2010-03-02 Thread Ralf B
Hi R-fans, I would like put out a question to all R users on this list and hope it will create some feedback and discussion. 1) What are your 3 most useful R package? and 2) What R package do you still miss and why do you think it would make a useful addition? Pulling answers together for these

[R] distribution for random effects?

2010-03-02 Thread Maureen Ryan
Hi R users, I am using the following model to analyze data from a factorial experiment (randomized complete block design with no replication within blocks): model <- glm(survival ~ density * vegetation + (1|block), data=sal2005, family="binomial") Does R use a binomial distribution in this for

Re: [R] Strange behavior with poisosn and glm

2010-03-02 Thread Rolf Turner
On 2/03/2010, at 9:02 PM, Noah Silverman wrote: > Hi, > > I'm just learning about poison links for the glm function. > > One of the data sets I'm playing with has several of the variables as > factors (i.e. month, group, etc.) > > When I call the glm function with a formula that has a factor

Re: [R] Gradient Boosting Trees with correlated predictors in gbm

2010-03-02 Thread Liaw, Andy
In most implementations of boosting, and for that matter, single tree, the first variable wins when there are ties. In randomForest the variables are sampled, and thus not tested in the same order from one node to the next, thus the variables are more likely to "share the glory". Best, Andy Fro

Re: [R] Gradient Boosting Trees with correlated predictors in gbm

2010-03-02 Thread Patrick Connolly
On Mon, 01-Mar-2010 at 12:01PM -0500, Max Kuhn wrote: |> In theory, the choice between two perfectly correlated predictors is |> random. Therefore, the importance should be "diluted" by half. |> However, this is implementation dependent. |> |> For example, run this: |> |> set.seed(1) |> n <-

Re: [R] capturing errors in Sweave

2010-03-02 Thread Sundar Dorai-Raj
What I ended up using was: cat(unclass(tmp)) --sundar On Tue, Mar 2, 2010 at 8:58 AM, Berwin A Turlach wrote: > G'day Sundar, > > On Tue, 2 Mar 2010 01:03:54 -0800 > Sundar Dorai-Raj wrote: > > > Thanks, Berwin. That works just great! > > You are welcome. > > I noticed by now that "cat(tmp)" i

Re: [R] Creating matrix from long table in database (pivoting)

2010-03-02 Thread Henrique Dallazuanna
Or better: reshape(cbind(DF, value = 1), v.names = 'value', idvar = 'V1', timevar = 'V2', direction = 'wide') On Tue, Mar 2, 2010 at 3:49 PM, Henrique Dallazuanna wrote: > Try this: > > DF <- read.table(textConnection("1 this > 1 is > 1 the > 1 first > 1 row > 2 this > 2 is > 2 the > 2 send > 2

Re: [R] Creating matrix from long table in database (pivoting)

2010-03-02 Thread Phil Spector
Jan - Here's one way: tbl = data.frame(id=c(1,1,1,1,1,2,2,2,2,2), text=c('this','is','the','first','row','this','is','the','second','row')) xtabs(~id+text,tbl) text id first is row second the this 1 1 1 1 0 11 2 0 1 1 1 11 It'

[R] Adjacency matrix of higher order (from winbugs to to R)

2010-03-02 Thread Julien Beguin
Hi everyone, I am trying to find a way to calculate an adjacency matrix from a polygon shapefile to make a CAR model in winbugs, but I would like to vary the order of neihborhood. I used the the spdep package to create an adjacency matrix (in list format) of order 2 and it works

Re: [R] Creating matrix from long table in database (pivoting)

2010-03-02 Thread Henrique Dallazuanna
Try this: DF <- read.table(textConnection("1 this 1 is 1 the 1 first 1 row 2 this 2 is 2 the 2 send 2 row")) reshape(DF, v.names = 'V2', idvar = 'V1', timevar = 'V2', direction = 'wide') On Tue, Mar 2, 2010 at 3:35 PM, Jan Hornych wrote: > Hi all, > > I have a table in database that is very long

[R] Compare parameter estimates of a nlsList object

2010-03-02 Thread Jens Currie
Hello together, Is there a tool to test the statistical differences between parameter estimates of an nlsList fit, with more than two groups? I am able to complete the nlme function for two groups after getting starting paramaters in nlsList, as seen below. >fit.nlme <- nlme(rate ~ SSmicmen(con

[R] plotting fitted lme values as a smooth line

2010-03-02 Thread Alexandra R Contosta
I am trying to plot fitted lme values as a smooth line of a graph showing the exponential relationship between temperature and soil respiration. In the plot, the x-axis has temperature, and the y-axis has soil respiration. When I try to add a line showing temperature versus the fitted va

Re: [R] adding row ID numbers by group

2010-03-02 Thread Alexander Schwall
Thank you gentlemen, all three solutions are working and very insightful. Your help and time is very much appreciated. Alexander On Tue, Mar 2, 2010 at 1:08 PM, Felipe Carrillo wrote: > Like this? > > group<- c(1,1,1,1,2,2,2,2,2,3,3,3,3,3,3) > var2<- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) > da

Re: [R] two questions for R beginners

2010-03-02 Thread Keo Ormsby
Liviu Andronic escribió: On Mon, Mar 1, 2010 at 11:49 PM, Liviu Andronic wrote: On 3/1/10, Keo Ormsby wrote: Perhaps my biggest problem was that I couldn't (and still haven't) seen *absolute beginners* documents. there was once a link posted on r-sig-teaching that would prob

[R] Creating matrix from long table in database (pivoting)

2010-03-02 Thread Jan Hornych
Hi all, I have a table in database that is very long and when simplified it has only two columns in it (id, text). id is the row, and text is the column. Technically the text is a term and and id is the document. If simplifying this and assuming there is only one occurrence of the term per the doc

[R] Fwd: Building R packages in Windows 7

2010-03-02 Thread Eric Ferreira
-- Forwarded message -- From: Duncan Murdoch Date: 25 February 2010 22:30 Subject: Re: [R] Building R packages in Windows 7 To: Eric Ferreira On 25/02/2010 7:56 PM, Eric Ferreira wrote: > Thank you, Sir, but how can I demand it to create HTML files? > The tools::Rd2HTML functi

[R] how to import map data (maptools?) from a html set of 'coords'

2010-03-02 Thread sylvain willart
Dear R users, I would like to draw map and import it in maptools/spatstat packages. The 'raw data' I have come from a web page (...) and are basically a list of coordinates of a polygon. I would like to know how to import them in R; I checked the maptools packages, but all the examples use exist

Re: [R] adding row ID numbers by group

2010-03-02 Thread Felipe Carrillo
Like this? group<- c(1,1,1,1,2,2,2,2,2,3,3,3,3,3,3) var2<- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) data<-data.frame(group, var2) data ddply(data,"group",transform,ID=1:length(group))   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California,

Re: [R] two questions for R beginners

2010-03-02 Thread John Sorkin
William, I agree that changing syntax can lead to problems. I don't, however think extending the language will break existing code. Providing a common syntax for accessing matrices and dataframes will not change the way things have been done to date, but rather how things will be done in the fut

Re: [R] adding row ID numbers by group

2010-03-02 Thread Henrique Dallazuanna
Try this: data$ID <- with(data, ave(group, group, FUN = seq)) On Tue, Mar 2, 2010 at 2:53 PM, Alexander Schwall wrote: > Hello R community, > > I am hoping for some help with the following problem. > > I have a data frame containing various groups. These groups are identified > by a grouping va

Re: [R] two questions for R beginners

2010-03-02 Thread Duncan Murdoch
On 02/03/2010 11:53 AM, William Dunlap wrote: > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of John Sorkin > Sent: Tuesday, March 02, 2010 3:46 AM > To: Karl Ove Hufthammer; r-h...@stat.math.ethz.ch > Subject: Re: [R] two que

[R] adding row ID numbers by group

2010-03-02 Thread Alexander Schwall
Hello R community, I am hoping for some help with the following problem. I have a data frame containing various groups. These groups are identified by a grouping variable. I would like to add a sequential ID number to each group to later sort these individuals within each group by this ID number.

Re: [R] Reading data file with both fixed and tab-delimited fields

2010-03-02 Thread Marshall Feldman
Ah, I should have mentioned this. Personally I work on Macs (Leopard) and PC's (XP Pro and XP Pro x64). Even though the PC's do have Cygwin, I'm trying to make this code portable. So I want to avoid such things as sed, perl, etc. I want to do this in R, even if processing is a bit slower. Event

[R] add a header to a forest plot (metafor)

2010-03-02 Thread Sebastian Stegmann
Dear R-community, I'm currently trying to assemble a forest plot using the "forest" function from package "metaphor". Works well. Even the regular "main"-argument works for adding a title to the graph. However, I would like to add one top row which explains the nature of the columns. Very

Re: [R] Reading data file with both fixed and tab-delimited fields

2010-03-02 Thread Chidambaram Annamalai
I tried to shoehorn the read.* functions and match both the fixed width and the variable width fields in the data but it doesn't seem evident to me. (read.fwf reads fixed width data properly but the rest of the fields must be processed separately -- maybe insert NULL stubs in the remaining fields a

[R] problem with choose.files

2010-03-02 Thread Caleb Rounds
I have recently upgraded to R 2.10.1 on Windows XP and am using scripts that I've used in previous versions successfully. I'm having a problem with choose.files. The lines read: fura_scan_file<-choose.files(caption="Select log file (*.log) for fura-2 scans") PI_scan_file<-choose.files(caption="Sel

Re: [R] nu-SVM crashes in e1071

2010-03-02 Thread Steve Lianoglou
Hi, On Tue, Mar 2, 2010 at 11:05 AM, Häring, Tim (LWF) wrote: > >> > I`m using SVMs for multi-class classification problems. Therefore I`m >> using the svm() function in the package "e1071". >> > If I use svm(...type="C-classification") everything works fine. But >> if I want to use nu-SVM with s

Re: [R] capturing errors in Sweave

2010-03-02 Thread Berwin A Turlach
G'day Sundar, On Tue, 2 Mar 2010 01:03:54 -0800 Sundar Dorai-Raj wrote: > Thanks, Berwin. That works just great! You are welcome. I noticed by now that "cat(tmp)" is sufficient; the "tmp[1]" in "cat(tmp[1])" was a left over from earlier attempts to get the output to look correct. Cheers,

Re: [R] two questions for R beginners

2010-03-02 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of John Sorkin > Sent: Tuesday, March 02, 2010 3:46 AM > To: Karl Ove Hufthammer; r-h...@stat.math.ethz.ch > Subject: Re: [R] two questions for R beginners > > Please take what foll

Re: [R] kriging with geoR package

2010-03-02 Thread patrocle
hi all. If someone have the same problems this is the answer: -vertical legend : > legend.krige(x.leg=c(X,X),y.leg=c(X,X),kr$pred,vert=TRUE,col="gray"(seq(.7,0,l=10))) -sample's positions on the map: ###coords.dat=table$coords### like in >image(kr,col="gray"(seq(.7,0,l=10)),xlim=c(-1

Re: [R] Random real numbers

2010-03-02 Thread Barry Rowlingson
On Tue, Mar 2, 2010 at 4:05 PM, Paul Hiemstra wrote: > frederik vanhaelst wrote: >> >> Hi, >> >> How could i generate random real numbers between 0 en 2*pi? >> >> Thanks, > > Googeling for "R generate random number" gave this as a second hit (on my > machine): > > http://blog.revolution-computing

Re: [R] plotting a subset of a time series

2010-03-02 Thread Gabor Grothendieck
Try this: plot(window(x, end = c(2006, 10))) On Tue, Mar 2, 2010 at 2:19 AM, Erin Hodgess wrote: > Dear R People: > > I have the following time series and plot: >> x <- ts(rnorm(50),start=2005,freq=12) >> plot(x) >> > > which works fine. > > I would like to plot a subset of that time series, whi

Re: [R] nu-SVM crashes in e1071

2010-03-02 Thread Uwe Ligges
On 02.03.2010 17:05, Häring, Tim (LWF) wrote: I`m using SVMs for multi-class classification problems. Therefore I`m using the svm() function in the package "e1071". If I use svm(...type="C-classification") everything works fine. But if I want to use nu-SVM with svm(..., type="nu-classifica

Re: [R] plotting a subset of a time series

2010-03-02 Thread davidr
The indexing in xts is very nice; it may do what you want. library(xts) x.xts <- as.xts(x) plot(x.xts) plot(x.xts['2005::2006-10']) HTH, David Reiner -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Erin Hodgess Sent: Tuesday, March

[R] Reading data file with both fixed and tab-delimited fields

2010-03-02 Thread Marshall Feldman
Hello R wizards, What is the best way to read a data file containing both fixed-width and tab-delimited files? (More detail follows.) _*Details:*_ The U.S. Bureau of Labor Statistics provides local area unemployment statistics at ftp://ftp.bls.gov/pub/time.series/la/, and the data are document

Re: [R] Random real numbers

2010-03-02 Thread Paul Hiemstra
frederik vanhaelst wrote: Hi, How could i generate random real numbers between 0 en 2*pi? Thanks, Frederik [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] nu-SVM crashes in e1071

2010-03-02 Thread LWF
> > I`m using SVMs for multi-class classification problems. Therefore I`m > using the svm() function in the package "e1071". > > If I use svm(...type="C-classification") everything works fine. But > if I want to use nu-SVM with svm(..., type="nu-classification", nu=0.5) > R crashes immediately. No

[R] Fwd: Building R packages in Windows 7

2010-03-02 Thread Eric Ferreira
-- Forwarded message -- From: Duncan Murdoch Date: 25 February 2010 22:35 Subject: Re: [R] Building R packages in Windows 7 To: RHelp , Eric Ferreira On 25/02/2010 7:56 PM, Eric Ferreira wrote: > Thank you, Sir, but how can I demand it to create HTML files? > The tools::Rd2HTM

Re: [R] nu-SVM crashes in e1071

2010-03-02 Thread Uwe Ligges
On 02.03.2010 15:41, Häring, Tim (LWF) wrote: Hello ! I`m using SVMs for multi-class classification problems. Therefore I`m using the svm() function in the package "e1071". If I use svm(...type="C-classification") everything works fine. But if I want to use nu-SVM with svm(..., type="nu-clas

Re: [R] Strange behavior with poisosn and glm

2010-03-02 Thread Gavin Simpson
On Tue, 2010-03-02 at 00:58 -0800, Noah Silverman wrote: > Ted, > > Brilliant explanation (as usual) > > I'm back in school, just starting on a post-graduate degree in stats so > the help is really appreciated. > > Now, I have a slightly trickier question about the same model. > > I've seen mo

[R] nu-SVM crashes in e1071

2010-03-02 Thread LWF
Hello ! I`m using SVMs for multi-class classification problems. Therefore I`m using the svm() function in the package "e1071". If I use svm(...type="C-classification") everything works fine. But if I want to use nu-SVM with svm(..., type="nu-classification", nu=0.5) R crashes immediately. No er

Re: [R] simple data transformation question

2010-03-02 Thread Albert-Jan Roskam
Hi Henrique,   *Thank you!* The reshape code does precisely what I want. Cheers!! Albert-Jan ~~ In the face of ambiguity, refuse the temptation to guess. ~~ --

Re: [R] ANOVA "Types" and Regression models: the same?

2010-03-02 Thread Frank E Harrell Jr
Sorry there were 2 typos in my note: John Fox's posting provided a lot of information. Briefly, the "Types" refer to whether effects are adjusted for all other effects in the model (Types II, III, IV) or no (Type I or sequential tests only adjust for no -> not EARLIER terms in the model).

Re: [R] two questions for R beginner

2010-03-02 Thread Paul Hiemstra
Brandon Zicha wrote: Hey Paul, Hey Brandon, (adding R-help in the cc) I agree with you that the documentation of R could be better, especially with more examples in code showing not only the common cases, but also more esoteric cases. It would be great if everyone invested a lot of time to w

Re: [R] ANOVA "Types" and Regression models: the same?

2010-03-02 Thread Frank E Harrell Jr
Ravi Kulkarni wrote: Hello, I think I am beginning to understand what is involved in the so-called "Type-I, II, ..." ANOVAS (thanks to all the replies I got for yesterday's post). I have a question that will help me (and others?) understand it better (or remove a misunderstanding): I know tha

Re: [R] Row-wisely converting a data frame into a list

2010-03-02 Thread David Winsemius
On Mar 2, 2010, at 8:11 AM, Sebastian Bauer wrote: Hello, is there an elegant way, how I can convert each row of a data frame into distinct elements of a list? split(dfrm, rownames(dfrm)) In essence, what I'm looking for is something like rows.to.lists <- function( df ) { ll <-

Re: [R] simple data transformation question

2010-03-02 Thread Henrique Dallazuanna
Try this: reshape(cbind(id = as.numeric(dtf$var), dtf, time = with(dtf, ave(value, var, FUN = seq))), timevar="time", direction="wide") Or: xtabs(value ~ var + ave(value, var, FUN = seq), data = dtf) On Tue, Mar 2, 2010 at 9:40 AM, Albert-Jan Roskam wrote: > Hi all, > I have a (hopefully) si

Re: [R] Stack type

2010-03-02 Thread Gabor Grothendieck
Here is an example using proto based on converting Duncan's example: library(proto) Stack <- proto(new = function(.) proto(Stack, stack = NULL, push = function(., el) .$stack <- c(list(el), .$stack), pop = function(.) { stopifnot(length(.$stack) > 0) out <-

Re: [R] ANOVA "Types" and Regression models: the same?

2010-03-02 Thread Liaw, Andy
If memory serves, Bill Venables said in the paper cited several times here, that there's only one type of sums of squares. So there's only one type of "ANOVA" (if I understand what you mean by ANOVA). Just forget about the different types of tests, and simply ask yourself this (hopefully simple a

Re: [R] Row-wisely converting a data frame into a list

2010-03-02 Thread Sebastian Bauer
Hi! On 03/02/2010 02:22 PM, Nutter, Benjamin wrote: as.data.frame(t(df)) For example x<- as.data.frame(t(mtcars)) typeof(x) [1] "list" Thanks for the quick reply! I would never have guessed that as.data.frame() works that way! BTW This one seems also to do the trick: rows.to.list <- f

Re: [R] Double Colors in Main

2010-03-02 Thread Romain Francois
See this thread : http://finzi.psych.upenn.edu/Rhelp10/2009-January/185693.html On 03/02/2010 02:18 PM, Lorenzo Isella wrote: Dear All, Consider the following trivial code snippet rm(list=ls()) name_vec <- c("color1", "color2") pdf("test_color.pdf") plot(seq(5), seq(5), main=paste(name_vec[1

  1   2   >