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

2009-06-09 Thread Martin Maechler
> "CG" == Christophe Genolini > on Tue, 09 Jun 2009 16:17:15 +0200 writes: CG> Hi the list, I build a package. They was a mistake in CG> it, but R CMD check did not find it. Is that normal ? CG> Here is what Kurt gets (which is right, I did this CG> mistake): CG>

Re: [R] how to get output from a nested loop

2009-06-09 Thread Linlin Yan
How about like this: > t1 <- data.frame(row.names=c('c1','c2','c3','c4'), mk1=c(1,1,0,0), > mk2=c(0,0,0,1), mk3=c(1,1,1,1), mk4=c(0,0,0,0), mk5=c(0,0,0,1), S=c(4,5,3,2)) > t1 mk1 mk2 mk3 mk4 mk5 S c1 1 0 1 0 0 4 c2 1 0 1 0 0 5 c3 0 0 1 0 0 3 c4 0 1 1 0 1

[R] Creating a specific skewed distribution

2009-06-09 Thread David Arnold
All, Can someone help me create a skewed distribution, mean = 30, with probability of selecting a random number from the distribution greater than or equal 60 equal to 10%? I need the probability density function to equal zero at zero, and have a maximum height at or near 30. Is this possible?

[R] poly regression

2009-06-09 Thread Ning Ma
hi, I want to do a polynomial regression of y on x of degree 2, as following > x<-1:10 > y<-x^2 > lm(y~poly(x,2)) Call: lm(formula = y ~ poly(x, 2)) Coefficients: (Intercept) poly(x, 2)1 poly(x, 2)2 38.5099.9122.98 Which is not what i had expected. If I wrote the expre

[R] how to get output from a nested loop

2009-06-09 Thread Scott Hermann
Dear all, I imagine that this is a trival question, but it has perplexed for most of the day. Any help would be greatly appreciated. Below is an example of what I'm trying to do. Essentially I want to produce all unique 1 x 1 combinations of certain columns from a dataframe, and join these to

[R] Unable to load package:lme4 [ Ubuntu 9.04 ]

2009-06-09 Thread Girish A.R.
Hi folks, When I try to load package 'lme4' on my Linux box (64-bit Ubuntu 9.04), I get the following error: - > library(lme4) Error in dyn.load(file, DLLpath = DLLpath, ...) : function 'cholmod_start' not provided by package 'Matrix' Error: package/namespace

Re: [R] searchpaths

2009-06-09 Thread Ronggui Huang
No. This function is used to get "a list of 'attach'ed _packages_ " rather than search files in your computer. 2009/6/10 : > May I use "searchpaths()" with arguments partially matching file names that > are found in different directories ? > My question is whether this is th R function equivalen

[R] R on EC2 and R CMD javareconf

2009-06-09 Thread Saptarshi Guha
Hello, I am using EC2 to launch several instances. On each instance, I perform the following commands yum -y install R (installs R-2.6) R CMD javareconf sleep 10 wget rpackage.tgz R CMD INSTALL rpackage.tgz Now, rpackage.tgz needs to be built with jni libraries. When the instance is fully up, i l

[R] searchpaths

2009-06-09 Thread mauede
May I use "searchpaths()" with arguments partially matching file names that are found in different directories ? My question is whether this is th R function equivalent of Linux "find" or Windows "search". Both O.S. calls are given a starting point so that they search all diectories from then d

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

2009-06-09 Thread Henrik Bengtsson
library("R.utils"); sourceDirectory("C:/appropriatepath/R/", modifiedOnly=TRUE); On Tue, Jun 9, 2009 at 8:09 PM, spencerg wrote: > Sundar Dorai-Raj taught me to do the following: > >           Rdir <- "c:\appropriatepath\R" > >           Rfiles <- dir(Rdir, pattern='\\.R$', full.names=TRUE) > >  

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

2009-06-09 Thread spencerg
Sundar Dorai-Raj taught me to do the following: Rdir <- "c:\appropriatepath\R" Rfiles <- dir(Rdir, pattern='\\.R$', full.names=TRUE) invisible(lapply(aTR, source)) The "invisible" suppresses the garbage while still displaying error messages. H

Re: [R] Problem : solving a equation with R , fail with uniroot function

2009-06-09 Thread Ben Bolker
Peter Alspach wrote: > > Tena koe Yann > > It may not be the only problem, but you are missing an operator between > (bb0+x+1) and (bb1-x-1). > > And fixing that typo and viewing the function shows that it is a bit problematic on this interval anyway ... (diverges at x = 1, closer look sh

Re: [R] Problem : solving a equation with R , fail with uniroot function

2009-06-09 Thread Peter Alspach
Tena koe Yann It may not be the only problem, but you are missing an operator between (bb0+x+1) and (bb1-x-1). HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of yann lancien > Sent: Wednesday, 10 June 2

[R] LS graph

2009-06-09 Thread osbacan
Hi all, I´m new using R. I wanto to print in a unique plot four results of four different ordinary least squares regressions. You see, I want to plot (on each box of the for parts of the graph, actual, fitted values and on the bottom the residuals). On the other side,if I only want to plot the f

[R] Problem : solving a equation with R , fail with uniroot function

2009-06-09 Thread yann lancien
Hi , I would like to know if a R function have the same behaviour than the matlab solve function. I tried something with uniroot but I have some problems: The equation I need to solve is : exp(c0-r0)*(bb0+x)*(bb1-x)=(bb0+x+1)(bb1-x-1) So I tried this: STEP 1: my function test test <- function(x,

[R] list to data frame; how to store short elements?

2009-06-09 Thread Jim Porzak
This is programming style, best practices type of question. When converting a list to a data frame (eg to use in ggplot), what is "best" way to store descriptive elements? For example, a survfit object mostly maps to a data frame, but I would also like to carry along the type, call, etc. I'm inc

Re: [R] generating new data with for loop

2009-06-09 Thread Ben Bolker
Bugzilla from gordon.holtslan...@usask.ca wrote: > > 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 sec

[R] RODBC sqlSave does not append the records

2009-06-09 Thread Elaine Jones
I am running R version 2.8.1 on Windows XP OS. recs is a one-row, eighteen-column data.frame I want to insert into a DB2 table. sqlSave(channel, recs, tablename = "testappend_slt", append = TRUE, + rownames = FALSE, colnames = FALSE, + verbose = TRUE, oldstyle = FALSE, +

[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 https:

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

Re: [R] Help with if statements

2009-06-09 Thread Carl Witthoft
> 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 SUGGESTION

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

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 162.131.

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 rea

[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’ Apri

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

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.warnin

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

Re: [R] last.warning and Sweave?

2009-06-09 Thread Dieter Menne
Ben Bolker 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 ... > > ===

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 scatterplot()

[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] 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 > > To: dylan.beaude...@gmail.com > > Cc: "'r-h...@stat.math.ethz.ch'" > > Subject: Re: [R] OT: a weighted rank-based, non-paired test statistic ? > > > > On Fri, 5 Jun 2009, Dyl

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

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 Hodgess wrote: > Dear R People: > > I have about 6000 files to be read in th

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 Snow wrote: > Yes, I

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 a

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 fo0o0

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 wrote: > Hello. > > I want to write my notes in Sweave in my own language (spanish). But my

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. Thank

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 n

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 Snow wrote: > 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 Cent

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] 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] 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') > g

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 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 package doing th

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

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: r-help-boun...@r-project.

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, t

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

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,

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

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

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

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

[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 = significance_cou

[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 https://stat.ethz.

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

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

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] Splicing factors without losing levels

2009-06-09 Thread Stavros Macrakis
On Tue, Jun 9, 2009 at 11:16 AM, Titus von der Malsburg wrote: > 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

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] 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 -. With the plot of interest as the focus one can then issue additona

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, despaired wrote: > > Hi, > > I'm relatively new to R and

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 opera

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

[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

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

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

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 : > 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. > > Tob

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

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, Christo

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 i

[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. > install

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 Genolini wrote: > Hi the list, > > I build a package. They was a mistake in it, bu

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 shou

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"

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

[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

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

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

[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. (*) Of

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 orde

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.

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

[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 cross-v

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

[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

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

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

[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

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

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 > Kusnierczyk wrote: > >> Gabor Grothendieck wrote: >> >>> On Mon, Jun 8, 2009 at 7:18 PM, Wacek >>> Kusnierczyk wrote: >>> >>> Gabor Grothendieck wrote: > Try this. See ?regex for more. >>

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 Kusnierczyk wrote: > Gabor Grothendieck wrote: >> On Mon, Jun 8, 2009 at 7:18 PM, Wacek >> Kusnierczyk wrote: >> >>> Gabor Grothendieck wrote: >>> Try this.  See ?regex for more. > x <- 'This happened in the 21. century." (the dot behind

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, Thierr

  1   2   >