[R] Importing large data set from teradata

2010-04-07 Thread sumit gupta
Hi, I want to import data from teradata.Data set is very large in size , it has around 1 million rows and 40 columns. Could anyone tell me an efficient and fast way to import data sets with this size. Thanks. Sumit [[alternative HTML version deleted]]

[R] square root of inverse

2010-04-07 Thread arindam fadikar
Dear users, How to get a symmetric square root of a positive definite matrix? I have tried using spectral decomposition, but some eigen values come out to be complex. Is there any function in R that can give the symmetric square root of a pd matrix? -- Arindam Fadikar M.Stat Indian Statistical I

Re: [R] combn with factors

2010-04-07 Thread Greg Hirson
Peter, Thank you. I'll be sure to include a as.character. Greg On 4/7/10 11:40 AM, Peter Ehlers wrote: On 2010-04-07 11:40, Greg Hirson wrote: Dear list, I have come across this issue: combn(letters[1:5], 3) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] "a" "a" "a" "a" "a" "a" "

Re: [R] Error Bars in lattice- barcharts

2010-04-07 Thread Felix Andrews
On 20 February 2010 11:22, Sam Albers wrote: > #I've tried to alter the panel function according to the thread to produce > vertical error bars in my barcharts > > prepanel.ci <- function(x, y, ly, uy, subscripts, ...) { > >        y <- as.numeric(y) >        ly <- as.numeric(ly[subscripts]) >  

Re: [R] finding weekly average...

2010-04-07 Thread Xin Ge
Thanks Dennis and Daniel for your reply! On Wed, Apr 7, 2010 at 12:24 PM, Daniel Malter wrote: > > Assume you have suitable "week" indicator and your data is stored in a > data.frame named "data." Then you get the weekly averages by > > #simulate data > week <- rep(1:52,each=7) > x <- week+rnorm

Re: [R] Error Bars in lattice- barcharts

2010-04-07 Thread Felix Andrews
On 8 April 2010 06:03, Ivan Gregoretti wrote: > Hi Sam and everybody, > > Can you educate me a little bit on the use of barchart? > > A command like this > > barchart(~table(someProperty), data=A) > > produces a barchart with horizontal bars. That should be barchart(table(someProperty), data=A)

[R] Error in leaps.setup

2010-04-07 Thread thedoctor81877
Hullo, I am trying to use the leaps package, & keep getting the following error: Error in leaps.setup(x, y, wt = wt, nbest = nbest, nvmax = NCOL(x) + int, : y and x different lengths My data set is attached below. I am rather new to R, & would appreciate any help that could be given. Thanks

Re: [R] match function or "=="

2010-04-07 Thread bo
Thank you very much for the help. I installed data.table package, but I keep getting the following warnings: > setkey(DT,id,date) Warning messages: 1: In `[.data.table`(deref(x), o) : This R session is < 2.4.0. Please upgrade to 2.4.0+. I'm using R 2.10, but why I keep getting warnings on upgr

Re: [R] Multiple comparisons for a two-factor ANCOVA

2010-04-07 Thread Eric Scott
Thank you for your reply. The WoodEnergy example helped a lot. I understand now that it is inappropriate to make all pairwise comparisons with an interaction present and better to make comparisons between levels of one factor within a constant level of the second factor. As I understand it, the s

Re: [R] How to locate the difference from two data frames

2010-04-07 Thread Charles C. Berry
On Wed, 7 Apr 2010, Jun Shen wrote: Dear all, I understand identical (a,b) will tell me if a and b are exactly the same or not. But what if they are different, is there anyway to tell which element(s) are different? Thanks. which( a != b, arr.ind = TRUE) HTH, Chuck Jun [[alternat

Re: [R] Error Bars in lattice- barcharts

2010-04-07 Thread Sam Albers
Hi Ivan, Can you educate me a little bit on the use of barchart? > Unfortunately no... For this post I eventually used the barplot2() in the gplots packages. I got bogged down trying to do it in lattice so I looked for an alternative. It was quite straight forward which was nice and I was able to

Re: [R] How to locate the difference from two data frames

2010-04-07 Thread David Winsemius
On Apr 7, 2010, at 9:55 PM, Erik Iverson wrote: Jun Shen wrote: Hi, David, Thanks for the reply. However str() doesn't tell me exactly which element is different. I expect to see a is identical to b. But if there is some minor difference (usually by human mistake), I want to know which el

[R] selected observations based several variables

2010-04-07 Thread rusers.sh
Hi, My problem maybe a little bit complicated, so forgive me if the following words are too much. #date set a0<-matrix(c(1.1,1.3,1.1,1.3,1.3, 2.0,1.8,2.0,1.8,1.8, "12/01/2008","05/20/2007","12/06/2008","05/10/2007","05/06/2007", "N","N","A","C","A", 1,2,3,4,5),ncol=5,byrow=FALSE) a0<-data.frame(

Re: [R] How to locate the difference from two data frames

2010-04-07 Thread Erik Iverson
Jun Shen wrote: Hi, David, Thanks for the reply. However str() doesn't tell me exactly which element is different. I expect to see a is identical to b. But if there is some minor difference (usually by human mistake), I want to know which element (numerical or character) is different. So you'

Re: [R] How to locate the difference from two data frames

2010-04-07 Thread Jun Shen
Hi, David, Thanks for the reply. However str() doesn't tell me exactly which element is different. I expect to see a is identical to b. But if there is some minor difference (usually by human mistake), I want to know which element (numerical or character) is different. Jun On Wed, Apr 7, 2010 at

Re: [R] How to locate the difference from two data frames

2010-04-07 Thread David Winsemius
On Apr 7, 2010, at 9:31 PM, Jun Shen wrote: Dear all, I understand identical (a,b) will tell me if a and b are exactly the same or not. But what if they are different, is there anyway to tell which element(s) are different? Thanks. You could try: str(a); str(b) David Winsemius, MD Wes

Re: [R] how can I stop getting email from every comment posted in this forum?

2010-04-07 Thread David Winsemius
See the bottom of the R-help page: https://stat.ethz.ch/mailman/listinfo/r-help You can unsubscribe or change your mode to digest. (Just like any other mailing list.) -- David On Apr 7, 2010, at 8:15 PM, Philip Wong wrote: hello people, I didn't know where should post this thread, I aske

Re: [R] how can I stop getting email from every comment posted in this forum?

2010-04-07 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Philip Wong > Sent: Wednesday, April 07, 2010 5:15 PM > To: r-help@r-project.org > Subject: [R] how can I stop getting email from every comment posted in > this forum? > > > hell

[R] How to locate the difference from two data frames

2010-04-07 Thread Jun Shen
Dear all, I understand identical (a,b) will tell me if a and b are exactly the same or not. But what if they are different, is there anyway to tell which element(s) are different? Thanks. Jun [[alternative HTML version deleted]] __ R-help@r-pr

[R] Strange csv parsing problem

2010-04-07 Thread Hadley Wickham
> url <- "http://dl.dropbox.com/u/41902/22240.csv"; > > read.csv(url)[, 1] [1] "oppose" NA"oppose" "support" > read.csv(url, header = F)[, 1] [1] "url" [2] "http://maplight.org/us-congress/bill/109-hr-5825/387248"; [3] "http://maplight.org/us-congress/bill/110-hr-3546/378743"; [4] "http:/

Re: [R] 3-D response surface using wireframe()

2010-04-07 Thread David Winsemius
On Apr 7, 2010, at 8:58 PM, array chip wrote: With the help document, i finally find a set of values of for x=,y= and z= in "screen" argument that gives me the correct rotation of the plot. But now it plots x and y axis (tick marks and labels) along the top of the plot. Is there one way to

[R] Using read.table to read file created with read.table and qmethod = "escape"

2010-04-07 Thread Hadley Wickham
df <- data.frame(a = "a\"b") write.table(df, "test.csv", sep = ",", row = F) Is there any to load test.csv into R correctly? I've tried the following: > read.table("test.csv", sep = ",") [1] V1 <0 rows> (or 0-length row.names) Warning message: In read.table("test.csv", sep = ",") : incomplete

Re: [R] 3-D response surface using wireframe()

2010-04-07 Thread array chip
With the help document, i finally find a set of values of for x=,y= and z= in "screen" argument that gives me the correct rotation of the plot. But now it plots x and y axis (tick marks and labels) along the top of the plot. Is there one way to plot x and y axis on the bottom of the plot? Thank

[R] how can I stop getting email from every comment posted in this forum?

2010-04-07 Thread Philip Wong
hello people, I didn't know where should post this thread, I asked Hugo the nabble administrator and his response was I should be able to unsubscribed from getting an email from every comment or response posted here. Yet I couldn't find the method nor the button to click to do so. I even change

Re: [R] Vectorized forms of isTRUE, identical and all.equal?

2010-04-07 Thread Robin Evans
On 7 April 2010 16:27, Steve Lianoglou wrote: > On Wed, Apr 7, 2010 at 7:16 PM, Robin Evans wrote: >> On 7 April 2010 16:12, Steve Lianoglou >> wrote: >>> Hi, >>> >>> On Wed, Apr 7, 2010 at 5:44 PM, Robin Evans >>> wrote: Dear all, I'm wondering if there exist vectorized forms

Re: [R] Use a variable of a list in a loop

2010-04-07 Thread rusers.sh
Cool. Using [[var]] instead of $var to extract the expected variable is really what i want. Thanks. Guys. 2010/4/7 Steve Lianoglou > Hi, > > On Wed, Apr 7, 2010 at 6:27 PM, rusers.sh wrote: > > Hi all, > > My problem may be related with the list manipulations. See below. > > #example data > >

Re: [R] Palette color order in bwplot (lattice violin plot) vs. boxplot

2010-04-07 Thread Felix Andrews
On 8 April 2010 03:34, Luigi Ponti wrote: > Thanks for the hint, Felix: the following code makes it but (don't know why) > the median dots disappear. > > bwplot(count ~ spray, data = InsectSprays, >    groups = spray, >    panel = panel.superpose, >    panel.groups =  function(..., bo

Re: [R] extracting ctree() output information

2010-04-07 Thread Steven J. Clark
Thank you for the pointer to: help("BinaryTree-class"). It probably isn't the prettiest solution, but I was able to extract what I needed by doing something like the following: nodes = where(fit) freq = treeresponse(fit) for(i in 1:100) { if(nodes[i]==4

Re: [R] Vectorized forms of isTRUE, identical and all.equal?

2010-04-07 Thread Steve Lianoglou
On Wed, Apr 7, 2010 at 7:16 PM, Robin Evans wrote: > On 7 April 2010 16:12, Steve Lianoglou wrote: >> Hi, >> >> On Wed, Apr 7, 2010 at 5:44 PM, Robin Evans >> wrote: >>> Dear all, >>> >>> I'm wondering if there exist vectorized forms of 'isTRUE()', >>> 'identical()' and 'all.equal()'.  My probl

Re: [R] Vectorized forms of isTRUE, identical and all.equal?

2010-04-07 Thread Robin Evans
On 7 April 2010 16:12, Steve Lianoglou wrote: > Hi, > > On Wed, Apr 7, 2010 at 5:44 PM, Robin Evans wrote: >> Dear all, >> >> I'm wondering if there exist vectorized forms of 'isTRUE()', >> 'identical()' and 'all.equal()'.  My problem is that I wish to test if >> each element of a vector is equal

Re: [R] Vectorized forms of isTRUE, identical and all.equal?

2010-04-07 Thread Steve Lianoglou
Hi, On Wed, Apr 7, 2010 at 5:44 PM, Robin Evans wrote: > Dear all, > > I'm wondering if there exist vectorized forms of 'isTRUE()', > 'identical()' and 'all.equal()'.  My problem is that I wish to test if > each element of a vector is equal to a particular value (or > numerically close), whilst d

Re: [R] Use a variable of a list in a loop

2010-04-07 Thread Steve Lianoglou
Hi, On Wed, Apr 7, 2010 at 6:27 PM, rusers.sh wrote: > Hi all, >  My problem may be related with the list manipulations. See below. > #example data >  a<-list() >  a[[1]]<-data.frame(matrix(c(1:4),ncol=2)); > a[[2]]<-data.frame(matrix(c(5:8),ncol=2)) >  I can use a[[1]]$X1,a[[1]]$X2,a[[2]]$X1,a[[

Re: [R] unexpected behaviour with ddply and colwise

2010-04-07 Thread Steve Lianoglou
Last point ... On Wed, Apr 7, 2010 at 6:39 PM, Stuart Andrews wrote: > > Ahhh, I see my error, thanks to Steve and others who mailed me off list. > > Perhaps reading a little too quickly, I mis-interpreted the help for ddply, > in particular, the second argument: > >>       ".variables: variables

[R] RWeka - Error when attempting to summary() model

2010-04-07 Thread D. Dashcle
I'm a big fan of both Weka and R (quite new at R :) ), and jumped at the chance to use them together. Unfortunately, I'm running into what is probably a dumb error when trying to view info about my model. A Google search turned up 0 hits for the actual error I got (last line), but you all are s

Re: [R] unexpected behaviour with ddply and colwise

2010-04-07 Thread Stuart Andrews
Ahhh, I see my error, thanks to Steve and others who mailed me off list. Perhaps reading a little too quickly, I mis-interpreted the help for ddply, in particular, the second argument: >".variables: variables to split data frame by, as quoted variables, a >formula or characte

[R] Use a variable of a list in a loop

2010-04-07 Thread rusers.sh
Hi all, My problem may be related with the list manipulations. See below. #example data a<-list() a[[1]]<-data.frame(matrix(c(1:4),ncol=2)); a[[2]]<-data.frame(matrix(c(5:8),ncol=2)) I can use a[[1]]$X1,a[[1]]$X2,a[[2]]$X1,a[[2]]$X2 to use the corresponding variables. But what i need to do is

Re: [R] unexpected behaviour with ddply and colwise

2010-04-07 Thread Steve Lianoglou
Howdy, I'm no plyr master, but here's my 2 cents ... On Wed, Apr 7, 2010 at 5:15 PM, Stuart Andrews wrote: > Hi, > > I am confused by results from: > >> ddply(aa, names(aa), colwise(sum)) > > I thought ddply was just calling colwise(sum)() with each column.   However > ddply() returns a 13 x 5 r

[R] Vectorized forms of isTRUE, identical and all.equal?

2010-04-07 Thread Robin Evans
Dear all, I'm wondering if there exist vectorized forms of 'isTRUE()', 'identical()' and 'all.equal()'. My problem is that I wish to test if each element of a vector is equal to a particular value (or numerically close), whilst dealing carefully with NAs and so on. However, using sapply() with id

[R] unexpected behaviour with ddply and colwise

2010-04-07 Thread Stuart Andrews
Hi, I am confused by results from: > ddply(aa, names(aa), colwise(sum)) I thought ddply was just calling colwise(sum)() with each column. However ddply() returns a 13 x 5 result !! The general result I expected is similar to that of apply() , or using colwise(sum)() alone. Shouldn

Re: [R] It This data viz possible in R?

2010-04-07 Thread baptiste auguie
The following grob might be a starting point. I couldn't find a clean way of orienting the linking arcs though... Best, baptiste library(grid) paragraph <- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent adipiscing lobortis placerat. Nunc vel arcu mauris. Aliquam erat volutpa

[R] s4 class documentation in R

2010-04-07 Thread Tengfei Yin
Hi All, I am currently trying to transform my package to s4 methods, I don't know if there is any package or easy way like Roxygen to document the S4 methods. I use emacs+ess+roxygen to document simple function and package before, I don't know if Roxygen support S4 method too. Any suggestions for

Re: [R] Exporting data to .xlsx file

2010-04-07 Thread Marc Schwartz
On Apr 7, 2010, at 3:50 PM, sumit gupta wrote: > I imported data from teradata to R data frames.Now i want to export this > data to .xlsx file ( not .xls since it doesn't support large data set). > > I have tried dataframes2xls package but it needs python/perl which I don't > have on my computer.

Re: [R] Code is too slow: mean-centering variables in a data framebysubgroup

2010-04-07 Thread Dimitri Liakhovitski
Thanks a lot, Tom. In fact, I am likely to have no NAs at all - only zeros! Dimitri On Wed, Apr 7, 2010 at 4:54 PM, Tom Short wrote: > Another way that Matthew Dowle showed me for this type of problem is > to reshape frame to a long format. It makes it easier to manipulate > and can be faster. >

Re: [R] extracting ctree() output information

2010-04-07 Thread Achim Zeileis
On Wed, 7 Apr 2010, Steven J. Clark wrote: Hi, I am new to R and am using the ctree() function to do customer segmentation. I am using the following code to generate the tree: treedata$Response<-factor(treedata$Conversion) fit<-ctree(Response ~ .,controls=ctree_control(mincriterion=0.99,maxde

Re: [R] Code is too slow: mean-centering variables in a data framebysubgroup

2010-04-07 Thread Tom Short
Another way that Matthew Dowle showed me for this type of problem is to reshape frame to a long format. It makes it easier to manipulate and can be faster. > longdt <- with(frame, data.table(group = unlist(rep(group, each=7)), x = > c(a,b,c,d,e,f,g))) > > system.time(new.frame4 <- longdt[, x/mean

Re: [R] help in attach function

2010-04-07 Thread Don MacQueen
You can also read the help page for the conflicts() function. And try a commend like find('acid') (or any of the objects listed as being masked) to find out where the two or more objects with the same name are located. Oh, and looking at ?search would be good also. -Don At 4:31 PM -0400 4/7

[R] Exporting data to .xlsx file

2010-04-07 Thread sumit gupta
I imported data from teradata to R data frames.Now i want to export this data to .xlsx file ( not .xls since it doesn't support large data set). I have tried dataframes2xls package but it needs python/perl which I don't have on my computer. Could any one help me resolve this issue. Thanks Sumit

[R] C++ source code for MANOVA

2010-04-07 Thread Jessy
Dear all, Can someone help me with a C++ source code that underlies MANOVA (Multivariate Analysis of Variance) in R Kind regards, Jes [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

Re: [R] help in attach function

2010-04-07 Thread Steve Lianoglou
Hi, On Wed, Apr 7, 2010 at 4:24 PM, Changbin Du wrote: > Hi, r-community, > > This morning, I MET the following problem several times when I try to attach > the data set. > > When I closed the current console and reopen the R console, the problem > disappear. BUt with the time passed on, the prob

[R] attach

2010-04-07 Thread Changbin Du
I found the following message maybe help. And I will try it. Hi there, I have just found that the ``attach'' function can get you into trouble when called many times. For example, you have a simulation routine called ``f()'', in which you used ``attach'' and no corresponding ``detach''. Then y

[R] help in attach function

2010-04-07 Thread Changbin Du
Hi, r-community, This morning, I MET the following problem several times when I try to attach the data set. When I closed the current console and reopen the R console, the problem disappear. BUt with the time passed on, the problem occurs again. Can anyone help me with this? > attach(total)

Re: [R] Code is too slow: mean-centering variables in a data framebysubgroup

2010-04-07 Thread Dimitri Liakhovitski
Yes, Tom's solution is indeed the fastest! On my PC it took .17-.22 seconds while using ave() took .23-.27 seconds. And of course - the last two methods I mentioned took 1.3 SECONDS, not MINUTES (it was a typo). All that is left to me is to understand what .SD stands for. :-) Dimitri On Wed, Apr

Re: [R] Code is too slow: mean-centering variables in a data framebysubgroup

2010-04-07 Thread Rob Forler
Leave it up to Tom to solve things wickedly fast :) Just as an fyi Dimitri, Tom is one of the developers of data.table. -Rob On Wed, Apr 7, 2010 at 2:51 PM, Dimitri Liakhovitski wrote: > Wow, thank you, Tom! > > On Wed, Apr 7, 2010 at 3:46 PM, Tom Short wrote: > > Here's how I would have done

Re: [R] Error Bars in lattice- barcharts

2010-04-07 Thread Ivan Gregoretti
Hi Sam and everybody, Can you educate me a little bit on the use of barchart? A command like this barchart(~table(someProperty), data=A) produces a barchart with horizontal bars. I want to produce that graph but with VERTICAL bars. clearly, horizontal=FALSE does not work. Thank you, Ivan

Re: [R] FW: fairly simple file I/O

2010-04-07 Thread Steve Lianoglou
Hi, On Wed, Apr 7, 2010 at 3:15 PM, Cable, Samuel B Civ USAF AFMC AFRL/RVBXI wrote: > > OK, my apologies.  I am sure this is a question that has been answered > before.  But I have looked all over the web and can't find an answer for > it.  I promise, wasting your time and bandwidth is my last re

Re: [R] Code is too slow: mean-centering variables in a data framebysubgroup

2010-04-07 Thread Dimitri Liakhovitski
Wow, thank you, Tom! On Wed, Apr 7, 2010 at 3:46 PM, Tom Short wrote: > Here's how I would have done the data.table method. It's a bit faster > than the ave approach on my machine: > >> # install.packages("data.table",repos="http://R-Forge.R-project.org";) >> library(data.table) >> >> f3 <- funct

Re: [R] Code is too slow: mean-centering variables in a data framebysubgroup

2010-04-07 Thread Tom Short
Here's how I would have done the data.table method. It's a bit faster than the ave approach on my machine: > # install.packages("data.table",repos="http://R-Forge.R-project.org";) > library(data.table) > > f3 <- function(frame) { + frame <- as.data.table(frame) + frame[, lapply(.SD[,2:ncol(.SD

Re: [R] ggplot2, density barplot and geom_point layer

2010-04-07 Thread Johannes Graumann
Thanks so much. Solved. Joh hadley wickham wrote: > Because of the way you've constructed the plot with qplot, you need to > use: > > myPlot + geom_point( > data=medians, > aes(x=med,shape=cut, y=0), > size=2.5, > ) > > Hadley > > On Wed, Apr 7, 2010 at 5:11 AM, Johannes Graumann > wrote:

Re: [R] 3-D response surface using wireframe()

2010-04-07 Thread array chip
Thank you David. The document is very helpful. I had a typo in my 2nd example plot, one of the "z" is "x", "z" is the vertical one. Thanks John --- On Wed, 4/7/10, David Winsemius wrote: > From: David Winsemius > Subject: Re: [R] 3-D response surface using wireframe() > To: "array chip" >

Re: [R] Creating two lines of best fit on a scatter plot

2010-04-07 Thread Andrew Dolman
lm1 <- lm(y~x, data=mydata, subset=mydata$patchchoice==1) lm2 <- lm(y~x, data=mydata, subset=mydata$patchchoice==2) abline(lm1, col="Blue") abline(lm2, col="Red" ) Should do it. Not likely the best way but a way. Andy. andydol...@gmail.com On 7 April 2010 19:17, Samantha Reynolds wrote:

[R] FW: fairly simple file I/O

2010-04-07 Thread Cable, Samuel B Civ USAF AFMC AFRL/RVBXI
OK, my apologies. I am sure this is a question that has been answered before. But I have looked all over the web and can't find an answer for it. I promise, wasting your time and bandwidth is my last resort. So here goes: I have an ASCII file formatted like so: Label 1.1 Time 1 La

Re: [R] recoding variables-recode not working

2010-04-07 Thread John Fox
Dear Vlatka, It's impossible to know what the problem is without knowing something about your data, which you didn't tell us either in this message or your subsequent one. The recode command should work: > (x <- c(rep(0, 5), sample(1:30, 5, replace=TRUE))) [1] 0 0 0 0 0 17 27 19 19 2 > r

Re: [R] match function or "=="

2010-04-07 Thread Patrick Burns
You might want to investigate the 'data.table' package. On 07/04/2010 16:15, bo wrote: Hi all, I have a huge dataset(5000k observations), which contains the daily sales for each company. If I want to find out the a company with unique company id number, which function I should use that is more

[R] Creating two lines of best fit on a scatter plot

2010-04-07 Thread Samantha Reynolds
Hello I am trying to plot two lines of best fit on a scatter plot. I'm plotting number of visits (y) against personality (x), half the plots are blue for patchchoice one and the other plots are red for patchchoice two (these options come from one factor, see below) . So i need a line for

Re: [R] match function or "=="

2010-04-07 Thread Erik Iverson
You might try ?system.time Hi all, I have a huge dataset(5000k observations), which contains the daily sales for each company. If I want to find out the a company with unique company id number, which function I should use that is more efficient, match or "=="? For example, use<-dataset[!is.na

[R] question about fold function

2010-04-07 Thread mzhang
Dear all, I'm trying to use the fold function as described here: http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-cox-regression.pdf Page9 It does say that you can use this when you have more than one time varying covariate: in the description of the argument cov it says: "cov: A ve

Re: [R] as.ffdf.data.frame now breaks if using pattern

2010-04-07 Thread Jens Oehlschlägel
Ramon, for me this works > setwd("d:/tmp") > ffd <- as.ffdf(d, col_args=list(pattern = paste(getwd(), "/fftmp", sep = ""))) > filename(ffd) $x [1] "d:/tmp/fftmp35c34861.ff" $y [1] "d:/tmp/fftmp5be946bb.ff" $z [1] "d:/tmp/fftmp26c49ce.ff" Jens -Ursprüngliche Nachricht- Von: Ramon Diaz-

[R] match function or "=="

2010-04-07 Thread bo
Hi all, I have a huge dataset(5000k observations), which contains the daily sales for each company. If I want to find out the a company with unique company id number, which function I should use that is more efficient, match or "=="? For example, use<-dataset[!is.na(match(dataset$companyID, 123

Re: [R] combn with factors

2010-04-07 Thread Peter Ehlers
On 2010-04-07 11:40, Greg Hirson wrote: Dear list, I have come across this issue: combn(letters[1:5], 3) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] "a" "a" "a" "a" "a" "a" "b" "b" "b" "c" [2,] "b" "b" "b" "c" "c" "d" "c" "c" "d" "d" [3,] "c" "d" "e" "d" "e" "e" "d" "e" "e" "e" c

[R] Decompounder for German

2010-04-07 Thread Richard R. Liu
Does anyone know of an R package that does decompounding for German? For those not familiar with the term, decompounding is the process of breaking down a word that has been created by stringing several words together into the component words, e.g., Schulhaus -> Schule + Haus. Thanks, Ric

[R] R 2.10 Read/write.table

2010-04-07 Thread shankar
Hello, Recently I installed R version 2.10 from 2.9.2 and after the update some the commands like write.table is not functioning properly. Does anyone has similar issues. Am I missing something ? Say for example I generated a simulation data (simd1) and used this syntax to store it writ

Re: [R] recoding variables-recode not working

2010-04-07 Thread David Winsemius
On Apr 7, 2010, at 1:50 PM, Vlatka Matkovic Puljic wrote: atomic [1:1578] 0 0 0 0 0 0 0 0 0 0 ... - attr(*, "levels")= chr "0=0,1:33=1" Can you go back to where you got this data and start over? You have made something that looks quite strange. It appears to be neither a vector of mode a

Re: [R] Caret package and lasso

2010-04-07 Thread Max Kuhn
Linda, Thanks for the example. I did this to make it more reproducible: set.seed(1) X<-matrix(rnorm(50*100),nrow=50) y<-rnorm(50*1) dimnames(X) colnames(X) <- paste("V", 1:nrow(X)) # Applying caret package set.seed(2) con<-trainControl(method="cv",number=10) data<-NULL d

Re: [R] recoding variables-recode not working

2010-04-07 Thread David Winsemius
On Apr 7, 2010, at 1:31 PM, Vlatka Matkovic Puljic wrote: Hi, I have numerical variable that I want to recode into categories '0' and '1 and more' and do analysis with that data. I have tried various of possibilities to do so, but I am sucked and nothing is working. recode(Q12, "0='A';1

Re: [R] recoding variables-recode not working

2010-04-07 Thread Vlatka Matkovic Puljic
atomic [1:1578] 0 0 0 0 0 0 0 0 0 0 ... - attr(*, "levels")= chr "0=0,1:33=1" 2010/4/7 David Winsemius > > On Apr 7, 2010, at 1:31 PM, Vlatka Matkovic Puljic wrote: > > Hi, >> >> I have numerical variable that I want to recode into categories '0' and '1 >> and more' and do analysis with that d

Re: [R] Palette color order in bwplot (lattice violin plot) vs. boxplot

2010-04-07 Thread Luigi Ponti
On 07/04/2010 02:10, Felix Andrews wrote: > On 6 April 2010 20:14, Luigi Ponti wrote: > >> On 04/04/2010 06:21, Deepayan Sarkar wrote: >> >>> On Thu, Apr 1, 2010 at 4:10 AM, Luigi Ponti wrote: >>> >>> Hello, I am trying to give different colors to boxes in a violin p

[R] recoding variables-recode not working

2010-04-07 Thread Vlatka Matkovic Puljic
Hi, I have numerical variable that I want to recode into categories '0' and '1 and more' and do analysis with that data. I have tried various of possibilities to do so, but I am sucked and nothing is working. recode(Q12, "0='A';1:30='B'") cut(Q12, breaks=c(0,1,30), lables=c('0', '1 and more')) ca

[R] combn with factors

2010-04-07 Thread Greg Hirson
Dear list, I have come across this issue: combn(letters[1:5], 3) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] "a" "a" "a" "a" "a" "a" "b" "b" "b" "c" [2,] "b" "b" "b" "c" "c" "d" "c" "c" "d" "d" [3,] "c" "d" "e" "d" "e" "e" "d" "e" "e" "e" combn(facto

[R] Creating two lines of best fit on a scatter plot

2010-04-07 Thread Samantha Reynolds
Hello I am trying to plot two lines of best fit on a scatter plot. I'm plotting number of visits (y) against personality (x), half the plots are blue for patchchoice one and the other plots are red for patchchoice two (these options come from one factor, see below) . So i need a line for

Re: [R] Converting a character string into a data frame name and performing assignments to that data frame

2010-04-07 Thread Charles C. Berry
On Wed, 7 Apr 2010, Ivan Calandra wrote: Hi, I'm not sure what your goal is, but why don't you use a list? You can store each new dataframe name in a new element of the list. At the end, if each element has the same length, you can use as.data.frame() or something similar. Using a list would

Re: [R] help in histogram

2010-04-07 Thread Changbin Du
HI, Stephan, Thanks so much! IT works, I appreciated very much! On Wed, Apr 7, 2010 at 10:06 AM, Stephan Kolassa wrote: > Hi, > > first get the densities without plotting the histogram: > > foo <- hist(x, plot=FALSE) > > then plot the histogram and feed the rounded densities, converted to > ch

[R] Help with manipulation of svytotal output

2010-04-07 Thread Moss, Angela (Dudley PCT)
I have some output from a survey shown below and would like to insert total rows for each category to then be able to use it as a data set for further analysis. Is it possible to do this in R. In this example I would like to insert a row between rows 5 and 6, 10 and 11, 15 and 16, 20 and 21 and p

Re: [R] help in histogram

2010-04-07 Thread Stephan Kolassa
Hi, first get the densities without plotting the histogram: foo <- hist(x, plot=FALSE) then plot the histogram and feed the rounded densities, converted to character, to the labels argument (instead of just labels=TRUE): hist(x, freq=F, xlab='',ylab="Percent of Total", col="skyblue", labels

[R] label the bars by the percentage values in the conditional histogram?

2010-04-07 Thread Changbin Du
HI, Dear R-community: I have the following codes to plot the conditional histogram, is a way to label the bars by the percentage values in the conditional histogram? h<- sample(1:14, 319, rep=T) c<- sample(1:14, 608, rep=T) n<- sample(1:14, 1140, rep=T) vt<-c(h, c, n) ta<-rep(c("h", "c", "n"), c

[R] as.ffdf.data.frame now breaks if using pattern

2010-04-07 Thread Ramon Diaz-Uriarte
Dear All, I am using package ff. In version 2.1-1 it was possible to use "pattern" with as.ffdf.data.frame: d <- data.frame(x=1:26, y=letters, z=Sys.time()+1:26) as.ffdf(d, pattern = paste(getwd(), "/fftmp", sep = "")) With the latest version, the last command crashes. I wonder if the new behavi

Re: [R] html help not built

2010-04-07 Thread Duncan Murdoch
On 07/04/2010 11:19 AM, jgar...@ija.csic.es wrote: Hi Duncan, I must be misunderstanding something. It is not that I want them built at installation time, but when I try to display the html help for any function the html page is not built; e.g. cliking on the link to get() in the base library, th

[R] help in histogram

2010-04-07 Thread Changbin Du
x<- sample(1:14, 319, rep=T) hist(x, freq=F, xlab='',ylab="Percent of Total", col="skyblue", labels=TRUE, right=FALSE,main="Position of Hypothetical Protein") Is there is way to round the labels to 2 decimal digits, for example, 0.088 is changed to 0.09. Thanks! -- Sincerely, Changbin --

Re: [R] Struggeling with svydesign()

2010-04-07 Thread Thomas Lumley
On Wed, 7 Apr 2010, ONKELINX, Thierry wrote: Dear all, We are analysing some survey data and we are not sure if we are using the correct syntax for our design. The population of interest is a set of 4416 polygons with different sizes ranging from 0.003 to 45.6 ha, 7460 ha in total. Each polygo

Re: [R] Code is too slow: mean-centering variables in a data framebysubgroup

2010-04-07 Thread Dimitri Liakhovitski
I would like to thank once more everyone who helped me with this question. I compared the speed for different approaches. Below are the results of my comparisons - in case anyone is interested: ### Building an EXAMPLE FRAME with N rows - with groups and a lot of NAs: N<-10 set.seed(1234) frame

[R] extracting ctree() output information

2010-04-07 Thread Steven J. Clark
Hi, I am new to R and am using the ctree() function to do customer segmentation. I am using the following code to generate the tree: treedata$Response<-factor(treedata$Conversion) fit<-ctree(Response ~ .,controls=ctree_control(mincriterion=0.99,maxdepth=4),data=treedata) plot(fit) print(fit)

Re: [R] median of two groups

2010-04-07 Thread Thomas Lumley
On Wed, 7 Apr 2010, cheba meier wrote: Dear Thomas, Thank you very much for your answer! Can I use your function in my analysis? Sure. The wilcox.test() tests the differences in average ranks (H0: F(X)=F(Y)), why then do people  in many studies compare t.test() with wilcox.test()? The Wil

Re: [R] Converting a character string into a data frame name and performing assignments to that data frame

2010-04-07 Thread Ivan Calandra
Hi, I'm not sure what your goal is, but why don't you use a list? You can store each new dataframe name in a new element of the list. At the end, if each element has the same length, you can use as.data.frame() or something similar. Since you didn't provide any sample data, I'm not sure if tha

Re: [R] finding weekly average...

2010-04-07 Thread Daniel Malter
Assume you have suitable "week" indicator and your data is stored in a data.frame named "data." Then you get the weekly averages by #simulate data week <- rep(1:52,each=7) x <- week+rnorm(52*7,) y <- rev(week)+rnorm(52*7) #create data frame data=data.frame(week,x,y) #get weekly averages in a l

Re: [R] Converting a character string into a data frame name and performing assignments to that data frame

2010-04-07 Thread Kavitha Venkatesan
Hi, I'd greatly appreciate any insight into the problem in my previous message below: Please note that I would like to loop through the following steps for a list of data frames whose names are dynamically assigned at run time, so I have a character string variable, called "variable.df", which stor

Re: [R] ggplot2, density barplot and geom_point layer

2010-04-07 Thread hadley wickham
Because of the way you've constructed the plot with qplot, you need to use: myPlot + geom_point( data=medians, aes(x=med,shape=cut, y=0), size=2.5, ) Hadley On Wed, Apr 7, 2010 at 5:11 AM, Johannes Graumann wrote: > Hi, > > Please consider the example below. How can I manage to overlay the p

Re: [R] Specifying parameters for use in "plyr" / "ddply"

2010-04-07 Thread David Winsemius
On Apr 7, 2010, at 11:41 AM, Peter Ehlers wrote: On 2010-04-07 8:37, Dimitri Liakhovitski wrote: Dear R-ers! # I have a data frame with one factor and 2 numeric variables: x<-data.frame(group=c("b","b","d","d","e","e"),a=c(1,NA, 10,20,100,200),b=c(5,15,20,NA,10,30)) x # I want to divide ea

Re: [R] Specifying parameters for use in "plyr" / "ddply"

2010-04-07 Thread Peter Ehlers
On 2010-04-07 8:37, Dimitri Liakhovitski wrote: Dear R-ers! # I have a data frame with one factor and 2 numeric variables: x<-data.frame(group=c("b","b","d","d","e","e"),a=c(1,NA,10,20,100,200),b=c(5,15,20,NA,10,30)) x # I want to divide each value of each variable by its group mean - using ply

[R] finding weekly average...

2010-04-07 Thread Xin Ge
Hi All, I have a time series data with two continuous variables (say Var1 and Var2) for 4 years (***not continuous, do have some breaks because of missing data***). Something like this: Date Var1 Var2 12/01/2004 7 0 12/01/2004 0 0 12/01/2004 0 7 12/01/2004 7 0 12/01/2004 0 7 12/01/2004 0 7 12/02/

Re: [R] html help not built

2010-04-07 Thread jgarcia
Hi Duncan, I must be misunderstanding something. It is not that I want them built at installation time, but when I try to display the html help for any function the html page is not built; e.g. cliking on the link to get() in the base library, the message appears: An error occurred while loading f

[R] --enable-prebuilt-html

2010-04-07 Thread jgarcia
Hi, Sorry about my last question. I've found the solution in the documentation, and yes; there is a flag in ./configure I did not see. Thanks Javier --- __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

  1   2   >