[R] PageUp/Down in gnome-terminal

2010-08-04 Thread Olga Lyashevska
Dear all, I am using gnome-terminal to run R, and I noticed that standard PageUp/Down do not work but they do work for other programs within the same terminal window (e.g. irssi). Scroll bar does not work either. I run R using GNU-screen, but it doesn't seem to make any difference. Many thanks O

Re: [R] questions about string handling

2010-08-04 Thread Michael Bedward
How about this ("df" is your input data.frame) data.frame(ID=df[,1], apply(df[,2:4], 2, function(x) c("00", "AA", "GG", "CC", "TT")[match(x, c("0/0", "1/1", "2/2", "3/3", "4/4"))])) Michael On 5 August 2010 10:55, karena wrote: > > Hi, I have a question about the data handling. I have a dataset

Re: [R] split / lapply over multiple columns

2010-08-04 Thread Peter Dalgaard
Ralf B wrote: > Besides beauty, is there an actual advantage in terms of run-time > and/or memory use? If you look at the actual definition of tapply, I'm sure you realize that the answer is no: ans <- lapply(split(X, group), FUN, ...) inbetween 40-odd lines of "red tape" is something of a g

Re: [R] questions about string handling

2010-08-04 Thread Peter Alspach
Tena koe Karena See ?sub and ?gsub HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of karena > Sent: Thursday, 5 August 2010 12:56 p.m. > To: r-help@r-project.org > Subject: [R] questions about string han

[R] a question about 'read.table' with or without 'read.table'.(urgent)

2010-08-04 Thread karena
Hi, I've got a quite tricky question. I have a txt file, named 'temp.txt', as the following: snp1snp2snp3 AA 00 00 GG GG 00 00 AA 00 I want to read the file into R. 1) when I use 'read.table' without 'header=T' option, >

Re: [R] error with ReadAffy()

2010-08-04 Thread mandova
I don't know if it has anything to do with these installation warnings: * installing to library ‘/home/mandova/R/i486-pc-linux-gnu-library/2.11’ * installing *source* package ‘affy’ ... creating cache ./config.cache checking how to run the C preprocessor... cc -E checking for main in -lz... yes c

[R] questions about string handling

2010-08-04 Thread karena
Hi, I have a question about the data handling. I have a dataset as following: ID snp1snp2 snp3 1001 0/0 1/11/1 1002 2/2 3/31/1 1003 4/4 3/32/2 I want to convert the dataset to the following for

Re: [R] a question about 'read.table' with or without 'read.table'.(urgent)

2010-08-04 Thread karena
Great! Thank you -- View this message in context: http://r.789695.n4.nabble.com/a-question-about-read-table-with-or-without-read-table-urgent-tp2314423p2314450.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org maili

[R] Finding the right url for RCurl

2010-08-04 Thread AndrewPage
Hi all, I am using RCurl to try and download data from a website, but I'm having trouble finding out what URL to use. Here is the site: http://www.invescopowershares.com/products/holdings.aspx?ticker=PGX See how in the upper right, above the displayed sheet, there's a link to download the data

Re: [R] a question about 'read.table' with or without 'read.table'.(urgent)

2010-08-04 Thread Wu Gong
read.table("temp.txt",header=T,colClasses = "character") - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/a-question-about-read-table-with-or-without-read-table-urgent-tp2314423p2314445.html Sent from the R help mailing list archive at Nabble.com. _

[R] Kolmogorov-Smirnov test, which one to use?

2010-08-04 Thread Roslina Zakaria
Hi, I have two sets of data, an observed data and generated data. The generated data is obtained from the model where the parameters is estimated from the observed data. So I'm not sure which to use either one-sample test ks.test(x+2, "pgamma", 3, 2) # two-sided, exact or two-sample test ks.

Re: [R] Output (graphics and table/text)

2010-08-04 Thread Tal Galili
Fun question. Here is one solution that has come to mind: # graphics output test a <- c(1,3,2,1,4) b <- c(2,1,1,1,2) c <- c(4,7,2,4,5) d <- rnorm(500) e <- rnorm(600) op <- par(mfrow=c(2,2)) pie(a) pie(b) pie(c) txt <- capture.output(ks.test(d,e)) txt <- txt[txt != ""] txt <- paste(txt, collapse

Re: [R] KS Test question (2)

2010-08-04 Thread Glen Barnett
It looks like the test is indicating a far bigger difference than could be explained by random variation. Since the sample sizes are equal, have you considered plotting the ordered values of one against the ordered values of the other (essentially an empirical QQplot), with a 45 degree line drawn

Re: [R] Date conversion

2010-08-04 Thread Gabor Grothendieck
On Wed, Aug 4, 2010 at 8:33 PM, Steven Kang wrote: > Hi all, > > I am trying to convert all the dates (all days that are not Friday) in data > frame into dates to next Friday. > > The following works but the result is returned as vector rather than the > original class. > > It would be greatly app

[R] Date conversion

2010-08-04 Thread Steven Kang
Hi all, I am trying to convert all the dates (all days that are not Friday) in data frame into dates to next Friday. The following works but the result is returned as vector rather than the original class. It would be greatly apprecited if you could provide any solution to this problem. Many th

Re: [R] ticks label of plot

2010-08-04 Thread Wu Gong
You have almost achieved your goal. plot(1:100, axes=F) axis(1,at=seq(0,100,10)[c(1,3,5,7,11)]) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/ticks-label-of-plot-tp2314226p2314294.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Spliting a text

2010-08-04 Thread Michael Hannon
- Original Message > From: Megh Dal > To: r-h...@stat.math.ethz.ch > Sent: Wed, August 4, 2010 4:04:06 AM > Subject: [R] Spliting a text > > Hi, I want to split a text to seperate numerical and non-numerical portions > of >that. For example suppose I have a text "abc 3456" and I w

Re: [R] KS Test question (2)

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 5:49 PM, Ralf B wrote: Hi R Users, I have two vectors, x and y, of equal length representing two types of data from two studies. I would like to test if they are similar enough to use them interchangeably. No assumptions about distributions can be made (initial tests clearly

Re: [R] regression analysis with interactions

2010-08-04 Thread John Sorkin
Jennifer, Please provide us more information. It would be helpful to see the actual code you ran along with the actual output. How did you get the values that your included with your email message? Did you get the values using the summary function, e.g. > fit0<-lm(y~x+sex+x*sex) > summary(fit0) C

Re: [R] Passing the name of a variable to a function

2010-08-04 Thread Douglas Bates
On Wed, Aug 4, 2010 at 2:09 PM, Erik Iverson wrote: > Hello, > > >> I have a problem which has bitten me occasionally. I often need to >> prepare graphs for many variables in a data set, but seldom for all. >> or for any large number of sequential or sequentially named variables. >> Often I need s

Re: [R] split / lapply over multiple columns

2010-08-04 Thread Ralf B
Besides beauty, is there an actual advantage in terms of run-time and/or memory use? Ralf On Wed, Aug 4, 2010 at 3:44 PM, Bert Gunter wrote: > It's not that it's "bad" -- it's just unnecessarily clumsy. ALmost > always, tapply/by will do the same thing more simply. > > -- Bert > > On Wed, Aug 4,

[R] ticks label of plot

2010-08-04 Thread yan liu
Hello, I had a question about how to label a axis of a plot. for example, my plot is >plot(1:100, axes=F) >box() >axis(1) then, I want my y-axis has six ticks ( at=seq(0,100,10)) , but I don't want to label all the 11 ticks, I only want to label the 1st, 3rd, 5th, 7th and 11th ticks. But the co

[R] Output (graphics and table/text)

2010-08-04 Thread Ralf B
Hi R Users, I need to produce a simple report consisting of some graphs and a statistic. Here simplification of it: # graphics output test a <- c(1,3,2,1,4) b <- c(2,1,1,1,2) c <- c(4,7,2,4,5) d <- rnorm(500) e <- rnorm(600) op <- par(mfrow=c(3,2)) pie(a) pie(b) pie(c) text(ks.test(d,e)) obvious

Re: [R] French accents on characters

2010-08-04 Thread Steven McKinney
In addition to the reply from Duncan Murdoch, help("text") and demo("Hershey") are very informative in this regard. Simple example with plot for added text: plot(1,1) text(0.8, 0.8, "B\\`ad Fr\\'ench", vfont=c("serif", "plain")) title(main = "B\u{E0}d Fr\u{E9}nch") >From the help page for

[R] KS Test question (2)

2010-08-04 Thread Ralf B
Hi R Users, I have two vectors, x and y, of equal length representing two types of data from two studies. I would like to test if they are similar enough to use them interchangeably. No assumptions about distributions can be made (initial tests clearly show that they are not normal). Here some res

Re: [R] UNIX Server

2010-08-04 Thread Erik Iverson
What OS are you specifically referring to? Even the most basic web search surely would have turned up the R Installation and Administration Manual http://cran.r-project.org/doc/manuals/R-admin.html#Installing-R-under-Unix_002dalikes There may be pre-built packages available for your particula

[R] KS Test questions

2010-08-04 Thread Ralf B
1) When running ks.test, I am getting the following error after the test presents its result:: 'ks.test(x, y) : cannot compute correct p-values with ties' I wonder what means and what causes it. 2) Also, how do I calculate an effect size from this statistic? R.

[R] UNIX Server

2010-08-04 Thread nero
Hello, how can i install R on a Unix server? best regards, Nero -- View this message in context: http://r.789695.n4.nabble.com/UNIX-Server-tp2314121p2314121.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

Re: [R] Passing the name of a variable to a function

2010-08-04 Thread Anthony Staines
Thanks to Joshua and Erik for very helpful suggestions. This clarifies what I had found to be a tricky area of the documentation! Best wishes, Anthony Staines -- Anthony Staines,  Professor of Health Systems Research, School  of Nursing, Dublin City University, Dublin 9, Ireland. Tel:- +353 1 700

Re: [R] Passing the name of a variable to a function

2010-08-04 Thread Liviu Andronic
Dear Anthony On Wed, 4 Aug 2010 14:56:58 +0100 Anthony Staines wrote: > What I would like to do is something like "write a function which > takes the *name* of a variable, presumably a s a character string, > from a dataframe, as one argument, and the dataframe, as a second > argument". > I am

Re: [R] regression analysis with interactions

2010-08-04 Thread Erik Iverson
Jennifer Hou wrote: Hello, I have got a linear model that looks like this: lm(criterion ~ variable.A*variable.a + variable.B*variable.b + variable.C *variable.c) The output computed with stdCoeff() seems to be all right, but it does not show the coefficients of the interaction of the first

[R] regression analysis with interactions

2010-08-04 Thread Jennifer Hou
Hello, I have got a linear model that looks like this: lm(criterion ~ variable.A*variable.a + variable.B*variable.b + variable.C *variable.c) The output computed with stdCoeff() seems to be all right, but it does not show the coefficients of the interaction of the first pair of variables. Inst

Re: [R] Modelling poisson distribution with variance structure

2010-08-04 Thread Ben Bolker
Karen Moore tcd.ie> writes: > > I'm dealing with count data that's nested and has spatial dependence. > I ran a glmm in lmer with a random factor for nestedness. Spatial dependence > seems to have been accommodated by model. However I can't add a variance > strcuture to this model (to accommodat

Re: [R] aggregate with non-scalar functions

2010-08-04 Thread Wu Gong
You can't find a way to get the 3 column result by setting the aggregate function. data.frame(res[1], res[[2]],check.names = F) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/aggregate-with-non-scalar-functions-tp2313987p2314063.html Sent from the R help mai

Re: [R] French accents on characters

2010-08-04 Thread Duncan Murdoch
On 04/08/2010 3:40 PM, Jennifer Young wrote: Hello Could someone please direct me to the correct commands for adding accents (grave and aigu) to a letter in a plot title, label, or in added text? I'm sure there's a handy list somewhere, but I've failed in coming up with the correct search words

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Gabor Grothendieck
On Wed, Aug 4, 2010 at 3:40 PM, Dimitri Liakhovitski wrote: > Thanks a lot, David. > It works perfectly. Of course, lapply is also a loop! > > So, your method is: > z<-data.frame(nam1=c("bbb..aba","ccc..abb","ddd..abc","eee..abd"),stringsAsFactors=FALSE) > z$nam2<-unlist(lapply( strsplit(z[[1]],sp

Re: [R] applying strsplit to a whole column

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 3:40 PM, Dimitri Liakhovitski wrote: Thanks a lot, David. It works perfectly. Of course, lapply is also a loop! So, your method is: z<- data .frame (nam1 = c("bbb..aba","ccc..abb","ddd..abc","eee..abd"),stringsAsFactors=FALSE) z$nam2<-unlist(lapply( strsplit(z[[1]],spl

Re: [R] printing html help to the terminal

2010-08-04 Thread Duncan Murdoch
On 04/08/2010 2:40 PM, Michael Lachmann wrote: I just tried it under OSX and linux, and both get stuck. Maybe R on windows forks the R help server? It doesn't fork, but it might run in another thread. But what you suggested works perfectly. Thanks! Do you by chance know if there was somet

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Dimitri Liakhovitski
Thanks a lot, David. It works perfectly. Of course, lapply is also a loop! So, your method is: z<-data.frame(nam1=c("bbb..aba","ccc..abb","ddd..abc","eee..abd"),stringsAsFactors=FALSE) z$nam2<-unlist(lapply( strsplit(z[[1]],split="\\.."), "[", 1)) z$nam3<-unlist(lapply( strsplit(z[[1]],split="\\..

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Joshua Wiley
On Wed, Aug 4, 2010 at 12:03 PM, Dimitri Liakhovitski wrote: > I am sorry, someone said that strsplit automatically works on a > column. How exactly does it work? I was not suggesting it was the ideal choice in this case, merely that a loop was not required. I tend to use strsplit() more for doi

[R] French accents on characters

2010-08-04 Thread Jennifer Young
Hello Could someone please direct me to the correct commands for adding accents (grave and aigu) to a letter in a plot title, label, or in added text? I'm sure there's a handy list somewhere, but I've failed in coming up with the correct search words to find it. Thank you muchly! Jen ___

Re: [R] applying strsplit to a whole column

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 3:31 PM, David Winsemius wrote: On Aug 4, 2010, at 3:03 PM, Dimitri Liakhovitski wrote: I am sorry, someone said that strsplit automatically works on a column. How exactly does it work? For example, if I want to grab just the first (or the second) part of the string in nam

Re: [R] applying strsplit to a whole column

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 3:03 PM, Dimitri Liakhovitski wrote: I am sorry, someone said that strsplit automatically works on a column. How exactly does it work? For example, if I want to grab just the first (or the second) part of the string in nam1 that should be split based on ".." x<-data.frame(nam

Re: [R] Passing the name of a variable to a function

2010-08-04 Thread Joshua Wiley
Hi Anthony, I don't know if this will help you. A similar method should work for any function that accepts a formula, which is your main issue I think. Outside of formulae, you should just be able to pass the arguments directly (as with the data argument of xyplot). The only other thought that

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Tal Galili
In such cases (which I don't think must happen), consider using ?lapply and also ?unlist Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebre

Re: [R] Passing the name of a variable to a function

2010-08-04 Thread Erik Iverson
Hello, I have a problem which has bitten me occasionally. I often need to prepare graphs for many variables in a data set, but seldom for all. or for any large number of sequential or sequentially named variables. Often I need several graphs for different subsets of the dataset for a given vari

[R] more questions on gam/gamm(mgcv)...

2010-08-04 Thread Xia Li
Hi R-users, I'm using R 2.11.1, mgcv 1.6-2 to fit a generalized additive mixed model. I'm new to this package...and just got more and more problems... 1. Can I include correlation and/or random effect into gam( ) also? or only gamm( ) could be used? 2. I want to estimate the smoothing function s

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Dimitri Liakhovitski
I am sorry, someone said that strsplit automatically works on a column. How exactly does it work? For example, if I want to grab just the first (or the second) part of the string in nam1 that should be split based on ".." x<-data.frame(nam1=c("bbb..aba","ccc..abb","ddd..abc","eee..abd"), stringsAsF

[R] aggregate with non-scalar functions

2010-08-04 Thread carslaw
Hi R-users, Since R.2.11 aggregate can now deal with non-scalar functions, which is very useful to me. However, I have a question about how best to process the output. test <- data.frame(a = rep(c("g1", "g2"), each = 50), b = runif(100)) res <- aggregate(test$b, list(group = test$a), function(

[R] wavlet transform

2010-08-04 Thread buburumka
Hello I do wavelet transform by using this code: dec=dwt(ld, filter='d8', n.levels=lev, boundary="reflaction"); dec consists of the decomposition coefficients and other How can I change the coefficients the decomposition manualy? -- View this message in context: http://r.789695.n4.nabble.com/

[R] how to values of the object in R-lang.

2010-08-04 Thread buburumka
Hello dec=dwt(ld, filter='d8', n.levels=lev, boundary="reflaction"); dwt is an function which returns W, V, filter dec is an object which consist of W, V, filter and others How to change values (of W, V, filter...) when i have dec thank you! -- View this message in context: http://r.789695

[R] error with ReadAffy()

2010-08-04 Thread mandova
Hi!I'm doing a little data importing from .cel files, > setwd("/home/mandova/celfiles") > mydata<-ReadAffy() Error in sub("^/?([^/]*/)*", "", filenames, extended = TRUE) : unused argument(s) (extended = TRUE) Then I tried > filenames<-paste("GSM",c(seq(138597,138617,1)),".cel",sep="") > f

[R] Passing the name of a variable to a function

2010-08-04 Thread Anthony Staines
Dear colleagues, I have a problem which has bitten me occasionally. I often need to prepare graphs for many variables in a data set, but seldom for all. or for any large number of sequential or sequentially named variables. Often I need several graphs for different subsets of the dataset for a giv

Re: [R] How to create ff objects from database connection

2010-08-04 Thread Xiaobo Gu
Hi, I am sorry for that I can’t determine which R-sig list to post questions about package ff. Now I have made a little progress with this: read.dbres.ffdf <- function( res){ data1 <- fetch(res, 0) if (nrow(data1) == 0){

[R] aggregate with non-scalar functions

2010-08-04 Thread David Carslaw
Hi R-users, Since R.2.11 aggregate can now deal with non-scalar functions, which is very useful to me. However, I have a question about how best to process the output. test <- data.frame(a = rep(c("g1", "g2"), each = 50), b = runif(100)) res <- aggregate(test$b, list(group = test$a), function(

Re: [R] printing html help to the terminal

2010-08-04 Thread Michael Lachmann
I just tried it under OSX and linux, and both get stuck. Maybe R on windows forks the R help server? But what you suggested works perfectly. Thanks! Do you by chance know if there was something equivalent in R 2.10.x and/or 2.9.x Duncan Murdoch-2 wrote: > > On 04/08/2010 12:44 PM, Michael Lac

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Dimitri Liakhovitski
Thank you very much, everyone! Dimitri On Wed, Aug 4, 2010 at 2:10 PM, David Winsemius wrote: > > On Aug 4, 2010, at 1:42 PM, Dimitri Liakhovitski wrote: > >> I am sorry, I'd like to split my column ("names") such that all the >> beginning of a string ("X..") is gone and only the rest of the text

Re: [R] applying strsplit to a whole column

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 1:42 PM, Dimitri Liakhovitski wrote: I am sorry, I'd like to split my column ("names") such that all the beginning of a string ("X..") is gone and only the rest of the text is left. I could not tell whether it was the string "X.." or the pattern "X.." that was your goal f

Re: [R] printing html help to the terminal

2010-08-04 Thread Duncan Murdoch
On 04/08/2010 12:44 PM, Michael Lachmann wrote: I'm trying to get help to print the help pages in html format to the terminal. This is in order to be able to see the html help files remotely. If I do printURL = function(file) {a=readLines(url(file));cat(a,sep="\n")} options(browser=printURL) opt

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Joshua Wiley
Hi, You already have great solutions. I just wanted to point out that A) strsplit() works on the entire column automatically so you would not need a loop B) with the argument stringsAsFactors = FALSE, your character data will not be converted to factor, so you would not need to convert it back.

Re: [R] does R have a command the same with Stata's loop command: ` '

2010-08-04 Thread Gabor Grothendieck
On Wed, Aug 4, 2010 at 1:35 PM, Gabor Grothendieck wrote: > On Wed, Aug 4, 2010 at 1:28 PM, Greg Snow wrote: >> Do ?'for' to learn about for loops. > > and put that in quotes since its a reserved word: > > ?"for" > Sorry, I missed the fact that Greg actually did put single quotes around for. On

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Henrique Dallazuanna
Try this: gsub("X\\.\\.", "", x$names) On Wed, Aug 4, 2010 at 2:42 PM, Dimitri Liakhovitski < dimitri.liakhovit...@gmail.com> wrote: > I am sorry, I'd like to split my column ("names") such that all the > beginning of a string ("X..") is gone and only the rest of the text is > left. > > x<-data

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Tal Galili
Have a look at the stringr package It simplifies such things... Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Erik Iverson
Dimitri Liakhovitski wrote: I am sorry, I'd like to split my column ("names") such that all the beginning of a string ("X..") is gone and only the rest of the text is left. x<-data.frame(names=c("X..aba","X..abb","X..abc","X..abd")) x$names<-as.character(x$names) (x) str(x) Can't figure out h

[R] applying strsplit to a whole column

2010-08-04 Thread Dimitri Liakhovitski
I am sorry, I'd like to split my column ("names") such that all the beginning of a string ("X..") is gone and only the rest of the text is left. x<-data.frame(names=c("X..aba","X..abb","X..abc","X..abd")) x$names<-as.character(x$names) (x) str(x) Can't figure out how to apply strsplit in this sit

Re: [R] by group testing

2010-08-04 Thread Joshua Wiley
On Wed, Aug 4, 2010 at 10:17 AM, Joshua Wiley wrote: > Hello, > > This will put the results of the Fisher test in a list, with each > element of the list being the results for mouse type a, b, c, and d. > > mice <- rep(letters[1:4],10) > outcome <- sample(c(0,1),length(mice),replace=T) > group <-

Re: [R] does R have a command the same with Stata's loop command: ` '

2010-08-04 Thread Gabor Grothendieck
On Wed, Aug 4, 2010 at 1:28 PM, Greg Snow wrote: > Do ?'for' to learn about for loops. and put that in quotes since its a reserved word: ?"for" __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the postin

Re: [R] does R have a command the same with Stata's loop command: ` '

2010-08-04 Thread Greg Snow
Do ?'for' to learn about for loops. Look at FAQ 7.21 for the other part of the question (the most important part of the answer is the end where it tells you to use lists instead like Patrick suggests). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@i

[R] Question regarding significance of a covariate in a coxme survival model

2010-08-04 Thread Christopher David Desjardins
Hi, I am running a Cox Mixed Effects Hazard model using the library coxme. I am trying to model time to onset (age_sym1) of thought problems (e.g. hearing voices) (sym1). As I have siblings in my dataset, I have decided to account for this by including a random effect for family (famid). My

Re: [R] by group testing

2010-08-04 Thread Joshua Wiley
Hello, This will put the results of the Fisher test in a list, with each element of the list being the results for mouse type a, b, c, and d. mice <- rep(letters[1:4],10) outcome <- sample(c(0,1),length(mice),replace=T) group <- c(rep("A",length(mice)/2),rep("B",length(mice)/2)) my.data <- data.

Re: [R] split / lapply over multiple columns

2010-08-04 Thread Ralf B
> In general, the lapply(split(...)) construction should never be used. Why? What makes it so bad to use? __ 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

Re: [R] question!!!!

2010-08-04 Thread Greg Snow
?scale -- 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.org [mailto:r-help-boun...@r- > project.org] On Behalf Of leepama > Sent: Tuesday, August 03, 2010 10:55 PM > To

[R] printing html help to the terminal

2010-08-04 Thread Michael Lachmann
I'm trying to get help to print the help pages in html format to the terminal. This is in order to be able to see the html help files remotely. If I do printURL = function(file) {a=readLines(url(file));cat(a,sep="\n")} options(browser=printURL) options(help_type="html") then invoking help with ?

Re: [R] converting monthly to weekly without changing the original values

2010-08-04 Thread Dimitri Liakhovitski
Sorry, I found the solution: library(zoo) z <- read.zoo(monthly, split = "market") all.dates <- seq(start(z), as.Date(as.yearmon(end(z)), frac = 1), by = "day") ## mondays <- all.dates[weekdays(all.dates) == "Monday"] ## weeks <- na.locf(z, xout = mondays, na.rm = FALSE, maxgap=0) do.call(rbind, b

[R] converting monthly to weekly without changing the original values

2010-08-04 Thread Dimitri Liakhovitski
Hello! I have a code for converting monthly values into weekly values: monthly<-data.frame(month=c(20100301,20100401,20100501,20100601,20100301,20100401,20100501,20100601),monthly.value=c(100,NA,200,300,10,NA,20,30),market=c("Market A","Market A","Market A","Market A","Market B","Market B","Market

Re: [R] split / lapply over multiple columns

2010-08-04 Thread Bert Gunter
In general, the lapply(split(...)) construction should never be used. Use tapply() or by() instead, along the lines of by(dataframe,with(yourdata,list(your columns)), function(...),...) If you find this complexity annoying, then look into Hadley Wickham's plyr package for simpler constructions, a

[R] by group testing

2010-08-04 Thread cheba meier
Hello, I have a data set which is similar to the following data mice <- rep(letters[1:4],10) outcome <- sample(c(0,1),length(mice),replace=T) group <- c(rep("A",length(mice)/2),rep("B",length(mice)/2)) my.data <- data.frame(mice,outcome,group) my.sort.data <- my.data[order(my.data[,1]),] I woul

Re: [R] discrete ECDF

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 11:06 AM, Charles C. Berry wrote: On Wed, 4 Aug 2010, David Winsemius wrote: Dear list; I just created a utility function that replicates what I have done in the past with Excel or OO.org by putting a formula of the form =sum($A1:A$1) in an upper-corner of a section an

Re: [R] how to change values of the object in R-lang.

2010-08-04 Thread Wu Gong
Hi, Try help("$"). dwt <- function(ld, filter='d8', n.levels=lev, boundary="reflaction") { list(W=ld, V=n.levels,filter=filter) } dec <- dwt(1:10, filter='d8', n.levels=10, boundary="reflaction") dec$W dec$V dec$filter dec$W <- sqrt(1:10) dec - A R learner. -- View this messa

[R] Maximum seasonal 'q' parameter

2010-08-04 Thread Shubha Vishwanath Karanth
Hi R, Seems like the maximum seasonal 'q' parameter for the ?arima is 350. Any way, where we can increase this? Since I am working on 3 year (q=252*3) and 5 year(q=252*5) returns, I may require this option. Thanks. > fit=arima(r,c(3,0,0),seasonal = list(order = c(0, 0, 500), period = NA));

Re: [R] discrete ECDF

2010-08-04 Thread Wu Gong
Just a little difference. ecdf.tbl <- function (.dat) { .dat <- as.matrix(.dat) na.m <- is.na(.dat) .dat[na.m]<-0 # Assign NA a value 0 res <- apply(t(apply(.dat,1,cumsum)),2,cumsum) res[na.m] <- NA # Assign NA back return(res) } -

[R] RWeka problem: java.lang.NoSuchMethodError

2010-08-04 Thread Yonghee Shin
Hi, I'm trying to use RWeka and followed the following example from the RWeka manual. ## Use some example data. w <- read.arff(system.file("arff","weather.nominal.arff", package = "RWeka")) ## Identify a decision tree. m <- J48(play~., data = w) m ## Use 10 fold cross-validation.

Re: [R] discrete ECDF

2010-08-04 Thread Charles C. Berry
On Wed, 4 Aug 2010, David Winsemius wrote: Dear list; I just created a utility function that replicates what I have done in the past with Excel or OO.org by putting a formula of the form =sum($A1:A$1) in an upper-corner of a section and then doing a "fill" procedure by dragging the lower-rt

Re: [R] grid.table and expression in table body?

2010-08-04 Thread Johannes Graumann
Great! I will give it a try ASAP! Thanks! Joh On Wednesday 04 August 2010 16:47:12 baptiste Auguié wrote: > I added a parse argument to grid.table so that when switched to TRUE > (default FALSE) all the text strings are interpreted as expressions > (inspired by ggplot2::geom_text), > > d <- dat

Re: [R] argument is of length 0 & condition has length>1

2010-08-04 Thread Joshua Wiley
Hi Leigh, Several aspects of your email make it challenging to offer advice. We are missing part of your data (e.g., 'T' in 1:T), and it is not terribly clear what 't' in (t-5) to t(19950630) to (t+7) is supposed to mean (thought I would hazard the guess time, and that it is represented by your '

Re: [R] grid.table and expression in table body?

2010-08-04 Thread baptiste Auguié
I added a parse argument to grid.table so that when switched to TRUE (default FALSE) all the text strings are interpreted as expressions (inspired by ggplot2::geom_text), d <- data.frame("alpha", "beta") grid.table(d, parse=T) you'll need revision 258 of gridExtra for this to work (googlecode n

[R] discrete ECDF

2010-08-04 Thread David Winsemius
Dear list; I just created a utility function that replicates what I have done in the past with Excel or OO.org by putting a formula of the form =sum($A1:A$1) in an upper-corner of a section and then doing a "fill" procedure by dragging the lower-rt corner down and to the right. When divid

Re: [R] metafor and meta-analysis at arm-level

2010-08-04 Thread Angelo Franchini
Hello Wolfgang. I'd appreciate if you could help me check whether I am doing the proper thing to do an arm-level meta-analysis with metafor and what differences there might be in trying to do the same with lme and lm. I am following the arm based model described in section 3.2 of the Salanti's pa

Re: [R] retrieve name of an object?

2010-08-04 Thread Liviu Andronic
Dear Duncan On Wed, 04 Aug 2010 08:33:49 -0400 Duncan Murdoch wrote: > As other have pointed out, in a function you can use substitute(arg) > to retrieve the expression passed as arg, and > deparse(substitute(arg)) to turn it into a string that's suitable for > using as a label. But that's not t

Re: [R] Finding points where two timeseries cross over

2010-08-04 Thread Matthew Dowle
Is this what you mean? x=c(1,2,2,3,4,5,6,3,2,1) y=c(2,3,4,2,1,2,3,4,5,6) matplot(cbind(x,y),type="l") which(diff(sign(x-y))!=0)+1 [1] 4 8 -- View this message in context: http://r.789695.n4.nabble.com/Finding-points-where-two-timeseries-cross-over-tp2313257p2313510.html Sent from the R help ma

Re: [R] argument is of length 0 & condition has length>1

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 9:46 AM, Leigh E. Lommen wrote: I have the following array: head(stocks) DATE TICKER PERMNO EXCHCD TSYMBOL TRDSTAT SHROUTPRC RET 1 19950131 EWST 10001 3EWST A 2224 -7.75000 -0.031250 2 19950228 EWST 10001 3EWST A

Re: [R] ggplot2 barplot: extra markers in graph

2010-08-04 Thread Dieter Vanderelst
Thanks, this indeed solved the problem. Regards, Dieter On 4/08/2010 15:21, Shentu wrote: > > The reason you see the exra markers is that the first part of the command > "qplot(DT$N,DT$D,fill=factor(DT$C))" already plots the individual points. > You didn't see it with "geom_bar(stat = "identity"

[R] argument is of length 0 & condition has length>1

2010-08-04 Thread Leigh E. Lommen
I have the following array: > head(stocks) DATE TICKER PERMNO EXCHCD TSYMBOL TRDSTAT SHROUTPRC RET 1 19950131 EWST 10001 3EWST A 2224 -7.75000 -0.031250 2 19950228 EWST 10001 3EWST A 2224 7.54688 -0.026210 3 19950331 EWST 10001 3

Re: [R] multiple R sessions from one working directory using GNU screen

2010-08-04 Thread Olga Lyashevska
Thanks David, I looked briefly through the bigmemory package and it looks very promising. As I mentioned in my previous post to Steven I am calculating distance matrices, and if it is my bottleneck (I am nearly sure it is) I believe that the bigmemory will be particularly useful as it is designed

Re: [R] help with using grid.polygon()

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 9:32 AM, Ally wrote: Hi, I'm trying to use grid.polygon() to plot several polygons at once, with a view to putting coloured polygons beneath a curve. I'm struggling just to get the grid.polygon to plot anything # PLOT SOME POINTS x <- 1:100 y <- 1:100

Re: [R] Collinearity in Moderated Multiple Regression

2010-08-04 Thread Liaw, Andy
Seems to me it may be worth stating what may be elementary to some on this list: - If all relevant variables are included in the model and the "true model" is indeed linear, then all least squares estimated coefficients are unbiased. [ David Ruppert once said about the three kinds of lies: Lie

[R] help with using grid.polygon()

2010-08-04 Thread Ally
Hi, I'm trying to use grid.polygon() to plot several polygons at once, with a view to putting coloured polygons beneath a curve. I'm struggling just to get the grid.polygon to plot anything # PLOT SOME POINTS x <- 1:100 y <- 1:100*0.5 + 3 plot(x, y, pch = ".") # PLOT 2

Re: [R] ggplot2 barplot: extra markers in graph

2010-08-04 Thread Shentu
The reason you see the exra markers is that the first part of the command "qplot(DT$N,DT$D,fill=factor(DT$C))" already plots the individual points. You didn't see it with "geom_bar(stat = "identity")" simply because the stacked bars made the previous layer invisible. To see this you can use the gg

Re: [R] Collinearity in Moderated Multiple Regression

2010-08-04 Thread Michael Friendly
haenl...@gmail.com wrote: I'm sorry -- I think I chose a bad example. Let me start over again: I want to estimate a moderated regression model of the following form: y = a*x1 + b*x2 + c*x1*x2 + e Based on my understanding, including an interaction term (x1*x2) into the regression in addition

Re: [R] Best way to Convert String to Time for comparison?

2010-08-04 Thread Nikhil Kaza
Another way is t1<- c("3:00","1:59","3:00","2:00") t2 <- strptime(t1, format="%H:%M") t2[-4]>t2[-1] Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Aug 4, 2010, at 8:47 AM, Gabor Grothendieck wrote: On Wed, Aug 4, 2010 at 8:43 A

  1   2   >