Re: [R] ridiculous behaviour printing to eps: labels all messed

2009-06-09 Thread Eduardo Leoni
Perhaps you should try http://www.rforge.net/pgfSweave/ On Mon, Jun 8, 2009 at 5:38 PM, maiya maja.zaloz...@gmail.com wrote: Wow! Thank you for that Ted, a wonderfully comprehensive explanation and now everything makes perfect sense!! Regarding your last point, I would love to hear other

Re: [R] SECOND MESSAGE: Re: Question about R an SPSS

2009-06-09 Thread Jim Porzak
Diego, Start with Bob Muenchen's site: http://www.rforsasandspssusers.com/ HTH, Jim Porzak TGN.com San Francisco, CA www.linkedin.com/in/jimporzak use R! Group SF: www.meetup.com/R-Users/ On Mon, Jun 8, 2009 at 5:47 PM, DIEGO CHAVEZ diego.cha...@andinanet.netwrote: Sent: Sunday, June 07,

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Wacek Kusnierczyk
Gabor Grothendieck wrote: On Mon, Jun 8, 2009 at 7:18 PM, Wacek Kusnierczykwaclaw.marcin.kusnierc...@idi.ntnu.no wrote: Gabor Grothendieck wrote: Try this. See ?regex for more. x - 'This happened in the 21. century. (the dot behind 21 is' regexpr((?![0-9]+)[.], x, perl =

Re: [R] [R-help] how to install own R withour root?

2009-06-09 Thread Patrick Connolly
On Tue, 09-Jun-2009 at 11:50AM +0800, Daofeng Li wrote: | Dear list members, | | i am currently want to install Rpy2 in a linux box which has R 2.4.0 | installed | RPy requries R 2.7.0 or above | but i have no root previlleges | so my question is how to install R 2.7.0 on my own directory? You

Re: [R] OT: a weighted rank-based, non-paired test statistic ?

2009-06-09 Thread Torsten Hothorn
Date: Fri, 5 Jun 2009 16:09:42 -0700 (PDT) From: Thomas Lumley tlum...@u.washington.edu To: dylan.beaude...@gmail.com Cc: 'r-h...@stat.math.ethz.ch' r-h...@stat.math.ethz.ch Subject: Re: [R] OT: a weighted rank-based, non-paired test statistic ? On Fri, 5 Jun 2009, Dylan Beaudette wrote: Is

Re: [R] SECOND MESSAGE: Re: Question about R an SPSS

2009-06-09 Thread Liviu Andronic
On Tue, Jun 9, 2009 at 2:47 AM, DIEGO CHAVEZdiego.cha...@andinanet.net wrote:  I am reading about the functional features of R statistical software, because I want to compare these progarm with the basic module of SPSS software.  I would like to know  if the  R  version 2.9.0 application  

Re: [R] Regex question to find a string that contains 5-9 alpha-numeric characters, at least one of which is a number

2009-06-09 Thread Wacek Kusnierczyk
Marc Schwartz wrote: On Jun 8, 2009, at 5:27 PM, Barry Rowlingson wrote: On Mon, Jun 8, 2009 at 10:40 PM, Tan, Richardr...@panagora.com wrote: Hi, This is not exactly an R question but I am trying to use gsub to replace a string that contains 5-9 alpha-numeric characters, at least one of

Re: [R] Good Programming Practice Question - Functions in Different Files

2009-06-09 Thread Paul Hiemstra
Hi, I always use source for this kinds of things. If you have a lot of code, you could consider wrapping it into an R-package. This would allow you to load all the code by using the library(myPackage) command. But this might be unnecessary for your situation. cheers, Paul Jason Rupert

Re: [R] Regex question to find a string that contains 5-9 alpha-numeric characters, at least one of which is a number

2009-06-09 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: Marc Schwartz wrote: On Jun 8, 2009, at 5:27 PM, Barry Rowlingson wrote: On Mon, Jun 8, 2009 at 10:40 PM, Tan, Richardr...@panagora.com wrote: Hi, This is not exactly an R question but I am trying to use gsub to replace a string that contains 5-9

Re: [R] [R-help] how to install own R withour root?

2009-06-09 Thread Paul Hiemstra
Hi, In addition. You can also install everything just in your home drive. Using the configure script you can change the installation path of all R related stuff: ./configure --prefix=/home/bla/progsandlibs The binaries end up in ~/progsandlibs/bin, and the libraries in ~/progsandlibs/bin.

[R] Bin-width with wgplot()

2009-06-09 Thread tbigdeli
is there a simple way of altering wgplot() such that binwidth is sufficient to prevent overlap in symbols? i've noticed postings regarding specific plotting functions but not specifically wgplot(). Thanks! -- View this message in context:

[R] Splicing factors without losing levels

2009-06-09 Thread Titus von der Malsburg
Hi list! An operation that I often need is splicing two vectors: splice(1:3, 4:6) [1] 1 4 2 5 3 6 For numeric vectors I use this hack: splice - function(x, y) { xy - cbind(x, y) xy - t(xy) dim(xy) - length(x) * 2 return(xy) } So far, so good (?). But I also need

Re: [R] error installing RCurl in SUSE SLES10-SP2

2009-06-09 Thread Robert Castelo
thanks Duncan, i've updated it and it works now. since it did not complain about version numbers, i did not think that was the problem. i'll take care about it next time. robert. On Fri, 2009-06-05 at 13:35 -0700, Duncan Temple Lang wrote: Hi Robert As Brian Ripley wrote in a message to

Re: [R] help to speed up loops in r

2009-06-09 Thread Jeremiah Rounds
Other then the reengineering of the approach, one thing that helps is don't index rows of data frames via loops... ever. It is actually faster to convert to a matrix, do the operations, and then convert back to a data frame if you have too. As an example I have your code in a function:

Re: [R] Splicing factors without losing levels

2009-06-09 Thread ONKELINX, Thierry
Dear Titus, Your first function can be simplified to splice - function(x, y) { as.vector(rbind(x, y)) } For factors, you better convert them first back to character strings. splice - function(x, y) { x - levels(x)[x] y - levels(y)[y] factor(as.vector(rbind(x,

Re: [R] Splicing factors without losing levels

2009-06-09 Thread Ken Knoblauch
Titus von der Malsburg malsburg at gmail.com writes: An operation that I often need is splicing two vectors: splice(1:3, 4:6) [1] 1 4 2 5 3 6 For numeric vectors I use this hack: splice - function(x, y) { xy - cbind(x, y) xy - t(xy) dim(xy) - length(x) * 2

Re: [R] increase number of ticks on x axis of dates

2009-06-09 Thread Jim Lemon
Graves, Gregory wrote: My x axis is a series of daily dates (e.g., 01/01/2000, 01/02/2000, etc.) from 2000 to end of 2008. The default only gives me 4 ticks. I want more. Why doesn't this work? sdate-as.POSIXct(strptime(date,format=%m/%d/%Y))

Re: [R] Splicing factors without losing levels

2009-06-09 Thread Titus von der Malsburg
On Tue, Jun 09, 2009 at 11:23:36AM +0200, ONKELINX, Thierry wrote: For factors, you better convert them first back to character strings. splice - function(x, y) { x - levels(x)[x] y - levels(y)[y] factor(as.vector(rbind(x, y))) } Thank you very much, Thierry! I

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Gabor Grothendieck
On Tue, Jun 9, 2009 at 3:04 AM, Wacek Kusnierczykwaclaw.marcin.kusnierc...@idi.ntnu.no wrote: Gabor Grothendieck wrote: On Mon, Jun 8, 2009 at 7:18 PM, Wacek Kusnierczykwaclaw.marcin.kusnierc...@idi.ntnu.no wrote: Gabor Grothendieck wrote: Try this.  See ?regex for more. x - 'This

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Wacek Kusnierczyk
Gabor Grothendieck wrote: On Tue, Jun 9, 2009 at 3:04 AM, Wacek Kusnierczykwaclaw.marcin.kusnierc...@idi.ntnu.no wrote: Gabor Grothendieck wrote: On Mon, Jun 8, 2009 at 7:18 PM, Wacek Kusnierczykwaclaw.marcin.kusnierc...@idi.ntnu.no wrote: Gabor Grothendieck wrote:

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Marc Schwartz
On Jun 9, 2009, at 6:44 AM, Mark Heckmann wrote: Hey all, Thanks for your help. Your answers solved the problem I posted and that is just when I noticed that I misspecified the problem ;) My problem is to separate a German texts by sentences. Unfortunately I haven't found an R package doing

[R] R command to join data.frames rows with identical keys?

2009-06-09 Thread Jason Rupert
I've got two data.frames and, when certain keys match, I would like to add the column values from one data frame to the other data.frame. Below I list the two data.frames, i.e. neighborhoodInfo_df, and schoolZone_df. Based on the address key I would like to add the schoolZone key to the

[R] (no subject)

2009-06-09 Thread Jason Rupert
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] R command to join data.frames rows with identical keys?

2009-06-09 Thread Titus von der Malsburg
Have a look at the merge function. Merge two data frames by common columns or row names, or do other versions of database _join_ operations. Titus On Tue, Jun 09, 2009 at 05:48:05AM -0700, Jason Rupert wrote: I've got two data.frames and, when certain keys match, I would like to

[R] removing elements from a unit vector

2009-06-09 Thread baptiste auguie
Dear list, I'm quite surprised by this, unit(1:5,char)[-c(1:2)] #4char 3char # what's going on?? while I expected something like, c(1:5)[-c(1:2)] # 3 4 5 Note that, unit(1:5,char)[c(1:2)] # 1char 2char # fine ?unit warns about unit.c for concatenating, but also says, It is possible to

Re: [R] R command to join data.frames rows with identical keys?

2009-06-09 Thread Titus von der Malsburg
An example: schoolZone1_df - data.frame(address=101, schoolZone=Sherman) schoolZone2_df - data.frame(address=108, schoolZone=Baker) schoolZone_df - rbind(schoolZone1_df, schoolZone2_df) schoolZone_df address schoolZone 1 101Sherman 2 108 Baker neighborhoodInfo1_df -

[R] rpart - the xval argument in rpart.control and in xpred.rpart

2009-06-09 Thread Paolo Radaelli
Dear R users, I'm working with the rpart package and want to evaluate the performance of user defined split functions. I have some problems in understanding the meaning of the xval argument in the two functions rpart.control and xpred.rpart. In the former it is defined as the number of

Re: [R] removing elements from a unit vector

2009-06-09 Thread Duncan Murdoch
On 6/9/2009 9:02 AM, baptiste auguie wrote: Dear list, I'm quite surprised by this, unit(1:5,char)[-c(1:2)] #4char 3char # what's going on?? while I expected something like, c(1:5)[-c(1:2)] # 3 4 5 Note that, unit(1:5,char)[c(1:2)] # 1char 2char # fine ?unit warns about unit.c for

Re: [R] rpart - the xval argument in rpart.control and in xpred.rpart

2009-06-09 Thread Terry Therneau
I have some problems in understanding the meaning of the xval argument in the two functions rpart.control and xpred.rpart. In the former it is defined as the number of cross-validations while in the latter it is defined as the number of cross-validation groups. It is the same thing. If

Re: [R] rpart - the xval argument in rpart.control and in xpred.rpart

2009-06-09 Thread Paolo Radaelli
Usually 10-fold cross validation is performed more than once to get an estimate of the misclassification rate thus I thought number of cross-validations was different from the number of cross-validation groups. So, if I want to perform 10-fold cross-validation more than once (say 5) in order

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Wacek Kusnierczyk
Marc Schwartz wrote: On Jun 9, 2009, at 6:44 AM, Mark Heckmann wrote: Hey all, Thanks for your help. Your answers solved the problem I posted and that is just when I noticed that I misspecified the problem ;) My problem is to separate a German texts by sentences. Unfortunately I haven't

[R] Writing Reports from R in Office Open XML format (ooxmlWeave?)

2009-06-09 Thread Tobias Sing
Dear all, has someone implemented functionality for writing reports from R in Office Open XML format (*), similar to what odfWeave does for the ODF format of OpenOffice? It would be great to have a kind of ooxmlWeave at least for those of us who are forced to work in an MS ecosystem. (*)

[R] R CMD check does not find a mistake

2009-06-09 Thread Christophe Genolini
Hi the list, I build a package. They was a mistake in it, but R CMD check did not find it. Is that normal ? Here is what Kurt gets (which is right, I did this mistake): --- 8 * checking for code/documentation mismatches ... WARNING S4 class codoc mismatches from

Re: [R] Writing Reports from R in Office Open XML format (ooxmlWeave?)

2009-06-09 Thread Duncan Temple Lang
Yes. We will release a version in the next few weeks when I have time to wrap it all up. There is also a Docbook-based version that uses R extensions to Docbook for authoring structured documents. D. Tobias Sing wrote: Dear all, has someone implemented functionality for writing reports from

[R] is it possible to combine multiple barplots?

2009-06-09 Thread Philipp Schmidt
i am working with two sets of likert scale type (4 distinct values) data: dataA - rep(1:4, c(3,2,2,4)) dataB - rep(1:4, c(5,4,3,2)) i can now (bar)plot both of these separately and compare the distributions. plot(table(dataA), type='h') plot(table(dataB), type='h') is there a way to plot both

[R] Isolating a single plot from plots produced simultaneously

2009-06-09 Thread Laura Bonnett
Dear R-Help, I am using the 'mfp' package. It produces three plots (as I am using the Cox model) simultaneously which can be viewed together using the following code: fit - mfp(Surv(rem.Remtime,rem.Rcens)~fp(age)+strata(rpa),family=cox,data=nearma,select=0.05,verbose=TRUE) par(mfrow=c(2,2))

Re: [R] is it possible to combine multiple barplots?

2009-06-09 Thread Titus von der Malsburg
You can use barchart in package lattice. Here's a rough sketch: library(lattice) dataA - rep(1:4, c(3,2,2,4)) dataB - rep(1:4, c(5,4,3,2)) da - data.frame(table(dataA)) db - data.frame(table(dataB)) da$cond - a db$cond - b colnames(da)[1] - data

Re: [R] is it possible to combine multiple barplots?

2009-06-09 Thread Titus von der Malsburg
On Tue, Jun 09, 2009 at 04:39:29PM +0200, Titus von der Malsburg wrote: is there a way to plot both of them in one plot, so that the bars for value 1 (dataA: 3, dataB: 5) would appear side by side, followed by the bars for value 2 etc.? Oh, I see you want something different. I should've

Re: [R] R CMD check does not find a mistake

2009-06-09 Thread Henrik Bengtsson
using R version 2.9.0 beta (2009-04-04 r48290) As a start, Kurt et al. are for sure using a much more recent version (probably also the very latest patched version). /H On Tue, Jun 9, 2009 at 7:17 AM, Christophe Genolinicgeno...@u-paris10.fr wrote: Hi the list, I build a package. They was a

[R] Cairo Package Installation

2009-06-09 Thread Douglas M. Hultstrand
I am trying to install the Cairo package on a linux machine, the Cairo package did not install correctly (could not find cairo.h), I am new to R and linux any help on the installation would be great. Below are output from trying to install the Cairo package, thought this might help.

Re: [R] R CMD check does not find a mistake

2009-06-09 Thread Ingmar Visser
try issueing this before calling R CMD check export _R_CHECK_CODOC_S4_METHODS_=true hth, Ingmar On 9 Jun 2009, at 16:17, Christophe Genolini wrote: Hi the list, I build a package. They was a mistake in it, but R CMD check did not find it. Is that normal ? Here is what Kurt gets (which

Re: [R] R CMD check does not find a mistake

2009-06-09 Thread Uwe Ligges
Henrik Bengtsson wrote: using R version 2.9.0 beta (2009-04-04 r48290) As a start, Kurt et al. are for sure using a much more recent version (probably also the very latest patched version). and if not only then at least also R-devel. Uwe /H On Tue, Jun 9, 2009 at 7:17 AM,

Re: [R] Cairo Package Installation

2009-06-09 Thread Uwe Ligges
Install the cairo headers? Probably in some cairo or cairo-devel package for your OS. Uwe Ligges Douglas M. Hultstrand wrote: I am trying to install the Cairo package on a linux machine, the Cairo package did not install correctly (could not find cairo.h), I am new to R and linux any help

[R] Non-linear regression/Quantile regression

2009-06-09 Thread despaired
Hi, I'm relatively new to R and need to do a quantile regression. Linear quantile regression works, but for my data I need some quadratic function. So I guess, I have to use a nonlinear quantile regression. I tried the example on the help page for nlrq with my data and it worked. But the example

Re: [R] Writing Reports from R in Office Open XML format (ooxmlWeave?)

2009-06-09 Thread Ronggui Huang
Wow, It sounds great. Looking forward to it. 2009/6/9 Duncan Temple Lang dun...@wald.ucdavis.edu: Yes. We will release a version in the next few weeks when I have time to wrap it all up. There is also a Docbook-based version that uses R extensions to Docbook for authoring structured

[R] adonis formula

2009-06-09 Thread Benjamin Gosney
Hello, I have a pretty large data set of insect community data from a tree plantation. There are 14 subraces (fixed) of tree, each with 10 families fixed within subrace. There are then 10 reps (random) of each family, which are in specific part of the plantation. I am trying to

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Mark Heckmann
Thanks, Now it works great. I modified it a bit so the sentences will be split by questionmarks (.?!:), etc. as well. strsplit(gsub(([[:alpha:]][\\.\\?\\!\\:]), \\1*, txt), \\* *) [[1]] e.g. strsplit(gsub(([[:alpha:]][\\.\\?\\!\\:]), \\1*, txt), \\* *) [[1]] [1] One January 1. I saw Rick?

[R] Using ADF.Test

2009-06-09 Thread ehxpieterse
Hi, I am quite new to R and would appreciate some guidance, if possible. I have imported a csv file: spread - read.csv(Spread.csv) I get the following error when I try to run adf.test: adf.test(spread,alternative = c(stationary, explosive),0) Error in embed(y, k) : 'x' is not a vector or

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Mark Heckmann
Hey all, Thanks for your help. Your answers solved the problem I posted and that is just when I noticed that I misspecified the problem ;) My problem is to separate a German texts by sentences. Unfortunately I haven't found an R package doing this kind of text separation in German, so I try it

Re: [R] Splicing factors without losing levels

2009-06-09 Thread Stavros Macrakis
Various people have provided technical solutions to your problem. May I suggest, though, that 'splice' isn't quite the right word for this operation? Splicing two pieces of rope / movie film / audio tape / wires / etc. means connecting them at their ends, either at an extremity or in the middle,

Re: [R] Splicing factors without losing levels

2009-06-09 Thread Titus von der Malsburg
On Tue, Jun 09, 2009 at 11:04:03AM -0400, Stavros Macrakis wrote: This may seem like a minor point, but I think it is worthwhile using descriptive names for functions. Makes sense. I thought I've seen this use somewhere else (probably in Lisp?). What better name do you suggest for this

Re: [R] Non-linear regression/Quantile regression

2009-06-09 Thread Gabor Grothendieck
Those are linear in the coefficients so try these: library(quantreg) rq1 - rq(demand ~ Time + I(Time^2), data = BOD, tau= 1:3/4); rq1 # or rq2 - rq(demand ~ poly(Time, 2), data = BOD, tau = 1:3/4); rq2 On Tue, Jun 9, 2009 at 10:55 AM, despairedmeyfa...@uni-potsdam.de wrote: Hi, I'm

Re: [R] Isolating a single plot from plots produced simultaneously

2009-06-09 Thread David Winsemius
This is almost certainly a device-dependent issue, which is the reason the Posting Guide requests that you include such details. On a Mac using the GUI interface, one can scroll backwards through the graphics windows with cmd-left arrow. With the plot of interest as the focus one can then

Re: [R] using regular expressions to retrieve a digit-digit-dotstructure from a string

2009-06-09 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mark Heckmann Sent: Tuesday, June 09, 2009 4:45 AM To: r-help@r-project.org Cc: waclaw.marcin.kusnierc...@idi.ntnu.no; marc_schwa...@me.com Subject: Re: [R] using regular

Re: [R] Splicing factors without losing levels

2009-06-09 Thread Stavros Macrakis
On Tue, Jun 9, 2009 at 11:16 AM, Titus von der Malsburg malsb...@gmail.comwrote: On Tue, Jun 09, 2009 at 11:04:03AM -0400, Stavros Macrakis wrote: This may seem like a minor point, but I think it is worthwhile using descriptive names for functions. Makes sense. I thought I've seen this

Re: [R] Non-linear regression/Quantile regression

2009-06-09 Thread despaired
Hi, thanks, it works :-) But where is the difference between demand ~ Time + I(Time^2) and demand ~ poly(Time, 2) ? Or: How do I have to interpret the results? (I get different results for the two methods) Thank you again! Gabor Grothendieck wrote: Those are linear in the coefficients so

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Gabor Grothendieck
Another way to handle is to match the contents rather than the delimiters using strapply in gsubfn (http://gsubfn.googlecode.com). Below a sentence is defined as starting with a non-space followed by anything followed by an alpha followed by dot, question mark or exclamation mark. The (?U) means

[R] Sweave and accents

2009-06-09 Thread Arnau Mir Torres
Hello. I want to write my notes in Sweave in my own language (spanish). But my language has accents and when I run Sweave in R to translate my Snw file into the tex file the accents are translated into unrecognizable characters. For example, the word camión (truck) is translated into

[R] calibration curve options

2009-06-09 Thread David A.G
Hi R-users, can anyone explain me how to play around with the options of the bootstrap calibration curve obtained using the calibrate() function in Design package? I am trying to colour the diagonal, i.e. the ideal curve, in red, and also hide the bias-corrected curve. Thanks, Dave

[R] Comparing R and SAs

2009-06-09 Thread Vadlamani, Satish {FLNA}
Hi: For those of you who are adept at both SAS and R, I have the following questions: a) What are some reasons / tasks for which you would use R over SAS and vice versa? b) What are some things for which R is a must have that SAS cannot fulfill the requirements? I am on the ramp up on both of

[R] quantile of a mixture of bivriate normal distributions

2009-06-09 Thread li li
Hi, Does anyone know how to compute the quantile of a mixture of four bivariate normal distriutions? Many thanks! Hannah [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Help with if statements

2009-06-09 Thread Amit Patel
Hi I am trying to create a column in a data frame which gives a sigificane score from 0-7. It should read values from 7 different colums and add 1 to the counter if the value is =0.05. I get an error message saying Error in if (ALLRESULTS[i, 16] = 0.05) significance_count =

Re: [R] Isolating a single plot from plots produced simultaneously

2009-06-09 Thread Thomas Lumley
On Tue, 9 Jun 2009, Laura Bonnett wrote: I'd like to isolate the second plot produced (the estimated functional form of the influence of age on the log relative hazard) so that I can use the 'points' function to add the linear predictors for the untransformed and the log-transformed models. In

Re: [R] Non-linear regression/Quantile regression

2009-06-09 Thread Ravi Varadhan
Try `poly(Time, 2, raw=TRUE)' Here is an example: Time - runif(100) demand - 1 + 0.5 * Time - 1.2 * Time^2 + rt(100, df=4) rq1 - rq(demand ~ Time + I(Time^2), tau = 1:3/4) rq2 - rq(demand ~ poly(Time, 2, raw=TRUE), tau = 1:3/4) all.equal(c(rq1$coef), c(rq2$coef)) Ravi.

Re: [R] Regex question to find a string that contains 5-9 alpha-numeric characters, at least one of which is a number

2009-06-09 Thread Greg Snow
Here is one way using a single pattern (so can be used in a substitution), it uses Perl's positive look ahead patters: test - c(SHRT,5HRT,M1TCH,M1TCH5,LONG3RS,NONUMBER,TOOLNGG,ooops.3) sub( '(?=[a-zA-Z]{0,8}[0-9])[a-zA-Z0-9]{5,9}', 'xxx', test, perl=TRUE) [1] SHRT5HRT

Re: [R] Help with if statements

2009-06-09 Thread Linlin Yan
Try this: for (i in 1:dim(ALLRESULTS)[1]) { ALLRESULTS[i,23] - length(ALLRESULTS[i,][ALLRESULTS[i,16:22] = 0.05]) } On Wed, Jun 10, 2009 at 12:17 AM, Amit Patelamitrh...@yahoo.co.uk wrote: Hi I am trying to create a column in a data frame which gives a sigificane score from 0-7. It should

Re: [R] Help with if statements

2009-06-09 Thread Jorge Ivan Velez
Dear Amit, Try this: significance_count - apply( ALLRESULTS[,16:22], 1, function(x) sum( x = 0.05 ) ) ) HTH, Jorge On Tue, Jun 9, 2009 at 12:17 PM, Amit Patel amitrh...@yahoo.co.uk wrote: Hi I am trying to create a column in a data frame which gives a sigificane score from 0-7. It should

Re: [R] Help with if statements

2009-06-09 Thread Chuck Cleland
On 6/9/2009 12:17 PM, Amit Patel wrote: Hi I am trying to create a column in a data frame which gives a sigificane score from 0-7. It should read values from 7 different colums and add 1 to the counter if the value is =0.05. I get an error message saying Error in if (ALLRESULTS[i, 16] =

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Greg Snow
You can sometimes fake variable width look behinds with Perl regexs using '\K': gregexpr('\\b[0-9]+\\K[.]', 'a. 1. a1. 11.', perl=TRUE) [[1]] [1] 5 13 attr(,match.length) [1] 1 1 -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111

[R] Dependency between packages for Windows-binaries

2009-06-09 Thread Jon Olav Skoien
Hi, I have already asked a similar question without response (https://stat.ethz.ch/pipermail/r-help/2009-June/200300.html) so I am here reformulating in the hope that someone is able to help. If something is unclear, please ask. I am working on the development of two packages, pkg1 and pkg2

Re: [R] Sweave and accents

2009-06-09 Thread Duncan Murdoch
On 6/9/2009 12:07 PM, Arnau Mir Torres wrote: Hello. I want to write my notes in Sweave in my own language (spanish). But my language has accents and when I run Sweave in R to translate my Snw file into the tex file the accents are translated into unrecognizable characters. For example,

Re: [R] Non-linear regression/Quantile regression

2009-06-09 Thread Greg Snow
poly by default uses orthogonal polynomials which work better mathematically but are harder to interpret. See ?poly -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From:

Re: [R] Regex question to find a string that contains 5-9 alpha-numeric characters, at least one of which is a number

2009-06-09 Thread Wacek Kusnierczyk
Greg Snow wrote: Here is one way using a single pattern (so can be used in a substitution), it uses Perl's positive look ahead patters: test - c(SHRT,5HRT,M1TCH,M1TCH5,LONG3RS,NONUMBER,TOOLNGG,ooops.3) sub( '(?=[a-zA-Z]{0,8}[0-9])[a-zA-Z0-9]{5,9}', 'xxx', test, perl=TRUE)

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Stavros Macrakis
On Tue, Jun 9, 2009 at 7:44 AM, Mark Heckmann mark.heckm...@gmx.de wrote: Thanks for your help. Your answers solved the problem I posted and that is just when I noticed that I misspecified the problem ;) My problem is to separate a German texts by sentences. Unfortunately I haven't found an R

Re: [R] Regex question to find a string that contains 5-9 alpha-numeric characters, at least one of which is a number

2009-06-09 Thread Tan, Richard
Sorry I did not give some examples in my previous posting to make my question clear. It's not exactly 1 digit, but at least one digit. Here are some examples: input = c(none='0foo f0oo foo0 foofoofoo0 0foofoofoo TOOL9NGG NONUMBER',all='foob0 fo0o0b 0foob 0foobardo foob4rdoo foobardo0')

Re: [R] calibration curve options

2009-06-09 Thread David Winsemius
It's rather simple to get the code and add modifications. You wanted the dashed line to be red? (To find out what the underlying function name is, you use methods(plot): The dashed ideal line plotting function is not set up to accept parameters. so you need to alter the code. Use this as a

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Gabor Grothendieck
Wacek already mentioned that; however, its still arguably more complex to specify delimiters than to specify content. Aside from having to specify perl = TRUE and ungreedy matching the content-based regexp is entirely straight forward but for lookbehind (including \K) one has the added complexity

Re: [R] Non-linear regression/Quantile regression

2009-06-09 Thread Gabor Grothendieck
The coefficients are different but the predictions are the same. On Tue, Jun 9, 2009 at 12:41 PM, Greg Snowgreg.s...@imail.org wrote: poly by default uses orthogonal polynomials which work better mathematically but are harder to interpret.  See ?poly -- Gregory (Greg) L. Snow Ph.D.

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Greg Snow
Yes, I already apologized to Wacek for missing that and pointing out what he had already said. Given everything in this thread (though it is hard to keep track of all of it, my e-mail client does not keep all the parts of the thread together), this is probably one of those few tasks that R is

Re: [R] calibration curve options

2009-06-09 Thread Frank E Harrell Jr
David A.G wrote: Hi R-users, can anyone explain me how to play around with the options of the bootstrap calibration curve obtained using the calibrate() function in Design package? I am trying to colour the diagonal, i.e. the ideal curve, in red, and also hide the bias-corrected curve.

Re: [R] Sweave and accents

2009-06-09 Thread Eduardo Leoni
1) Please send reproducible code. In this case possibly with a link to the Snw file. 2) Try setting the charset in LaTeX: \usepackage[utf8]{inputenc} On Tue, Jun 9, 2009 at 12:07 PM, Arnau Mir Torres arnau@uib.es wrote: Hello. I want to write my notes in Sweave in my own language

Re: [R] Regex question to find a string that contains 5-9 alpha-numeric characters, at least one of which is a number

2009-06-09 Thread Wacek Kusnierczyk
Tan, Richard wrote: Sorry I did not give some examples in my previous posting to make my question clear. It's not exactly 1 digit, but at least one digit. Here are some examples: input = c(none='0foo f0oo foo0 foofoofoo0 0foofoofoo TOOL9NGG NONUMBER',all='foob0 fo0o0b 0foob

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Gabor Grothendieck
If there were significant advantage to that perl module I would recommend interfacing R to it rather than suffer with perl. For example, see xls2csv (and read.xls) in the gdata package for an example of interfacing to a perl program. I don't want to turn this into an R vs. perl thread but there

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Gabor Grothendieck
This is just to you. You might want to read r-help through gmane.org or one of the other online readers or get a gmail or other online email account just for reading newsgroups to circumvent your thread-challenged email client. Regards. On Tue, Jun 9, 2009 at 1:42 PM, Greg

Re: [R] reading in multiple files

2009-06-09 Thread Sundar Dorai-Raj
You could try: do.call(rbind, lapply(list.files(path/to/files, full = TRUE), read.csv)) And add more arguments to lapply if the files are not csv, have no header, etc. --sundar On Tue, Jun 9, 2009 at 11:18 AM, Erin Hodgesserinm.hodg...@gmail.com wrote: Dear R People: I have about 6000 files

[R] reading in multiple files

2009-06-09 Thread Erin Hodgess
Dear R People: I have about 6000 files to be read in that I'd like to go to one matrix. There are two columns, 1 line in each file. Is there a way to bring them in to produce one matrix or data frame, please? Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and

Re: [R] OT: a weighted rank-based, non-paired test statistic ?

2009-06-09 Thread Dylan Beaudette
On Tuesday 09 June 2009, Torsten Hothorn wrote: Date: Fri, 5 Jun 2009 16:09:42 -0700 (PDT) From: Thomas Lumley tlum...@u.washington.edu To: dylan.beaude...@gmail.com Cc: 'r-h...@stat.math.ethz.ch' r-h...@stat.math.ethz.ch Subject: Re: [R] OT: a weighted rank-based, non-paired test

[R] Convex bounds in the function arms of package HI

2009-06-09 Thread hu yuan
Dear Sir/Madam, i am learning to use a statistical sampling-modle(arms in HI) But i have a problem with the indFunc(bounds of the convex support). I have found a good example of c code using arms function and try to program the example in R. If you are interested, you can find the c code from

Re: [R] scatterplot (car) legend modification

2009-06-09 Thread John Fox
Dear Sam, It's not exactly clear to me what you're doing here, since you appear to be specifying some of the arguments to scatterplot() (and to other functions) in the command used to invoke R. I'm not sure why you would want to do that. That said, you could suppress the legend that

Re: [R] last.warning and Sweave?

2009-06-09 Thread Dieter Menne
Ben Bolker bolker at ufl.edu writes: Sweave does something clever with warnings, which I have so far been ... I thought I could get around this with last.warning , but apparently that doesn't work -- this file doesn't produce the desired output of reproducing the last warning ...

[R] Black-Litterman model

2009-06-09 Thread JannaB
Anyone know where I can obtain an R implementation of the Black- Litterman portfolio model? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] last.warning and Sweave?

2009-06-09 Thread Romain Francois
Not sure either where the warning gets trapped, but you could use something like that: \documentclass{article} \begin{document} Test {\tt last.warning} = withCallingHandlers( { x - log(-1) }, warning = function(w){ assign( last.warning, w, env = baseenv() ) }) @ = last.warning @

[R] Cross correlations on many imported files.

2009-06-09 Thread Pur_045
Hello everyone, I am trying to import all of the csv files from a particular folder and then run cross correlations on each of them. i.e In the end have a matrix like structure with cross correlations. So far I have been able to import all of the data and run the ccf's but I need a way to

[R] surveillance package useful for daily surveillance?

2009-06-09 Thread Christopher W. Ryan
The surveillance package (see below) seems to be mainly designed for weekly or monthly surveillance (although I am still learning about it.) Can it be used for daily surveillance? I had hoped to try using it with respect to daily visits to walk-in clinics in our area. Package ‘surveillance’

Re: [R] Black-Litterman model

2009-06-09 Thread Stefan Grosse
JannaB schrieb: Anyone know where I can obtain an R implementation of the Black- Litterman portfolio model? There is the BLCOP package. hth Stefan __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] IP-Address

2009-06-09 Thread edwin7
Hi Peter, I hope you could help. I am stuck with this. The last problem I have is: I have table like: id rank color status ip 138 29746 yellow yes 162.131.58.1 138 29746 yellow yes 162.131.58.2 138 29746 yellow yes 162.131.58.3 138 29746 yellow yes 162.131.58.4 138 29746 yellow yes

[R] generating new data with for loop

2009-06-09 Thread Gordon J Holtslander
I'm new at R ... I've not done for loops in R - so this is very new to me. One of our students has a data frame that contains two columns data 1. unixtime time of an event (in unix time - #of seconds) 2. duration of event in seconds. We need to create new data - the unixtime (seconds) that

Re: [R] Help with if statements

2009-06-09 Thread Carl Witthoft
quote Error in if (ALLRESULTS[i, 16] = 0.05) significance_count = significance_count + : missing value where TRUE/FALSE needed The script is included below it works if i convert the NA values to zero but this is not appropriate as it includes the zero as significant. ANY SUGGESTIONS

Re: [R] generating new data with for loop

2009-06-09 Thread Henrique Dallazuanna
Try this: x - data.frame(u=c(1:5), seconds=sample(5)) transform(x[rep(1:nrow(x),x$seconds),], seconds = unlist(lapply(split(x$seconds, x$u), seq))) On Tue, Jun 9, 2009 at 6:11 PM, Gordon J Holtslander gordon.holtslan...@usask.ca wrote: I'm new at R ... I've not done for loops in R - so

[R] calculate effect size from p-value?

2009-06-09 Thread Joseph Kambeitz
Dear R-List! Is there any function (apparently for BioStat there is!) to calculate effect sizes with the p-values and sample sizes? That would be really useful for meta-analysis! Thanks for the help! Jokel __ R-help@r-project.org mailing list

  1   2   >