Re: [R] Examples of advanced data visualization

2008-11-29 Thread Yihui Xie
For the motion chart, I've written a quick example in R (for the Brownian Motion): ## put random numbers in Google API # n: number of movie frames # p: number of points g.brownian.motion = function(n = 50, p = 20, start = 1900, digits = 14, file = "brownian.motion.html", width = 800, heigh

Re: [R] how to input a string without quote

2008-11-29 Thread Yihui Xie
Wow, you are so lazy... But sometimes R is just designed for lazy guys... ## f = function(a) { s = substitute(a) as.character(s) } ## > f(a = asdf) [1] "asdf" > f(qwer) [1] "qwer" Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +

Re: [R] confidence interval for glm

2008-11-29 Thread David Winsemius
?confint.glm # ... in MASS On Nov 28, 2008, at 9:29 AM, Gerard M. Keogh wrote: Hi all, simple Q: how do I extract the upper and lower CI for predicted probabilities directly for a glm - I'm sure there's a one line to do it but I can't find it. the predicted values I get with the predic

Re: [R] Using grep() to subset lines of text

2008-11-29 Thread Gabor Grothendieck
Try this. For each character x in s, if "x" is punctuation it is replaced with "\\x" otherwise with "[x]" : library(gsubfn) gsubfn('.', ~ if (any(grep("[[:punct:]]", x))) paste0('\\', x) else paste0('[', x, ']'), s) See http://gsubfn.googlecode.com On Sat, Nov 29, 2008 at 10:09 PM, Stavros Mac

[R] help: unbalanced repeated measures

2008-11-29 Thread Sumitrajit Dhar
Hi folks, I am trying to figure out how run a repeated measures ANOVA on the following data set. subject trial frequency dplvl 1 FSI052A A 1NA 2 FSI052B B 1NA 3 FSI053A A 1NA 4 FSI055A A 1NA 5 FSI055B B 1NA

Re: [R] Using grep() to subset lines of text

2008-11-29 Thread Stavros Macrakis
But I don't want to ignore all regexp's -- I want to build a regexp which contains string components which are parameters. -s On Sat, Nov 29, 2008 at 6:51 PM, Gabor Grothendieck <[EMAIL PROTECTED] > wrote: > grep has a fixed = TRUE argument if you want to ignore all regexp's. > > On

Re: [R] Reading mixed tables

2008-11-29 Thread Hesen Peng
That's a very good idea! Thanks a lot. On Sat, Nov 29, 2008 at 9:13 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Try this. First we read it in using fill = TRUE so that > lines with one number get filled out with NAs. The first > line is T so assign first cell to T and create DF0 which >

Re: [R] Snow and multi-processing

2008-11-29 Thread Martin Morgan
Hi Marco -- Do you know about Bioconductor, http://bioconductor.org ? The rowttests function in the genefilter package will do what you want efficiently and on a single node. > # install the package > source('http://bioconductor.org/biocLite.R') > biocLite('genefilter') > # do 500k t-tests > libr

[R] selectively importing functions etc. from files

2008-11-29 Thread Faheem Mitha
Hi, If I want to import the contents of a R file into another one, I can do source("foo.R") However, this imports everything from foo.R, including all functions and global variables. Is there a way of selectively importing individual functions etc., in a similar fashion to Python's from fo

Re: [R] Reading mixed tables

2008-11-29 Thread Gabor Grothendieck
Try this. First we read it in using fill = TRUE so that lines with one number get filled out with NAs. The first line is T so assign first cell to T and create DF0 which does not have that line. Then split the data into a list of data frames starting each group at the line with the NA in column

Re: [R] Reading mixed tables

2008-11-29 Thread Hesen Peng
Yes. I'm just for killing time in the rainy weekend. Now I'm using readLines() to read the file and then output the data as a list. google.read.list <- function(filename){ temp <- readLines(filename) out <- NULL tt <- NULL for(i in 1:length(temp)){ strin <- as.numeric(strsplit(temp[i],

Re: [R] Reading mixed tables

2008-11-29 Thread David Winsemius
Have you looked at the documentation and help files for R Import/Export; http://cran.r-project.org/doc/manuals/R-data.pdf and the read functions ?read.table ?readLines ?count.fields This is pretty basic stuff. After an extremely cursory look at that problem I was guessing that it is more lik

[R] Snow and multi-processing

2008-11-29 Thread Blanchette, Marco
Dear R gurus, I have a very embarrassingly parallelizable job that I am trying to speed up with snow on our local cluster. Basically, I am doing ~50,000 t.test for a series of micro-array experiments, one gene at a time. Thus, I can easily spread the load across multiple processors and nodes.

[R] Reading mixed tables

2008-11-29 Thread Hesen Peng
Dear R buddies, This weekend I became interested in solving Google Code Jam problems using R. I guess R may work very well in this kind of contests but the input of file has been a problem for me. Take this case for example (http://code.google.com/codejam/contest/dashboard?c=agdjb2RlamFtchALEghjb2

Re: [R] Using grep() to subset lines of text

2008-11-29 Thread Gabor Grothendieck
grep has a fixed = TRUE argument if you want to ignore all regexp's. On Sat, Nov 29, 2008 at 3:55 PM, Stavros Macrakis <[EMAIL PROTECTED]> wrote: > Hmm, this brings up an interesting question. What if the string I'm looking > for contains escape characters? For example, grep( paste( "^", "(ab)"

Re: [R] LaTeX and R-scripts/-results

2008-11-29 Thread Oliver Bandel
Hello Thomas (and all), Zitat von Thomas Petzoldt <[EMAIL PROTECTED]>: > Oliver Bandel wrote: > > Hello, > > > > at some places I read about good interaction of > > LaTeX and R. > > > > Can you give me a starting point, where I can find > > information about it? > > > > Are there special LaTeX-p

Re: [R] optimization problem

2008-11-29 Thread Ben Bolker
tedzzx gmail.com> writes: > > > Hi, all > > I am facing an optimization problem. I am using the function optim(par,fun), > but I find that every time I give different original guess parameter, I can > get different result. For example > I have a data frame named data: > head(data) >price

Re: [R] Using grep() to subset lines of text

2008-11-29 Thread Stavros Macrakis
Hmm, this brings up an interesting question. What if the string I'm looking for contains escape characters? For example, grep( paste( "^", "(ab)" ), c("ab","(ab)") ) => c(1), not c(2). I couldn't find an equivalent to Emacs's regexp-quote, which would let me write regexp.quote("(ab)") => "\\(ab\

Re: [R] Examples of advanced data visualization

2008-11-29 Thread Stavros Macrakis
On Fri, Nov 28, 2008 at 4:13 PM, Tom Backer Johnsen <[EMAIL PROTECTED]>wrote: > Hans W. Borchers wrote: > ...The question is interesting, but what I have a somewhat negative reaction > to is the next passage: > >> Please answer to my e-mail address. In case enough interesting material >> comes up,

Re: [R] chron and R 2.8

2008-11-29 Thread Gabor Grothendieck
Are you using the same version of chron both times? On Sat, Nov 29, 2008 at 10:05 AM, stephen sefick <[EMAIL PROTECTED]> wrote: > has anyone had problems with the upgrade to R 2.8 and chron date > classes. I have a large zoo object that has a chron index, and it is > taking 5x or so longer to do

[R] chron and R 2.8

2008-11-29 Thread stephen sefick
has anyone had problems with the upgrade to R 2.8 and chron date classes. I have a large zoo object that has a chron index, and it is taking 5x or so longer to do the same calculation as with 2.7 if it doesn't fail. I will provide anything necessary I am not entirely sure what ya'll would need if

Re: [R] how to input a string without quote

2008-11-29 Thread Gabor Grothendieck
This works if you type it in from the R console: > s <- readline() this is my string > s [1] "this is my string" On Sat, Nov 29, 2008 at 9:41 AM, Jinsong Zhao <[EMAIL PROTECTED]> wrote: > Hi there, > > I hope to use a string as an input in my function, however, I don't want > to input the quot

[R] how to input a string without quote

2008-11-29 Thread Jinsong Zhao
Hi there, I hope to use a string as an input in my function, however, I don't want to input the quotation mark. Is it possible? Thanks in advance. Regards, Jinsong __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

[R] 2D density tophat

2008-11-29 Thread Aaron Robotham
Hello R users, I have successfully created a square (or more generally, rectangular) tophat smoothing routine based on altering the already available KDE2D. I would be keen to implement a circular tophat routine also, however this appears to be much more difficult to write efficiently (I have a rou

[R] need package telecommunication

2008-11-29 Thread Fatima-Zahra ELGHAZOULI
Helo, I'm looking for package and database concerning egalisation in telecommunication. Please can you help me to find it on R. Thank you for your help. -- Fatima-Zahra ELGHAZOULI Elève Ingénieur GSTR5 ENSA Tanger - www.ensat.ac.ma [[alternative HTML version deleted]] __

[R] how to input a string without quote

2008-11-29 Thread Jinsong Zhao
Hi there, I hope to use a string as an input in my function, however, I don't want to input the quotation mark. Is it possible? Thanks in advance. Regards, Jinsong __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

Re: [R] Subset by string name?

2008-11-29 Thread jim holtman
You need Yut_are <- subset (Yut, Mark=="Arecaceae", select=c(X, Y, Mark)) for equality test (two "==") On Sat, Nov 29, 2008 at 5:22 AM, Ophelia Wang <[EMAIL PROTECTED]> wrote: > Hi all, > > I thought this should be very simple, but I'm not sure where the > problem is. I have a .txt data file tha

Re: [R] Examples of advanced data visualization

2008-11-29 Thread Hans W. Borchers
Tom Backer Johnsen psych.uib.no> writes: > [...] > The question is interesting, but what I have a somewhat negative > reaction to is the next passage: > > > > Please answer to my e-mail address. In case enough interesting material > > comes up, I will enter a summary here. > > It is nice that

Re: [R] Using grep() to subset lines of text

2008-11-29 Thread Gabor Grothendieck
Try this: > a <- 2:3 > b <- c("aaa 2 aaa", "2 aaa", "3 aaa", "aaa 3 aaa") > > re <- paste("^(", paste(a, collapse = "|"), ")", sep = "") > re [1] "^(2|3)" > grep(re, b, value = TRUE) [1] "2 aaa" "3 aaa" On Sat, Nov 29, 2008 at 7:00 AM, ppaarrkk <[EMAIL PROTECTED]> wrote: > > I have two vectors, a

[R] Using grep() to subset lines of text

2008-11-29 Thread ppaarrkk
I have two vectors, a and b. b is a text file. I want to find in b those elements of a which occur at the beginning of the line in b. I have the following code, but it only returns a value for the first value in a, but I want both. Any ideas please. a = c(2,3) b = NULL b[1] = "aaa 2 aaa" b[2] =

Re: [R] Examples of advanced data visualization

2008-11-29 Thread Johannes Huesing
Tom Backer Johnsen <[EMAIL PROTECTED]> [Fri, Nov 28, 2008 at 10:13:04PM CET]: > Hans W. Borchers wrote: [...] >> >> Please answer to my e-mail address. In case enough interesting material comes >> up, I will enter a summary here. > > It is nice that you are willing to summarize whatever appears, bu

Re: [R] Subset by family name?

2008-11-29 Thread Ophelia Wang
Sorry to bother everyone---I realized I should have used "==" instead of "=" in the subset syntax! Quoting Ophelia Wang <[EMAIL PROTECTED]>: Hi all, I thought this should be very simple, but I'm not sure where the problem is. I have a .txt data file that contains X and Y coordinates of tree

[R] Subset by string name?

2008-11-29 Thread Ophelia Wang
Hi all, I thought this should be very simple, but I'm not sure where the problem is. I have a .txt data file that contains X and Y coordinates of trees and their family names: "X" "Y" "Mark" 0 28 "Sapotaceae" 1 30 "Meliaceae" 1 40 "Meliaceae" 1 60

[R] Error in check(itp) : ‘object’ do es not represent a K sample problem with censored data

2008-11-29 Thread Bob Green
Hello, I have two questions regarding a survival analysis I have been working on. Below is the code to date. The variables: 1) recidivism$intDaysUntilFVPO are the number of days before an violent offence was committed - if no offence was committed than the days between court hearing and end