Re: [R] Replacing Period in String

2011-03-20 Thread Peter Langfelder
I think it is as simple as adding the argument fixed=TRUE to the function call. txt = "this. is. a. test." gsub(".", "", txt, fixed = TRUE) result [1] "this is a test" HTH, Peter On Sun, Mar 20, 2011 at 9:49 PM, Sparks, John James wrote: > Dear R Users, > > I am working with gsub for the firs

Re: [R] Replacing Period in String

2011-03-20 Thread Jorge Ivan Velez
Hi John, Try gsub("[.]","",txt) See "Extended Regular Expressions" in ?regex. HTH, Jorge * * On Mon, Mar 21, 2011 at 12:49 AM, Sparks, John James <> wrote: > Dear R Users, > > I am working with gsub for the first time. I am trying to remove some > characters from a string. I have hit the p

[R] Replacing Period in String

2011-03-20 Thread Sparks, John James
Dear R Users, I am working with gsub for the first time. I am trying to remove some characters from a string. I have hit the problem where the period is the shorthand for 'everything' in the R language when what I want to remove is the actual periods. In the example below, I simply want to remo

Re: [R] read file part way through based on start and end date (first column)

2011-03-20 Thread Gabor Grothendieck
On Sun, Mar 20, 2011 at 3:47 PM, algotr8der wrote: > Hello folks - I have been trying to figure this out. I have a set of very > large files that are of this format > > , , , , > 1/4/1999,9:31:00 AM,blah, blah, blah > 1/4/1999,9:32:00 AM,blah, blah, blah > 1/4/1999,9:33:00 AM,blah, blah, blah > >

Re: [R] Trouble with simple R list concatenations

2011-03-20 Thread David Winsemius
Try: family <- list(Birth_Date=Birth_Date, Later_Date=Later_Date, Names= Names) family$Birth_Date Sent from my iPhone ( so untested) On Mar 20, 2011, at 9:58 PM, jim holtman wrote: > First of all, you are working with 'vectors' not 'lists'. Look in the > following script what str(f

Re: [R] read file part way through based on start and end date (first column)

2011-03-20 Thread algotr8der
THanks Jim. Eventually I do want to store the records in a database... so mySQL. But right now I want to run some analytics on the data so I'm looking for a quick and dirty solution that can give me the flexibility to extract data on various time periods. I think a perl script that uses Text:CSV_XS

Re: [R] confirmatory factor analysis program in R

2011-03-20 Thread Gustavo Carvalho
Search for lavaan, sem, and OpenMx. On Mon, Mar 21, 2011 at 12:34 AM, rvohen wrote: > thank you !  I will try it ! > > -- > View this message in context: > http://r.789695.n4.nabble.com/confirmatory-factor-analysis-program-in-R-tp3386133p3392279.html > Sent from the R help mailing list archive a

Re: [R] confirmatory factor analysis program in R

2011-03-20 Thread rvohen
thank you ! I will try it ! -- View this message in context: http://r.789695.n4.nabble.com/confirmatory-factor-analysis-program-in-R-tp3386133p3392279.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list h

Re: [R] Trouble with simple R list concatenations

2011-03-20 Thread jim holtman
First of all, you are working with 'vectors' not 'lists'. Look in the following script what str(family) is on your original input. What you probably want is a 'data.frame'. May be time to go back and re-read the "Intro to R" to understand the differences between vectors, lists and dataframes. Y

[R] Trouble with simple R list concatenations

2011-03-20 Thread Jim Burke
PROBLEM How can I concatenate the following lists into ONE LIST WITHOUT the unhelpful message "operator is invalid for atomic vectors"? Combine as a data frame? EXAMPLE Birth_Date <- NULL Birth_Date[1:3] <- c("01/17/1939","01/17/1949", "01/17/1959") Later_Date <- NULL Later_Date[1:3

Re: [R] take me off the R help mailing list.

2011-03-20 Thread Ista Zahn
Subscription options are available at the link at the bottom of this (and every r-help) email. Best, Ista On Sun, Mar 20, 2011 at 11:25 PM, Dan Davis wrote: > take me off the R help mailing list. > >        [[alternative HTML version deleted]] > > __ >

Re: [R] read file part way through based on start and end date (first column)

2011-03-20 Thread jim holtman
Depends on what version of R you are using. If you are running a 32 bit version and if all the columns were numeric, if you had about 20 columns, I would guess that might require 300MB for a single copy of the object and for the reading in and then subsetting, you might require 3-4X that space. S

Re: [R] manova question

2011-03-20 Thread John Fox
Dear Peter and Ranjan, In addition to Anova(), linearHypothesis() in the car package handles multivariate linear models, including those for repeated measures. Best, John John Fox Senator William McMaster Professor of Social Statistics Department of Sociology

[R] take me off the R help mailing list.

2011-03-20 Thread Dan Davis
take me off the R help mailing list. [[alternative HTML version deleted]] __ 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

Re: [R] predicting values from multiple regression

2011-03-20 Thread Ista Zahn
Hi Anna, Maybe you can start again and tell us what you are trying to accomplish. If you are trying to calculate predicted values for the cases in the data set used to fit the model you don't need the newdata argument at all. Just do predict(model9) If you are trying to do something else, please

Re: [R] manova question

2011-03-20 Thread peter dalgaard
On Mar 20, 2011, at 21:05 , Ranjan Maitra wrote: > Dear friends, > > Sorry for this somewhat generically titled posting but I had a question > with using contrasts in a manova context. So here is my question: > > Suppose I am interested in doing inference on \beta in the case of the > model giv

Re: [R] read file part way through based on start and end date (first column)

2011-03-20 Thread algotr8der
Thanks Jim for the reply. The file has 1,183,318 rows and there are 20 such files. Too big for R to handle? -- View this message in context: http://r.789695.n4.nabble.com/read-file-part-way-through-based-on-start-and-end-date-first-column-tp3391769p3392005.html Sent from the R help mailing lis

Re: [R] problem with xyplot

2011-03-20 Thread David Winsemius
On Mar 20, 2011, at 4:06 PM, askh wrote: Hi all, I am having a problem using xyplot from lattice library. I am plotting one variable against another one, conditioning on two other variablesm one of which has 3 levels and the other 6 levels. The output is thus a 6x3 panel plot. Here's my

Re: [R] Feature request: rating/review system for R packages

2011-03-20 Thread Heinz Tuechler
It's unclear to me, why the rating/review system should relate to entire packages. Would it not be more informative, if single specific functions would be rated and reviewed? I would like to see if "+" is rated better than "-", or if more difficulties are reported for "*" than for "/". I could t

Re: [R] predicting values from multiple regression

2011-03-20 Thread David Winsemius
On Mar 20, 2011, at 3:56 PM, Anna Lee wrote: Dear Ista! Thank you for replying. The point you made is exactly what's the problem: I want to predict the values at different points in space. calP stands for the water content at each sampling point (n=90) but I don't quite understand what R does.

Re: [R] problem with xyplot

2011-03-20 Thread Bert Gunter
Are Pos and Consld -- which CANNOT be in Stops -- the same length unsubscripted as the subscripted variables? Do all the combinations of levels of these variables actually occur (you can check with table() )? You would also probably do better to use the subset argument of xyplot to subset the dat

Re: [R] How to draw a map of Europe?

2011-03-20 Thread Michael Friendly
On 3/19/2011 8:32 PM, Sally Luo wrote: Also, is it possible to draw a historical map of European countries using R? If you want a map of France ~ 1830, see http://www.datavis.ca/gallery/guerry/guerrymap.html __ R-help@r-project.org mailing list https

Re: [R] read file part way through based on start and end date (first column)

2011-03-20 Thread jim holtman
How big is the file? WHy not read the entire file in and then use 'subset' to extract only the data that you want? If the file is too large to be able to read in, then you could put it in a database and use SQL to extract what you want. You could also create a 'perl' script to filter the data be

Re: [R] Why unique(sample) decreases the performance ?

2011-03-20 Thread jim holtman
One thing that it would be good to learn is how to use Rprof to look at where time is being spent in your script. Most of the time (over 80%) is spent in the 'unique' call which is doing absolutely nothing in your code since you are not assigning its output to an object. Here is what I saw when ru

[R] manova question

2011-03-20 Thread Ranjan Maitra
Dear friends, Sorry for this somewhat generically titled posting but I had a question with using contrasts in a manova context. So here is my question: Suppose I am interested in doing inference on \beta in the case of the model given by: Y = X %*% \beta + e where Y is a n x p matrix of observa

[R] problem with xyplot

2011-03-20 Thread askh
Hi all, I am having a problem using xyplot from lattice library. I am plotting one variable against another one, conditioning on two other variablesm one of which has 3 levels and the other 6 levels. The output is thus a 6x3 panel plot. Here's my code: print((xyplot(CloDurPercent[CloDurNA != 'NA'

[R] read file part way through based on start and end date (first column)

2011-03-20 Thread algotr8der
Hello folks - I have been trying to figure this out. I have a set of very large files that are of this format , , , , 1/4/1999,9:31:00 AM,blah, blah, blah 1/4/1999,9:32:00 AM,blah, blah, blah 1/4/1999,9:33:00 AM,blah, blah, blah I want to write R code that reads only that data between a start an

Re: [R] Convert Sweave document to a function

2011-03-20 Thread Martin Morgan
Hi David -- On 03/20/2011 12:19 PM, David.Epstein wrote: I like Sweave, which I consider to be a great contribution. I have just written a .Rnw document that comes to about 6 pages of mixed code and mathematical explanation. Now I want to turn the R code into a function. My R code currently cont

Re: [R] predicting values from multiple regression

2011-03-20 Thread Anna Lee
Dear Ista! Thank you for replying. The point you made is exactly what's the problem: I want to predict the values at different points in space. calP stands for the water content at each sampling point (n=90) but I don't quite understand what R does. calP is my vector of measured data and I thought

Re: [R] predicting values from multiple regression

2011-03-20 Thread Ista Zahn
Hi Anna, On Sun, Mar 20, 2011 at 2:54 PM, Anna Lee wrote: > Hey List, > > I did a multiple regression and my final model looks as follows: > > model9<-lm(calP ~ nsP + I(st^2) + distPr + I(distPr^2)) > > Now I tried to predict the values for calP from this model using the > following function: > >

Re: [R] exploring dist()

2011-03-20 Thread Gavin Simpson
On Fri, 2011-03-18 at 06:21 -0700, bra86 wrote: > Hello, everybody, > > I hope somebody could help me with a dist() function. > I have a data frame of size 2*4087 (col*row), where col corresponds to the > treatment and rows are So you have 4087 species? If yes, normally, you'd have the species i

[R] Convert Sweave document to a function

2011-03-20 Thread David.Epstein
I like Sweave, which I consider to be a great contribution. I have just written a .Rnw document that comes to about 6 pages of mixed code and mathematical explanation. Now I want to turn the R code into a function. My R code currently contains statements like N<-1000 and theta<- pi/10. In the next

[R] Package Installation

2011-03-20 Thread Bogaso Christofer
Dear all, can somebody guide me how to install the package RQuantLib, for which windows binary is not available. I have tried installing it with R CMD INSTALL in my windows vista machine (I have Rtools installed), however it stopped due to an error saying: "compilation failed for package 'RQuantLib

Re: [R] Feature request: rating/review system for R packages

2011-03-20 Thread Ben Bolker
Dieter Menne menne-biomed.de> writes: > > > > After pondering all the pros and cons regarding the usefulness of a > > rating/review system for R packages, don't you think it would make sense > > to implement such a thing? > > > > Or to look what is there, and how little it is filled: > > htt

[R] predicting values from multiple regression

2011-03-20 Thread Anna Lee
Hey List, I did a multiple regression and my final model looks as follows: model9<-lm(calP ~ nsP + I(st^2) + distPr + I(distPr^2)) Now I tried to predict the values for calP from this model using the following function: xv<-seq(0,89,by=1) yv<-predict(model9,list(distPr=xv,st=xv,nsP=xv)) The pr

Re: [R] legend position in "barplot"

2011-03-20 Thread Uwe Ligges
On 20.03.2011 18:52, Hongwei Dong wrote: Hi, R users, I there a way that I can control the position of the legend while using "barplot" function? For example: a<-matrix(c(0,0,0.5,0.8,0.9,0.9),2,3) colnames(a)<-c("X","Y","Z") rownames(a)<-c("A","B") a barplot(a,width = 0.2,legend = TRUE,axes=FA

Re: [R] Pearson correlation coefficient matrix with permutation test

2011-03-20 Thread herbert8686
Hello Gabor, Thanks for your response. There are certainly several offers in R to construct confidence envelopes. But here I am specifically interested in sort of a summary output such as provided by the function cor(). I have more than a thousand correlations and I just need for each correlat

Re: [R] Why unique(sample) decreases the performance ?

2011-03-20 Thread ufuk beyaztas
Sorry, the last part of code does not work when uniqu() are used, the true version; e <- rnorm(n=50, mean=0, sd=sqrt(0.5625)) x0 <- c(rep(1,50)) x1 <- rnorm(n=50,mean=2,sd=1) x2 <- rnorm(n=50,mean=2,sd=1) x3 <- rnorm(n=50,mean=2,sd=1) x4 <- rnorm(n=50,mean=2,sd=1) y <- 1+ 2*x1+4*x2+3*x3+2*x4+e x2[

[R] legend position in "barplot"

2011-03-20 Thread Hongwei Dong
Hi, R users, I there a way that I can control the position of the legend while using "barplot" function? For example: a<-matrix(c(0,0,0.5,0.8,0.9,0.9),2,3) colnames(a)<-c("X","Y","Z") rownames(a)<-c("A","B") a barplot(a,width = 0.2,legend = TRUE,axes=FALSE,col=c("coral3","steelblue3"),beside=TRU

Re: [R] Feature request: rating/review system for R packages

2011-03-20 Thread Dieter Menne
> After pondering all the pros and cons regarding the usefulness of a > rating/review system for R packages, don't you think it would make sense > to implement such a thing? > Or to look what is there, and how little it is filled: http://crantastic.org/ Dieter -- View this message in conte

[R] Feature request: rating/review system for R packages

2011-03-20 Thread Janko Thyson
Dear List, I'm aware that this has been brought up before (e.g. http://tolstoy.newcastle.edu.au/R/e6/help/09/03/7365.html ; https://stat.ethz.ch/pipermail/r-help/2009-March

Re: [R] (no subject)

2011-03-20 Thread Jeff Newmiller
1) If you think McAfee is interfering, then you should look toward your support options for that software to help you remove the setting that relates to R or rcom. You may be able to test your theory by disabling that software temporarily. 2) If R is working at the console, and RGui is working,

Re: [R] Finding Imported Packages

2011-03-20 Thread Uwe Ligges
On 20.03.2011 17:38, Derek Ogle wrote: Is there a function similar to pkgDepends() that returns the packages that a particular package imports or imports from? I believe I can get this information from the matrix returned from installed.packages() but something like pkgDepends() would be mo

Re: [R] Pearson correlation coefficient matrix with permutation test

2011-03-20 Thread Gabor Grothendieck
On Sun, Mar 20, 2011 at 10:45 AM, wrote: > Hello, > > I found an interesting program on Pierre Legendre's webpage: > > http://www.bio.umontreal.ca/casgrain/en/labo/corr_permute.html > > With this program one can compute a "Pearson correlation coefficient matrix > with permutation test". > > This

[R] Finding Imported Packages

2011-03-20 Thread Derek Ogle
Is there a function similar to pkgDepends() that returns the packages that a particular package imports or imports from? I believe I can get this information from the matrix returned from installed.packages() but something like pkgDepends() would be more convenient. I did not find anything use

[R] (no subject)

2011-03-20 Thread Mitri, Joanna
HI, While I was working on R , I had a pop up from mcafee asking me if I wasih to block or allow something to connect. I did not see r in the question, so I had clicked on the option " block". since then, when I start R through excel , I only get R console and I do nto get R script anymore.

[R] Why unique(sample) decreases the performance ?

2011-03-20 Thread ufuk beyaztas
Hi, I' am interested in differences between sample's result when samples consist of full elements and consist of only distinct elements. When sample consist of full elements it take about 120 sec., but when consist of only distinct elements it take about 4.5 or 5 times more sec. I expected that op

Re: [R] Problems with package npmc

2011-03-20 Thread carloskij
Thanks for your answer, Peter. I solved it. The problem actually seemed to be in tha data format in the SPSS file I imported into R. C. -- View this message in context: http://r.789695.n4.nabble.com/Problems-with-package-npmc-tp3390472p3390915.html Sent from the R help mailing list archive at N

[R] Pearson correlation coefficient matrix with permutation test

2011-03-20 Thread herbert8686
Hello, I found an interesting program on Pierre Legendre's webpage: http://www.bio.umontreal.ca/casgrain/en/labo/corr_permute.html With this program one can compute a "Pearson correlation coefficient matrix with permutation test". This is exactly what I need as an R-package because so far I h

Re: [R] Referring to objects themselves

2011-03-20 Thread Kenn Konstabel
On Sun, Mar 20, 2011 at 12:43 PM, Duncan Murdoch wrote: > On 11-03-19 10:21 PM, Kenn Konstabel wrote: > >> On Sun, Mar 20, 2011 at 4:13 AM, Kenn Konstabel >> wrote: >> >> you can omit the list and do the following: >>> >>> >>> /.../ >>> >>> (but you don't really need "this" in this case as you

Re: [R] Part of a density plot

2011-03-20 Thread Dennis Murphy
Hi: Here's a lattice version: y <- rbeta(1, 2, 5) densityplot( ~ y, xlim = c(0, 1), plot.points = FALSE, panel = function(x, y, ...) { p <- seq(0.001, 0.999, by = 0.001) panel.densityplot(x, col = 'blue', ...) panel.xyplot(p, dbeta(p, 2

Re: [R] Referring to objects themselves

2011-03-20 Thread Duncan Murdoch
On 11-03-19 10:21 PM, Kenn Konstabel wrote: On Sun, Mar 20, 2011 at 4:13 AM, Kenn Konstabel wrote: you can omit the list and do the following: /.../ (but you don't really need "this" in this case as you can use "balance" instead of "this$balance") P.S. using "this" would make some diff

Re: [R] R as a non-functional language

2011-03-20 Thread peter dalgaard
On Mar 20, 2011, at 06:46 , Russ Abbott wrote: > I'm afraid I disagree. As a number of people have shown, it's certainly > possible to get the end result > >> pH <- c(4.5,7,7.3,8.2,6.3) >> names(pH) <- c('area1','area2','mud','dam','middle') >> pH > area1 area2muddam middle > 4.5

Re: [R] Using the Mahalanobis Function

2011-03-20 Thread Tyler Rinker
My aplogies: The Table of effects did not come through as I had intended them to. HEre they are reformatted: Again I would like to see someone actually run mahalanobis() for this data set to arrive at ?1 and ?2. I do not know what exactly (after reading the manual) goes in for x,center,or c

Re: [R] R as a non-functional language

2011-03-20 Thread Johannes Huesing
Russ Abbott [Sun, Mar 20, 2011 at 06:46:04AM CET]: > I'm afraid I disagree. I don't think there is much disagreement. You have been shown that there is a functional way to rephrase your example. I suppose you don't disagree that the structure() expression has no side effects. And hardly anyone