Re: [R] Export Results

2010-06-25 Thread Tal Galili
See ?pdf ?png ?sink There is also R2wd (about which I wrote here: http://www.r-statistics.com/2010/05/exporting-r-output-to-ms-word-with-r2wd-an-example-session/ ) And there are also the "brew", and "Sweave" packages (as Henrique mentioned). Best, Tal Contact Details:-

Re: [R] predict newdata question

2010-06-25 Thread Felipe Carrillo
Thanks Bill, that worked great!!   > You ask: # How can I use predict here, 'newdata' > crashes predict(m1,newdata=wolf$predicted);wolf # it doesn't work To > use predict() you need to give a fitted model object (here m1) and a *data > frame* to specify the values of the predictors for which y

Re: [R] subset arg in subset(). was: converting result of substitute to 'ordidnary' expression

2010-06-25 Thread Bill.Venables
Here is another one that works: > do.call(subset, list(dat, subsetexp)) x y 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 > -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Vadim Ogranovich Sent: Saturday, 26 June 2010 11:13

Re: [R] integration of two normal density

2010-06-25 Thread Bill.Venables
Your intuition is wrong and R is right. Why should the product of two probability density functions be a normalized pdf also? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Carrie Li Sent: Saturday, 26 June 2010 1:28 PM To: r-he

Re: [R] subset arg in subset(). was: converting result of substitute to 'ordidnary' expression

2010-06-25 Thread Dennis Murphy
Hi: On Fri, Jun 25, 2010 at 6:12 PM, Vadim Ogranovich < vogranov...@jumptrading.com> wrote: > Dear R users, > > Please disregard my previous post "converting result of substitute to > 'ordidnary' expression". The problem I have has nothing to do with > substitute. > > Consider: > > > dat <- data.

Re: [R] gbm function

2010-06-25 Thread Patrick Connolly
On Wed, 23-Jun-2010 at 12:05AM -0700, azam jaafari wrote: |> ?Hello |> ? |> I have questions about gbm package.??It seems we have to?devide data to two part (training?set and test set) for first. |> ? |> 1- trainig set for?running of gbm function |> 2- test set for?gbm.perf??? |> ? |> is it rigt

Re: [R] converting result of substitute to 'ordidnary' expression

2010-06-25 Thread Gabor Grothendieck
On Fri, Jun 25, 2010 at 8:59 PM, Vadim Ogranovich wrote: > Dear R users, > > > As substitute() help page points out: >     Substituting and quoting often causes confusion when the argument >     is 'expression(...)'. The result is a call to the 'expression' >     constructor function and needs to

[R] integration of two normal density

2010-06-25 Thread Carrie Li
Hello everyone, I have a question about integration of two density function Intuitively, I think the value after integration should be 1, but they are not. Am I missing something here ? > t=function(y){dnorm(y, mean=3)*dnorm(y/2, mean=1.5)} > integrate(t, -Inf, Inf) 0.3568248 with absolute error

Re: [R] converting result of substitute to 'ordidnary' expression

2010-06-25 Thread Charles C. Berry
On Fri, 25 Jun 2010, Vadim Ogranovich wrote: Dear R users, As substitute() help page points out: Substituting and quoting often causes confusion when the argument is 'expression(...)'. The result is a call to the 'expression' constructor function and needs to be evaluated with 'eva

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-25 Thread Joris Meys
>>I had taken the opposite tack with Google Trends by subtracting > keywords >>like: >>SAS -shoes -airlines -sonar... >>but never got as good results as that beautiful "X code for" search. >>When you see the end-of-semester panic bumps in traffic, you know > you're >>nailing it! > > I have to eat t

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-25 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Muenchen, Robert A (Bob) > Sent: Friday, June 25, 2010 5:39 AM > To: Liviu Andronic > Cc: r-help@r-project.org > Subject: Re: [R] Popularity of R, SAS, SPSS, Stata... > > > >

[R] inf.rm function?

2010-06-25 Thread Julia Choi
Dear All: I have been trying to remove "Inf" values from a series of data (multiple ratio operations). I have tried the na.rm() function (and tried this inside mean(), median(), and var()) but this does not always work. Though the !is.finite() or is.infinite() functions appear to be very prom

[R] subset arg in subset(). was: converting result of substitute to 'ordidnary' expression

2010-06-25 Thread Vadim Ogranovich
Dear R users, Please disregard my previous post "converting result of substitute to 'ordidnary' expression". The problem I have has nothing to do with substitute. Consider: > dat <- data.frame(x=1:10, y=1:10) > subsetexp <- expression(5 ## this does work > subset(dat, eval(subsetexp)) x y

Re: [R] predict newdata question

2010-06-25 Thread Bill.Venables
You ask: # How can I use predict here, 'newdata' crashes predict(m1,newdata=wolf$predicted);wolf # it doesn't work To use predict() you need to give a fitted model object (here m1) and a *data frame* to specify the values of the predictors for which you want predictions. Here wolf$predicted is

[R] converting result of substitute to 'ordidnary' expression

2010-06-25 Thread Vadim Ogranovich
Dear R users, As substitute() help page points out: Substituting and quoting often causes confusion when the argument is 'expression(...)'. The result is a call to the 'expression' constructor function and needs to be evaluated with 'eval' to give the actual expression object.

Re: [R] All a column to a data frame with a specific condition

2010-06-25 Thread Joris Meys
merge(sum_plan_a,data,by="plan_a") Cheers Joris On Sat, Jun 26, 2010 at 2:27 AM, Yi wrote: > Hi, folks, > > Please first look at the codes: > > plan_a=c('apple','orange','apple','apple','pear','bread') > plan_b=c('bread','bread','orange','bread','bread','yogurt') > value=1:6 > data=data.frame(p

Re: [R] Average 2 Columns when possible, or return available value

2010-06-25 Thread Joshua Wiley
On Fri, Jun 25, 2010 at 5:24 PM, Joris Meys wrote: > Just want to add that if you want to clean out the NA rows in a matrix > or data frame, take a look at ?complete.cases. Can be handy to use > with big datasets. I got curious, so I just ran the codes given here > on a big dataset, before and aft

[R] predict newdata question

2010-06-25 Thread Felipe Carrillo
Hi: I am using a subset of the below dataset to predict PRED_SUIT for the whole dataset but I am having trouble with 'newdata'. The model was created with 153 records and want to predict for 208 records. wolf2 <- structure(list(gridcell = c(367L, 444L, 533L, 587L, 598L, 609L, 620L, 629L, 641L, 6

[R] All a column to a data frame with a specific condition

2010-06-25 Thread Yi
Hi, folks, Please first look at the codes: plan_a=c('apple','orange','apple','apple','pear','bread') plan_b=c('bread','bread','orange','bread','bread','yogurt') value=1:6 data=data.frame(plan_a,plan_b,value) library(plyr) library(reshape) mm=melt(data, id=c('plan_a','plan_b')) sum_plan_a=cast(mm,

Re: [R] Average 2 Columns when possible, or return available value

2010-06-25 Thread Joris Meys
Just want to add that if you want to clean out the NA rows in a matrix or data frame, take a look at ?complete.cases. Can be handy to use with big datasets. I got curious, so I just ran the codes given here on a big dataset, before and after removing NA rows. I have to be honest, this is surely an

Re: [R] use a data frame whose name is stored as a string variable?

2010-06-25 Thread Joshua Wiley
On Fri, Jun 25, 2010 at 5:10 PM, Seth wrote: > > Hi, > Let's say I have a data frame (called "example") with numeric values stored > (columns V1 and V2).  I also have a string variable storing this name > > x1<-"example" > > Is there a way to use the variable x so that R knows that I want the > sp

[R] Label Values in levelplot

2010-06-25 Thread Ben Wilkinson
I am trying to add labels equal to the value in a levelplot. I believe that panel may be the way to go but cannot understand the examples. In the following example: X,Y,Z A,M,100 A,M,200 B,N,150 B,N,225 I would like to label each of the rectangles 100,200,150 and 225 and colour according to the

[R] use a data frame whose name is stored as a string variable?

2010-06-25 Thread Seth
Hi, Let's say I have a data frame (called "example") with numeric values stored (columns V1 and V2). I also have a string variable storing this name x1<-"example" Is there a way to use the variable x so that R knows that I want the specified action to occur on the data frame? For example, summ

Re: [R] Lattice plotting question

2010-06-25 Thread Felix Andrews
ylim = extendrange(c(0,100)) ? On 26 June 2010 01:42, David Warren wrote: > Hi all, > >     I'm working on some plots using lattice (R 2.10.1), and have entered > the polish phase.  I've produced a satisfactory pair of xyplots ( > http://imgur.com/EyXGi.png), but would like to align the y-axes of

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-25 Thread Joris Meys
Thanks for the link, very interesting book. Yet, I couldn't find the part about EDMA. It would have surprised me anyway, as the input of multidimensional scaling is one matrix with euclidean distances between your observations, whereas in EDMA the data consist of a number of distance matrices. Qui

Re: [R] Average 2 Columns when possible, or return available value

2010-06-25 Thread Joshua Wiley
btw, if you just wanted your exact code to work: t(as.matrix(aggregate(t(as.matrix(DF)),list(rep(1:1,each=2)),mean, na.rm=TRUE)[,-1])) You will get NaNs rather than NAs where you are missing from both rows, but that should not be a real issue. -- Joshua Wiley Ph.D. Student, Health Psychology

Re: [R] Average 2 Columns when possible, or return available value

2010-06-25 Thread Joshua Wiley
Hello Eric, I am not sure how your need to use list() will fit in with this, but for your sample data, this will do the trick. matrix(rowMeans(DF, na.rm=TRUE), ncol=1) HTH, Josh On Fri, Jun 25, 2010 at 4:08 PM, emorway wrote: > > Forum, > > Using the following data: > > DF<-read.table(textCon

Re: [R] Average 2 Columns when possible, or return available value

2010-06-25 Thread Phil Spector
Eric - What you're describing is taking the mean of each row while ignoring missing values: apply(DF,1,mean,na.rm=TRUE) [1] 22.60NaNNaNNaNNaNNaNNaNNaN 102.00 19.20 [11] 19.20NaNNaNNaN 11.80 7.62NaNNaNNaNNaN [21]NaN 75.00N

[R] Average 2 Columns when possible, or return available value

2010-06-25 Thread emorway
Forum, Using the following data: DF<-read.table(textConnection("A B 22.60 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 102.00 NA 19.20 NA 19.20 NA NA NA NA NA NA NA 11.80 NA 7.62 NA NA NA NA NA NA NA NA NA NA NA 75.00 NA NA NA 18.30 18.2 NA NA NA NA 8.44 NA 18.00 NA N

Re: [R] fatal error: unable to restore saved data

2010-06-25 Thread Phil Spector
Albert - The message refers to a file specifically called ".RData". Files with subscripts of .rdata are not related. You can see your current working directory by typing getwd() at the R prompt. I'm not sure where "rattle" enters into the picture.

[R] fatal error: unable to restore saved data

2010-06-25 Thread Albert Lee, Ph.D.
I just installed the R 2.11.1 version on my computer and I encountered a fatal error: "Unable to restore saved data in .RData" and kick me out of R right away. I still can run 2.10.2. There is no package called "rattle" I checked various posts regarding this error. I still can't get it to wo

Re: [R] Trying to tile wireframe plots (using lattice package)

2010-06-25 Thread Magnus Torfason
Thanks, that was the pointer I needed. I'd tried the split parameter but didn't realize that it doesn't work well within wireframe() itself, rather, I had to call print.trellis() directly using the trellis object that wireframe() returns if one assigns it to something. After that, it was prett

Re: [R] Export Results

2010-06-25 Thread Henrique Dallazuanna
See ?Sweave On Fri, Jun 25, 2010 at 12:58 PM, Pedro Mota Veiga wrote: > > Hi R users, > How can I automatically export results and graphs to a file? > Thanks in advance > > Pedro Mota Veiga > > -- > View this message in context: > http://r.789695.n4.nabble.com/Export-Results-tp2268622p2268622.htm

[R] Diebold Mariano

2010-06-25 Thread Brajkovic J.
Hello, I am trying to calculate Diebold Mariano test statistic (DM) using dm.test module. I also try to do the same thing with STATA and I get vastly different results (4.5 vs 25). Does someone have experience with this module? I tried to calculate the DM statistic manually. If by “d” I define

[R] Lattice plotting question

2010-06-25 Thread David Warren
Hi all, I'm working on some plots using lattice (R 2.10.1), and have entered the polish phase. I've produced a satisfactory pair of xyplots ( http://imgur.com/EyXGi.png), but would like to align the y-axes of the top and bottom plots. I assume that I need to adjust axis padding or something

[R] Export Results

2010-06-25 Thread Pedro Mota Veiga
Hi R users, How can I automatically export results and graphs to a file? Thanks in advance Pedro Mota Veiga -- View this message in context: http://r.789695.n4.nabble.com/Export-Results-tp2268622p2268622.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] exists() and functions

2010-06-25 Thread Jonathan Greenberg
Always nice to answer my own question 3 minutes later. The missing() function does what I want. Still, why DOES this exists() statement fail? Do functions "auto create" the variables once they are called, regardless of whether or not they are assigned? --j On Fri, Jun 25, 2010 at 1:05 PM, Jona

[R] exists() and functions

2010-06-25 Thread Jonathan Greenberg
I'm a bit confused about how exists() work within a function -- I want to test for unassigned variables, but I'm doing tests in the main environment to figure out the function, so the variables DO exist in the parent environment of a function call. Why does: myfunction <- function(variable_outside

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-25 Thread Muenchen, Robert A (Bob)
>-Original Message- >From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >On Behalf Of Muenchen, Robert A (Bob) >Sent: Friday, June 25, 2010 3:08 PM >To: Joris Meys; Dario Solari >Cc: r-help@r-project.org >Subject: Re: [R] Popularity of R, SAS, SPSS, Stata... > >I had

Re: [R] Forcing scalar multiplication.

2010-06-25 Thread Kjetil Halvorsen
?sweep On Fri, Jun 25, 2010 at 2:43 PM, wrote: > I am trying to check the results from an Eigen decomposition and I need to > force a scalar multiplication. The fundamental equation is: Ax = lx. Where > 'l' is the eigen value and x is the eigen vector corresponding to the > eigenvalue. 'R' re

[R] Modelling Crystal Growth

2010-06-25 Thread mplar1
Dear all, I would like to hear from anyone who has experience using R to simulate and visualise the formation and growth of crystals. Thank you. mpl -- View this message in context: http://r.789695.n4.nabble.com/Modelling-Crystal-Growth-tp2268746p2268746.html Sent from the R help mailing list

[R] lattice legend

2010-06-25 Thread sethandmelva
The solution Felix suggested worked: It was indeed helpful to include the line par.setttings=list(superpose.symbol=sup.sym) while using.auto key with a customized symbol list in lattice. Thanks Felix! Seth [[alternative HTML version deleted]] ___

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-25 Thread Muenchen, Robert A (Bob)
I had taken the opposite tack with Google Trends by subtracting keywords like: SAS -shoes -airlines -sonar... but never got as good results as that beautiful "X code for" search. When you see the end-of-semester panic bumps in traffic, you know you're nailing it! I see that there's a car, the R

Re: [R] Delete rows in the data frame by limiting values in two columns

2010-06-25 Thread Erik Iverson
x=c('germany','poor italy','usa','england','poor italy','japan') y=c('Spain','germany','usa','brazil','england','chile') s=1:6 z=3:8 test=data.frame(x,y,s,z) #Now I only concern the countries ('germany','england','brazil'). I would like to keep the rows where these three countries #are involved

Re: [R] Delete rows in the data frame by limiting values in two columns

2010-06-25 Thread Henrique Dallazuanna
Try this: test[rowSums(mapply('%in%', test[c('x', 'y')], list(c('germany','england','brazil' > 0,] On Fri, Jun 25, 2010 at 4:00 PM, Yi wrote: > Hi, folks, > > Finally Friday~~ Here comes the question: > > x=c('germany','poor italy','usa','england','poor italy','japan') > y=c('Spain','german

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Thomas Lumley
On Thu, 24 Jun 2010, Atte Tenkanen wrote: On Jun 23, 2010, at 9:58 PM, Atte Tenkanen wrote: Thanks. What I have had to ask is that how do you test that the data is symmetric enough? If it is not, is it ok to use some data transformation? when it is said: "The Wilcoxon signed rank test does

[R] Delete rows in the data frame by limiting values in two columns

2010-06-25 Thread Yi
Hi, folks, Finally Friday~~ Here comes the question: x=c('germany','poor italy','usa','england','poor italy','japan') y=c('Spain','germany','usa','brazil','england','chile') s=1:6 z=3:8 test=data.frame(x,y,s,z) #Now I only concern the countries ('germany','england','brazil'). I would like to ke

Re: [R] Trying to tile wireframe plots (using lattice package)

2010-06-25 Thread Greg Snow
The layout function is base graphics, wireframe from lattice is grid based and they don't play well together without extra effort. The simplest option will probably be to look at the help page for print.trellis, specifically the split and more arguments. Then look at the examples to see if thi

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Greg Snow
Let me see if I understand. You actually have the data for the whole population (the entire piece) but you have some pre-defined sections that you want to see if they differ from the population, or more meaningfully they are different from a randomly selected set of measures. Is that correct?

[R] Trying to tile wireframe plots (using lattice package)

2010-06-25 Thread Magnus Torfason
Hi all, I'm trying to print a number of wireframe plots (generated using the lattice package), and I want them to appear in a two-by two matrix along with some other (standard) plots. In other words I am trying to create a subplot or tiled plot that works for wireframes. I've tried the metho

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Daniel Malter
Atte, I would not wonder if you got lost and confused by the certainly interesting methodological discussion that has been going on in this thread. Since the helpers do not seem to converge/agree, I propose to you to use a different nonparametric approach: The bootstrap. The important thing about

[R] Forcing scalar multiplication.

2010-06-25 Thread rkevinburton
I am trying to check the results from an Eigen decomposition and I need to force a scalar multiplication. The fundamental equation is: Ax = lx. Where 'l' is the eigen value and x is the eigen vector corresponding to the eigenvalue. 'R' returns the eigenvalues as a vector (e <- eigen(A); e$values

[R] Forcing scalar multiplication.

2010-06-25 Thread rkevinburton
I am trying to check the results from an Eigen decomposition and I need to force a scalar multiplication. The fundamental equation is: Ax = lx. Where 'l' is the eigen value and x is the eigen vector corresponding to the eigenvalue. 'R' returns the eigenvalues as a vector (e <- eigen(A); e$values

Re: [R] Sweave: The opposite of tangle

2010-06-25 Thread stefan.d...@gmail.com
Thanks! That was exactly what I was looking for. Best, Stefan On Fri, Jun 25, 2010 at 12:37 PM, Kevin E. Thorpe wrote: > Kevin E. Thorpe wrote: >> >> stefan.d...@gmail.com wrote: >>> >>> Hi, >>> I am using Sweave to write an article. If I want to convert the *.rnw >>> to a *.tex file I have to r

Re: [R] variograms and kriging

2010-06-25 Thread Steve_Friedman
Please disregard. I've posted to the wrong site. Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-25 Thread Kjetil Halvorsen
There is a freely downloadable and very relevant (& readable) book at https://ccrma.stanford.edu/~dattorro/mybook.html "Convex Optimization and Euclidean Distance geometry", and it indeed names EDMA as a form of multidimensional scaling (or maybe in the oposite way). You should have a look at the c

[R] variograms and kriging

2010-06-25 Thread Steve_Friedman
Hello Trying to develop variograms and kriged surfaces from a point file. Here is what I've done so far. library(gstat) # also loads library(sp) library(lattice) soilpts$x <- soilpts$UTM_X soilpts$y <- soilpts$UTM_Y soil.dat <- subset(soilpts, select=c(x, y, Area, BulkDensity, LOI, TP, TN,

Re: [R] ggplot2: deterministic position_jitter & geom_line with position_jitter

2010-06-25 Thread Hadley Wickham
> I'm having the same problem as Stephan (see below), but what I'm trying to > jitter is not a numeric vector, but a factor. How do I proceed? (Naively > jittering a factor makes it numeric, no longer factor, so I don't get the > custom ordering which conveniently comes with using a factor. I'm not

Re: [R] Handouts / Reports or just simply printing text to PDF?

2010-06-25 Thread Tal Galili
Hi Ralf, ?pdf and ?png are good places to start. There is also R2wd: http://cran.r-project.org/web/packages/R2wd/index.html For exporting R output to word. I wrote a short tutorial session for it here: http://www.r-statistics.com/2010/05/exporting-r-output-to-ms-word-with-r2wd-an-example-sessio

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Frank E Harrell Jr
You still are stating the effect of the central limit theorem incorrectly. Please see my previous note. Frank On 06/25/2010 10:27 AM, Joris Meys wrote: > 2010/6/25 Frank E Harrell Jr: >> The central limit theorem doesn't help. It just addresses type I error, >> not power. >> >> Frank > > I don

Re: [R] (no subject)

2010-06-25 Thread Berend Hasselman
You posted the exact same question several days ago (June 17) under a different name. You got two perfectly good and adequate answers. /Berend -- View this message in context: http://r.789695.n4.nabble.com/no-subject-tp2268375p2268685.html Sent from the R help mailing list archive at Nabble.co

Re: [R] Fast and simple tool for re-sampling of asynchronous time series ?

2010-06-25 Thread Gabor Grothendieck
On Fri, Jun 25, 2010 at 11:34 AM, bruno Piguet wrote: > Hi all, > >   I'm looking for a function which could do some fast and simple > re-sampling of asynchronous time series. > >   Below is a MCE of the kind of algorithm I need. As you can see, it's > quite crude, but it's enough for my current n

[R] 3D generalization of correlogram?

2010-06-25 Thread Dieter Menne
We have 3-Dimensional MRI density recordings of tumor tissue and would like to have a measure of "patchiness", reflecting cluster size in the tissue. For 2-D slices, correlogram from MASS works well. Does someone know of a packages that provides a 3-D generalization of this measure? Or any alterna

Re: [R] best way to plot a evolution in time

2010-06-25 Thread Tal Galili
Hi Nana, The question is not fully clear to me. Are you looking to plot the (let's call it) "family tree" of the genes ? (if so, then using plot(hclust(gene.dist)) Might be a direction for you) Tal Contact Details:--- Contact

Re: [R] Fast and simple tool for re-sampling of asynchronous time series ?

2010-06-25 Thread Charles C. Berry
On Fri, 25 Jun 2010, bruno Piguet wrote: Hi all, I'm looking for a function which could do some fast and simple re-sampling of asynchronous time series. Below is a MCE of the kind of algorithm I need. As you can see, it's quite crude, but it's enough for my current needs. The only problem

Re: [R] Fortune?

2010-06-25 Thread Achim Zeileis
Bert, thanks for the pointer, added to the devel version of "fortunes" on R-Forge. thx, Z On Fri, 25 Jun 2010, Bert Gunter wrote: "On average, any data manipulation that can be described in a sentence or two of English can be programmed in one line in R. If you find yourself writing a long

Re: [R] Simple qqplot question

2010-06-25 Thread Bert Gunter
To add to/modify what Joris (and I) previously said: 1. qqplots are not cumulative distribution plots. Hence, as Joris said, the S-shape indicates short tails/bimodality compared to the normal. Why you continue to insist on carrying out normality tests that with so many points obviously will reje

Re: [R] gsub with regular expression

2010-06-25 Thread Gabor Grothendieck
On Fri, Jun 25, 2010 at 11:11 AM, Gabor Grothendieck wrote: > On Fri, Jun 25, 2010 at 10:48 AM, Sebastian Kruk > wrote: >> If I have a text with 7 words per line and I would like to put first >> and second word joined in a vector and the rest of words one per >> column in a matrix how can I do it

Re: [R] Fortune?

2010-06-25 Thread Liviu Andronic
On Fri, Jun 25, 2010 at 4:17 PM, Bert Gunter wrote: > "On average, any data manipulation that can be described in a sentence or > two of English can be programmed in one line in R. If you find yourself > writing a long 'for' loop to do something that sounds simple, take a step > back and research

[R] Fast and simple tool for re-sampling of asynchronous time series ?

2010-06-25 Thread bruno Piguet
Hi all, I'm looking for a function which could do some fast and simple re-sampling of asynchronous time series. Below is a MCE of the kind of algorithm I need. As you can see, it's quite crude, but it's enough for my current needs. The only problem is that it is quite slow on real use case

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Joris Meys
2010/6/25 Frank E Harrell Jr : > The central limit theorem doesn't help. It just addresses type I error, > not power. > > Frank I don't think I stated otherwise. I am aware of the fact that the wilcoxon has an Asymptotic Relative Efficiency greater than 1 compared to the t-test in case of skewed

[R] Fortune?

2010-06-25 Thread Bert Gunter
"On average, any data manipulation that can be described in a sentence or two of English can be programmed in one line in R. If you find yourself writing a long 'for' loop to do something that sounds simple, take a step back and research if an existing combination of functions can easily handle you

Re: [R] gsub with regular expression

2010-06-25 Thread Allan Engelhardt
help("strsplit") is your friend, for example: t <- c("2008/12/31 12:23:31 numero 343.233.233 Rodeo Vaca Ruido", "2010/02/01 02:35:31 palabra 111.111.222 abejorro Rodeo Vaca") m <- do.call(rbind, strsplit(t, "[[:space:]]+")) # Matrix of all the data v <- paste(m[, 1], m[, 2]) # The vect

Re: [R] gsub with regular expression

2010-06-25 Thread Gabor Grothendieck
On Fri, Jun 25, 2010 at 10:48 AM, Sebastian Kruk wrote: > If I have a text with 7 words per line and I would like to put first > and second word joined in a vector and the rest of words one per > column in a matrix how can I do it? > > First 2 lines of my text file: > "2008/12/31 12:23:31 numero 3

[R] gsub with regular expression

2010-06-25 Thread Sebastian Kruk
If I have a text with 7 words per line and I would like to put first and second word joined in a vector and the rest of words one per column in a matrix how can I do it? First 2 lines of my text file: "2008/12/31 12:23:31 numero 343.233.233 Rodeo Vaca Ruido" "2010/02/01 02:35:31 palabra 111.111.22

Re: [R] (no subject)

2010-06-25 Thread Allan Engelhardt
Maybe something like: y <- readLines("foo") z <- strsplit(y, ",") cols <- sort(unique(unlist(z))) # Assuming this is what you want for column names m <- matrix(0, nrow=length(z), ncol=length(cols), dimnames=list(as.character(1:length(z)), cols)) for (i in 1:length(z)) { m[i, z[[i]]]

Re: [R] Wilcoxon signed rank test and its requirements

2010-06-25 Thread Frank E Harrell Jr
The central limit theorem doesn't help. It just addresses type I error, not power. Frank On 06/25/2010 04:29 AM, Joris Meys wrote: > As a remark on your histogram : use less breaks! This histogram tells > you nothing. An interesting function is ?density , eg : > > x<-rnorm(250) > hist(x,freq=F)

Re: [R] Optimizing given two vectors of data (confusedSoul)

2010-06-25 Thread Prof. John C Nash
I am trying to estimate an Arrhenius-exponential model in R. I have one vector of data containing failure times, and another containing corresponding temperatures. I am trying to optimize a maximum likelihood function given BOTH these vectors. However, the optim command takes only one such vect

Re: [R] create group markers in original data frame ie. countinued... ? to calculate sth for groups defined between points in one variable (string), /separating/ spliting variable into groups by i.e.

2010-06-25 Thread Eugeniusz Kaluza
Dear useRs, at the beginning, Joris Meys, thank you for explaining how to obtain calculation result possible for groups between string marks in one variable in data frame, like in this example below (between START and STOP), wchich I would like to complete at the end by asking about... how is

Re: [R] i want create script

2010-06-25 Thread Joris Meys
Please read the posting guide : http://www.R-project.org/posting-guide.html Your question is very vague. One could assume you're completely new to R and want the commands to read a csv file (see ?read.csv), and to write away a table (eg ?write.table to write your predicted data in a text format).

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-25 Thread Muenchen, Robert A (Bob)
>-Original Message- >From: Liviu Andronic [mailto:landronim...@gmail.com] >Sent: Friday, June 25, 2010 7:15 AM >To: Muenchen, Robert A (Bob) >Cc: r-help@r-project.org >Subject: Re: [R] Popularity of R, SAS, SPSS, Stata... > >On Sun, Jun 20, 2010 at 2:31 PM, Muenchen, Robert A (Bob) > wrot

Re: [R] Assigning variable value as name to cbind column

2010-06-25 Thread Henrique Dallazuanna
Try this also: cbind(dataTest, `colnames<-`(cbind(new.data[1:nrow(dataTest)]), name)) On Fri, Jun 25, 2010 at 2:47 AM, Ralf B wrote: > Hi all, > > I have this (non-working) script: > > dataTest <- data.frame(col1=c(1,2,3)) > new.data <- c(1,2) > name <- "test" > n.row <- dim(dataTest)[1] > leng

Re: [R] Confused: Looping in dataframes

2010-06-25 Thread phani kishan
Hey, I only got the output once cuz I was returning from the function at the end of one loop. I set that right and I have printed the values. function being used by me now is: function(x) { for(i in 1:length(x)) { print(names(x[i])) print(myets(x[[i]])) } } where myets is my customized exponentia

Re: [R] Confused: Looping in dataframes

2010-06-25 Thread David Winsemius
On Jun 25, 2010, at 7:09 AM, phani kishan wrote: On Fri, Jun 25, 2010 at 1:54 PM, Paul Hiemstra wrote: On 06/25/2010 10:02 AM, phani kishan wrote: Hey, I have a data frame x which consists of say 10 vectors. I essentially want to find out the best fit exponential smoothing for each of

[R] (no subject)

2010-06-25 Thread ricardo . sousa2001
Hello, I'm new in using the R, but from what I read is an excellent tool. Would you like if I could help, I am trying create an array from reading a text file. The idea is to read the file, and transform the data in binary format, for example. The calves of this file format. A,B

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-25 Thread gokhanocakoglu
thanks for your interests Joris Gokhan OCAKOGLU Uludag University Faculty of Medicine Department of Biostatistics http://www20.uludag.edu.tr/~biostat/ocakoglui.htm -- View this message in context: http://r.789695.n4.nabble.com/Euclidean-Distance-Matrix-Analysis-EDMA-in-R-tp2266797p2268257.h

Re: [R] Optimizing given two vectors of data

2010-06-25 Thread Joris Meys
Optim uses vectors of _parameters_, not of data. You add a (likelihood) function, give initial values of the parameters, and get the optimized parameters back. See ?optim and the examples therein. It contains an example for optimization using multiple data columns. Cheers Joris On Fri, Jun 25, 20

Re: [R] Finding sets

2010-06-25 Thread David Winsemius
On Jun 25, 2010, at 5:43 AM, Dennis Murphy wrote: Hi: Here's one approach: x <- rep(c(1,2,1,3,5), each=5) rle(x) Run Length Encoding lengths: int [1:5] 5 5 5 5 5 values : num [1:5] 1 2 1 3 5 table(rle(x)$values) 1 2 3 5 2 1 1 1 unname(table(rle(x)$values))[1] [1] 2 This method doe

Re: [R] Handouts / Reports or just simply printing text to PDF?

2010-06-25 Thread Matt Shotwell
Check out the brew package, by Jeff Horner. Ralf B wrote: > I assume R won't easily generate nice reports (unless one starts using > Sweave and LaTeX) but perhaps somebody here knows a package that can > create report like output for special cases? How can I simply plot > output into PDF? > Perha

Re: [R] ask a question about list in R

2010-06-25 Thread David Winsemius
On Jun 25, 2010, at 1:00 AM, song song wrote: my list al is as below: al=list(c(2,3),5,7) al [[1]] [1] 2 3 [[2]] [1] 5 [[3]] [1] 7 and I check the second component, its element is 5, then I remove this, now my al is: al[[2]][al[[2]]!=5]->al[[2]] al [[1]] [1] 2 3 [[2]] numeric(0) [

Re: [R] i want create script

2010-06-25 Thread John Kane
I'd suggest having a look at the manuals on the [url=http://www.r-project.org][b]R[/b][/url]site, especially the Introduction to R and R Data Import/Export. Some helpful tutorials may be found at http://www.math.ilstu.edu/dhkim/Rstuff/Rtutor.html and http://www.sph.umich.edu/csg/abecasis/class

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-25 Thread Liviu Andronic
On Sun, Jun 20, 2010 at 2:31 PM, Muenchen, Robert A (Bob) wrote: > come up with so far at http://r4stats.com/popularity . I'm sure people > will have plenty of ideas on how to improve this, so please let me know > what you think. > This is not much of a metric, probably not even a ballpark, but I

Re: [R] Confused: Looping in dataframes

2010-06-25 Thread phani kishan
On Fri, Jun 25, 2010 at 1:54 PM, Paul Hiemstra wrote: > On 06/25/2010 10:02 AM, phani kishan wrote: > >> Hey, >> I have a data frame x which consists of say 10 vectors. I essentially want >> to find out the best fit exponential smoothing for each of the vectors. >> >> The problem while I'm gettin

Re: [R] Sweave: The opposite of tangle

2010-06-25 Thread Kevin E. Thorpe
Kevin E. Thorpe wrote: stefan.d...@gmail.com wrote: Hi, I am using Sweave to write an article. If I want to convert the *.rnw to a *.tex file I have to run Sweave which might take a long time. Is there away to get a tex-file as result without (evaluating) the R-chunks, i.e. the opposite of tangl

Re: [R] installing multicore package

2010-06-25 Thread Uwe Ligges
On 25.06.2010 06:39, suman dhara wrote: Sir, I want to apply mclapply() function for my analysis. So, I have to install multicore package. But I can not install the package. install.packages("multicore") It gives that package multicore is not available. Can you help me? If this is Windo

Re: [R] Sweave: The opposite of tangle

2010-06-25 Thread Kevin E. Thorpe
stefan.d...@gmail.com wrote: Hi, I am using Sweave to write an article. If I want to convert the *.rnw to a *.tex file I have to run Sweave which might take a long time. Is there away to get a tex-file as result without (evaluating) the R-chunks, i.e. the opposite of tangle (that just gives R-chu

Re: [R] Correctly plotting bar and scatter chart on 2-y axis plot with par(new=T)

2010-06-25 Thread Jim Lemon
On 06/25/2010 05:47 AM, dan.weavesham wrote: Hello, Thanks for the advice so far -- still struggling with it, I must admit. Here is some sample data, which I hope helps: # y axis #1 -- data for the bar chart -30353.382 -21693.519 -7049.923 -72968.722 -10267.584 -269432.795 -19847.670 -686

Re: [R] Euclidean Distance Matrix Analysis (EDMA) in R?

2010-06-25 Thread Joris Meys
I've been looking around myself, but I couldn't find any. Maybe somebody will chime in to direct you to the correct places. I also checked the papers, and it seems not too hard to implement. If I find some time, I'll take a look at it next week. For the other two gentlemen, check: http://www.geta

Re: [R] Finding sets

2010-06-25 Thread Dennis Murphy
Hi: Here's one approach: > x <- rep(c(1,2,1,3,5), each=5) > rle(x) Run Length Encoding lengths: int [1:5] 5 5 5 5 5 values : num [1:5] 1 2 1 3 5 > table(rle(x)$values) 1 2 3 5 2 1 1 1 > unname(table(rle(x)$values))[1] [1] 2 HTH, Dennis On Fri, Jun 25, 2010 at 2:30 AM, Muhammad Rahiz < muha

[R] Finding sets

2010-06-25 Thread Muhammad Rahiz
Hi all, I'd like to find how many sets of 1s there are in the following example; x <- rep(c(1,2,1,3,5), each=5) I know that there are two sets of 1s, visually. Any function in R that allows me to automate the process? Thanks. Muhammad __ R-help@

  1   2   >