Re: [R] Bootstrap or Wilcoxons' test?

2009-02-13 Thread David Winsemius
The Wilcoxon rank sum test is not "plain and simple a test equality of distributions". If it were such, it would be able to test for differences in variance when locations were similar. For that purpose it would, in point of fact, be useless. Compare these simple situations w.r.t. the WRS:

Re: [R] several "ifelse" problems...

2009-02-13 Thread Berwin A Turlach
Dear Kathie, On Fri, 13 Feb 2009 21:08:25 -0800 (PST) kathie wrote: > Dear R users, > [snip] > > However, even though the results show that y=8 for x=0.11, when > x=0.11, actual y value is -0.9. And, y=-0.8 for x=0.88. I cannot > understand the above results. It may help you to understand th

Re: [R] superscript

2009-02-13 Thread Daniel Moreira
Try: plot(1,1,xlab="ligth intensity (PAR)",ylab=expression("mass Pteridium rhizomes" (gr/0.25*m^2))) Daniel Moreira, MD Research Associate Duke University Medical Center DUMC 2626, MSRB-I Room 455 571 Research Drive Durham, North Carolina 27710 Telephone

[R] superscript

2009-02-13 Thread David Douterlungne
Dear R-users. I'm struggeling to fix the superscript of a label of a figure axis. For some reason R doesn't recognize the "hat" symbol. plot(1,1,xlab="ligth intensity (PAR)",ylab=expression("mass Pteridium rhizomes" (gr/0.25m^2))) A very similiar scriptline does not give any pro

Re: [R] Outlier Detection for timeseries

2009-02-13 Thread stephen sefick
what are you looking for? I am not familiar with SAS as I am a poor scientist. I am not promising anything, but if you were to tell me what you wanted - method etc. I may know of a package or something that would work. Stephen On Fri, Feb 13, 2009 at 9:16 PM, Pele wrote: > > Hello R users, > >

Re: [R] Bootstrap or Wilcoxons' test?

2009-02-13 Thread Daniel Malter
Hi Charlotta, to be more constructive toward your goal. If you bootstrap the regression when the regression is ill-specified, the bootstrap may not help you. Further, a test as "difficult" as a regression does not seem to be necessary in your case. A t-test if your dependent variable is (approxia

[R] several "ifelse" problems...

2009-02-13 Thread kathie
Dear R users, >From the code below, I try to compute "y" value. (In fact, y looks like a trapezoid) -- x <- seq(0,1,.01) y <- ifelse(abs(x-.5)<=0.3,0, ifelse(abs(w-.5)>=0.4,-1, ifelse((0.1 x [1] 0

Re: [R] Bootstrap or Wilcoxons' test?

2009-02-13 Thread Murray Cooper
First of all, sorry for my typing mistakes. Second, the WRS test is most certainly not a test for unequal medians. Although under specified models it would be. Just as under specified models it can be a test for other measures of location. Perhaps I did not word my explanation correctly, but I di

Re: [R] Bootstrap or Wilcoxons' test?

2009-02-13 Thread David Winsemius
I must disagree with both this general characterization of the Wilcoxon test and with the specific example offered. First, we ought to spell the author's correctly and then clarify that it is the Wilcoxon rank-sum test that is being considered. Next, the WRS test is a test for differences i

[R] Outlier Detection for timeseries

2009-02-13 Thread Pele
Hello R users, Can someone tell if there is a package in R that can do outlier detection that give outputs simiilar to what I got from SAS below. Many thanks in advance for any help! Outlier Details

Re: [R] question about tool collisions

2009-02-13 Thread Marc Schwartz
on 02/13/2009 06:05 PM Carl Witthoft wrote: > Recently I got introduced to two packages: {seewave} and {audio} . > Turns out they both have a tool to call a system audio tool, and in both > cases the name of the tool is play(). Naturally these two tools do > slightly different things with diffe

Re: [R] Bootstrap or Wilcoxons' test?

2009-02-13 Thread Murray Cooper
Charlotta, I'm not sure what you mean when you say simple linear regression. From your description you have two groups of people, for which you recorded contaminant concentration. Thus, I would think you would do something like a t-test to compare the mean concentration level. Where does the regr

Re: [R] question about tool collisions

2009-02-13 Thread Bert Gunter
See the "warn.conflicts" arguments of require() and library(). People thought about this a long time ago. -- Bert Gunter -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Carl Witthoft Sent: Friday, February 13, 2009 4:05 PM To: r-hel

Re: [R] second axis title orientation

2009-02-13 Thread Alexandre Swarowsky
?mtext On Sat, 2009-02-14 at 00:19 +0100, Jörg Groß wrote: > Hi, > > I have added a second y-axis via axis() to a plot. > Then I tried to add an y axis title. > > But the axis() function seems to have no argument like ylab. > > and if I add a title with title() the text is centered at the first

[R] question about tool collisions

2009-02-13 Thread Carl Witthoft
Recently I got introduced to two packages: {seewave} and {audio} . Turns out they both have a tool to call a system audio tool, and in both cases the name of the tool is play(). Naturally these two tools do slightly different things with different arguments. So, what should a user do, and

[R] PCA functions

2009-02-13 Thread glenn
Hi All, would appreciate an answer on this if you have a moment; Is there a function (before I try and write it !) that allows the input of a covariance or correlation matrix to calculate PCA, rather than the actual data as in princomp() Regards Glenn [[alternative HTML versio

Re: [R] second axis title orientation

2009-02-13 Thread Gabor Grothendieck
There is an example in: library(zoo) example(plot.zoo) See ?plot.zoo On Fri, Feb 13, 2009 at 6:19 PM, Jörg Groß wrote: > Hi, > > I have added a second y-axis via axis() to a plot. > Then I tried to add an y axis title. > > But the axis() function seems to have no argument like ylab. > > and if

[R] second axis title orientation

2009-02-13 Thread Jörg Groß
Hi, I have added a second y-axis via axis() to a plot. Then I tried to add an y axis title. But the axis() function seems to have no argument like ylab. and if I add a title with title() the text is centered at the first axis, not the second defined one. Is there a way to add an axis-title

Re: [R] error with make

2009-02-13 Thread Lana Schaffer
Peter, Isn't there a different form of cp that I can use? cp -p cp Lana -Original Message- From: Peter Dalgaard [mailto:p.dalga...@biostat.ku.dk] Sent: Friday, February 13, 2009 1:21 PM To: Lana Schaffer Cc: r-help@r-project.org Subject: Re: [R] error with make Lana Schaffer wrote: > Hi

Re: [R] Optimizing Multiple Models...any suggestions?

2009-02-13 Thread Paul Heinrich Dietrich
Hi Max, Thanks for the suggestion, that's exactly what I was looking for. Thanks again. Paul -- View this message in context: http://www.nabble.com/Optimizing-Multiple-Models...any-suggestions--tp21979556p22006494.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] help change auto.key colors in xyplot

2009-02-13 Thread hadley wickham
On Fri, Feb 13, 2009 at 1:22 PM, Dieter Menne wrote: > Dimitri Liakhovitski gmail.com> writes: > >> the code below works just fine to produce a dotplot. However, I am not >> successful changing the color of the lines in the legend (auto.key). >> If I add col=..., it only changes the color of the

Re: [R] help change auto.key colors in xyplot

2009-02-13 Thread Deepayan Sarkar
On Fri, Feb 13, 2009 at 11:22 AM, Dieter Menne wrote: > Dimitri Liakhovitski gmail.com> writes: > >> the code below works just fine to produce a dotplot. However, I am not >> successful changing the color of the lines in the legend (auto.key). >> If I add col=..., it only changes the color of the

Re: [R] error with make

2009-02-13 Thread Peter Dalgaard
Lana Schaffer wrote: Hi, I am trying to compile the R-dev version on a unix Suse machine and got errors. Would someone be able to help me determine what to do to fix these errors: . make[2]: Entering directory `/lustre/people/schaffer/R-devel/src/include' mkdir -p -- ../../include cp: get

Re: [R] I want axes that cross

2009-02-13 Thread Marc Schwartz
on 02/13/2009 02:19 PM Paul Johnson wrote: > On Fri, Feb 13, 2009 at 1:51 PM, Marc Schwartz > wrote: >> on 02/13/2009 01:25 PM Paul Johnson wrote: >>> Hello, everybody. >>> >>> A student asked me a howto question I can't answer. We want the >>> length of the drawn axes to fill the full width and

Re: [R] I want axes that cross

2009-02-13 Thread Daniel Moreira
Another alternative is: x <- rnorm(100) z <- gl(2,50) y <- rnorm(100, mean= 1.8*as.numeric(z)) plot(x,y,type="n", axes=F) points(x,y, pch="$",cex=0.7, col=z) axis(1, col="green", col.axis="green",xaxp=c(-6, 3, 9),xpd=T) axis(2, col="red", col.axis="red", yaxp=c(-6, 6, 12),xpd=T)

Re: [R] odfWeave & prettyR

2009-02-13 Thread Max Kuhn
>> The problem is that on the CRAN web site the XML package is not available for > windows... > > I just checked, and it is available for Windows from my mirror (Austria) > and from ETH (assuming you are CH). I would use XML ~ v1.90 for windows to use with odfWeave. You can get it at: http://cra

Re: [R] I want axes that cross

2009-02-13 Thread David Winsemius
I think you ought to worry a bit about who might be laughing at whom. You are asking for a plot with rather unnatural behavior and potentially very misleading to the audience. Here it is, but you bear full responsibility for any consequences: plot(x,y,type="n", axes=F, xlim=c(min(x)-1, max(

[R] error with make

2009-02-13 Thread Lana Schaffer
Hi, I am trying to compile the R-dev version on a unix Suse machine and got errors. Would someone be able to help me determine what to do to fix these errors: make[1]: Entering directory `/lustre/people/schaffer/R-devel/m4' make[1]: Nothing to be done for `R'. make[1]: Leaving directory `/lustre/

Re: [R] I want axes that cross

2009-02-13 Thread Charles C. Berry
On Fri, 13 Feb 2009, Paul Johnson wrote: On Fri, Feb 13, 2009 at 1:51 PM, Marc Schwartz wrote: on 02/13/2009 01:25 PM Paul Johnson wrote: Hello, everybody. A student asked me a howto question I can't answer. We want the length of the drawn axes to fill the full width and height of the plot,

Re: [R] I want axes that cross

2009-02-13 Thread Paul Johnson
On Fri, Feb 13, 2009 at 1:42 PM, Daniel Moreira wrote: > > Try defining the argument 'pos' in the axis command-line, like: > > x <- rnorm(100) > z <- gl(2,50) > y <- rnorm(100, mean= 1.8*as.numeric(z)) > > plot(x,y,type="n", axes=F) > points(x,y, pch="$",cex=0.7, col=z) > axis(1, col="green", col.

Re: [R] I want axes that cross

2009-02-13 Thread Paul Johnson
On Fri, Feb 13, 2009 at 1:51 PM, Marc Schwartz wrote: > on 02/13/2009 01:25 PM Paul Johnson wrote: >> Hello, everybody. >> >> A student asked me a howto question I can't answer. We want the >> length of the drawn axes to fill the full width and height of the >> plot, like so: > Paul, > > I am gu

Re: [R] equivalent to SAS genmod code in R?

2009-02-13 Thread Peter Dalgaard
Nicole Schneider wrote: Hello, I have to run a general linear mixed model which looks at 2 dependent variables at the same time (var1 divided by var2). I have tryed to search for such a kind of model structure but since I just started using R my search was not successful. Especielly since I only

Re: [R] Add columns to data frame automatically

2009-02-13 Thread jim holtman
Something like this might work where you are using 'lapply' to create a list of values from the equivalent of the 'for' loop that you had. You can then 'cbind' them to create a return matrix, or you can convert it to a dataframe: prep <- function() { # Clase[1]/Categoria[2]/Phi[3]/Rf[4] peso <-

Re: [R] I want axes that cross

2009-02-13 Thread Marc Schwartz
on 02/13/2009 01:25 PM Paul Johnson wrote: > Hello, everybody. > > A student asked me a howto question I can't answer. We want the > length of the drawn axes to fill the full width and height of the > plot, like so: > >| >| * >| * >| * > ---|

Re: [R] I want axes that cross

2009-02-13 Thread Daniel Moreira
Try defining the argument 'pos' in the axis command-line, like: x <- rnorm(100) z <- gl(2,50) y <- rnorm(100, mean= 1.8*as.numeric(z)) plot(x,y,type="n", axes=F) points(x,y, pch="$",cex=0.7, col=z) axis(1, col="green", col.axis="green", pos=0) axis(2, col="red", col.axis="red", pos=-2) _

[R] I want axes that cross

2009-02-13 Thread Paul Johnson
Hello, everybody. A student asked me a howto question I can't answer. We want the length of the drawn axes to fill the full width and height of the plot, like so: | | * | * | * ---|- However, when we use plot with axes=F and then use the axis co

Re: [R] help change auto.key colors in xyplot

2009-02-13 Thread Dieter Menne
Dimitri Liakhovitski gmail.com> writes: > the code below works just fine to produce a dotplot. However, I am not > successful changing the color of the lines in the legend (auto.key). > If I add col=..., it only changes the color of the letters in the > legend, but not the color of the lines. I

[R] Add columns to data frame automatically

2009-02-13 Thread Jesús Guillermo Andrade
Hello fellows: I've een trying to set up a function that performs 100 loops producing the coresponding 100 series. I want to save all those datasets in a dataframe, so I wrote this... prep <- function() # Clase[1]/Categoria[2]/Phi[3]/Rf[4] peso <- c(.0,.03,.3,.6) # Extension del calculo

[R] help with reshaping (no file attached)

2009-02-13 Thread Amit Patel
MCI A1 A2 A13 A14 A23 A24 A33 A34 Grouped together 56766 N/A N/A N/A N/A N/A N/A N/A N/A N/A 6459 N/A N

[R] help with reshaping

2009-02-13 Thread Amit Patel
hi Im having some problems reshaping Ive managed to apply it but have some problems the attached document will explain any help is appreciated __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the po

[R] weighted-ML estimates

2009-02-13 Thread H c
Hi, We are trying to calculate ML-parameter estimates of a mixed effects models where the observations are weighted. The "weights" option in lmer() with RELM=FALSE seems attractive. Does anyone know the mechanism it uses to calculate weighted ML estimates? (Is there a paper?). Also, our model i

Re: [R] how to obtain p values from an ANOVA result

2009-02-13 Thread Greg Snow
It depends on what type of model "model" is. In some cases you can do something like anova(model, test='Chisq') See the appropriate help to find out the options, but note that if the p-values are not provided by default, it could be because there is doubt about the accuracy of the approximation

Re: [R] how to obtain p values from an ANOVA result

2009-02-13 Thread Phil Spector
Richie - There is a test= argument that can be set to "Chisq", "F" or "Cp", for various different tests. See the help file for anova.glm for details (or look at anova.xxx if your model is of class "xxx"). - Phil On Fri, 13 Feb 2009, R User R

Re: [R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Dimitri Liakhovitski
Both Greg and Marc - thank you so much! It helped a lot. What I just discovered also works (similar to Greg's suggestions) is to make it first a character and THEN to do: as.factor(as.numeric(original character vector))). Wow! R never stops surprizing one - and I am just in the beginning of the j

Re: [R] SAS Institute Adding Support for R

2009-02-13 Thread Gerard Smits
It seems that SAS is willing to offer this interface if you are willing to purchase one of their expensive add-on packages. Not surprising. Gerard Smits [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.e

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-13 Thread Gabor Grothendieck
That is very nice. Maybe just one slight improvement so to express it in a non-destructive form: replace(mat, t(apply(mat,1,duplicated)), NA) On Fri, Feb 13, 2009 at 12:58 PM, Stavros Macrakis wrote: > (typos corrected) > > Combining the various approaches on the list, here's a simple > on

[R] how to obtain p values from an ANOVA result

2009-02-13 Thread R User R User
Hi all, I'm tryint to turn my ANOVA result from anova(model) in to p values. The default output is: term ; Df ; Deviance ; resid Df; Resid. Dev Is there a way to add p values to this output so the significance of the terms can be easily determined? Thanks in advance. Richie [[alternativ

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-13 Thread davidr
Jason, Just to answer your direct question, there is Mathowrld.wolfram.com, where there are 87 continuous distributions listed. I have also used the book Statistical Distributions, 2nd ed, Merran Evans, et al. which has most of the usual distributions with pictures and relationships. Of course al

Re: [R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Marc Schwartz
on 02/13/2009 11:38 AM Dimitri Liakhovitski wrote: > On Fri, Feb 13, 2009 at 12:24 PM, Marc Schwartz > wrote: >> on 02/13/2009 11:09 AM Dimitri Liakhovitski wrote: >>> Hello! I have encountered a really weird problem. Maybe you've >>> encountered it before? >>> I have a large data frame "importanc

[R] npindex: specifying manual bandwiths

2009-02-13 Thread Greenerpole
Dear R-users, I am very enthusiastic about the capacities offered by the np package and pretty fond of it. Nevertheless, trying to estimate Ichimura and Klein and Spady models on my data, I would like to be able to provide the npindex function with my guesses for the bandwidth (eventually compu

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-13 Thread Stavros Macrakis
(typos corrected) Combining the various approaches on the list, here's a simple one-liner that puts the NAs at the end: t(apply(mat,1,function(r) { dr<-duplicated(r); c( r[!dr], rep(NA,sum(dr)) ) })) If you don't care where the NAs are, the following is a tad shorter and perhaps clearer:

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Wacek Kusnierczyk
Berwin A Turlach wrote: > G'day Stavros, > > On Fri, 13 Feb 2009 11:11:28 -0500 > Stavros Macrakis wrote: > > >> On Fri, Feb 13, 2009 at 10:47 AM, Gabor Grothendieck >> wrote: >> >>> See ?get and try: >>> >> Interesting. I hadn't paid attention to the 'mode' argument before. >> >>

Re: [R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Greg Snow
It comes down to 2 simple rules: 1. If you don't care about the order of the factor levels, then it doesn't matter how R codes the relationship 2. If you do care about the order, then tell R what order you want. Consider the following: > x <- c(9,3,15,9,15,9,3) > factor(x) [1] 9 3 15 9 15

Re: [R] Hollander's test of bivariate symmetry

2009-02-13 Thread David Winsemius
Perhaps you could look at the coin package's symmetry tests and see if they satisfy: http://finzi.psych.upenn.edu/R/library/coin/html/SymmetryTests.html -- David Winsemius On Feb 11, 2009, at 11:26 AM, joseph.g.bo...@gsk.com wrote: Does anyone know if any R package has a function that will

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > On Fri, Feb 13, 2009 at 12:25 PM, Berwin A Turlach > wrote: > >> On Fri, 13 Feb 2009 11:11:28 -0500 >> Stavros Macrakis wrote: >> >>> Where would it be advisable to use anything but mode='any' or >>> mode='function'? >>> >> I guess the answer to this quest

Re: [R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Dimitri Liakhovitski
Sorry - one clarification: When I run: > test$xx - the what I am currently seeing is: [1] 9 3 15 Levels: 3 9 15 But what I am expecting to be seeing is: [1] 9 3 15 Levels: 9 3 15 Or maybe: Levels: 2 1 3 On Fri, Feb 13, 2009 at 12:38 PM, Dimitri Liakhovitski wrote: > On Fri, Feb 13, 2009

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Stavros Macrakis
On Fri, Feb 13, 2009 at 12:25 PM, Berwin A Turlach wrote: > On Fri, 13 Feb 2009 11:11:28 -0500 > Stavros Macrakis wrote: >> Where would it be advisable to use anything but mode='any' or >> mode='function'? > > I guess the answer to this question is more often than not in the source. :) ... > The

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-13 Thread Stavros Macrakis
Combining the various approaches on the list, here's a simple one-liner that puts the NAs at the end: t(apply(mat,1,function(r) { dr<-duplicated(r); c( r[!dr], rep(NA,sum(dr)) ) )) If you don't care where the NAs are, the following is a tad shorter and perhaps clearer: mat[ t(apply(mat

[R] problem with mediation

2009-02-13 Thread Analisi Dati
Dear friends, i've a little problem with a study about mediation. I will call my dependent variable "Y", the independent "X" and "Z" will be my mediator variable... Using a linear regression, i can say that there isn't a direct effect of X on Y because the coefficient of X isn't significative

Re: [R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Dimitri Liakhovitski
On Fri, Feb 13, 2009 at 12:24 PM, Marc Schwartz wrote: > on 02/13/2009 11:09 AM Dimitri Liakhovitski wrote: >> Hello! I have encountered a really weird problem. Maybe you've >> encountered it before? >> I have a large data frame "importances". It has one factor ($A) with 3 >> levels: 3, 9, and 15.

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Berwin A Turlach
G'day Stavros, On Fri, 13 Feb 2009 11:11:28 -0500 Stavros Macrakis wrote: > On Fri, Feb 13, 2009 at 10:47 AM, Gabor Grothendieck > wrote: > > See ?get and try: > > Interesting. I hadn't paid attention to the 'mode' argument before. > > Where would it be advisable to use anything but mode='an

Re: [R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Marc Schwartz
on 02/13/2009 11:09 AM Dimitri Liakhovitski wrote: > Hello! I have encountered a really weird problem. Maybe you've > encountered it before? > I have a large data frame "importances". It has one factor ($A) with 3 > levels: 3, 9, and 15. $B is a regular numeric variable. > Below I am picking a real

Re: [R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread jim holtman
Think of the levels as a table you are going to index into. The factors that you see (2, 1, 3) are the indices into the levels so you get 9, 3, 15 as the result. What were you expecting? It is working as it is supposed to. On Fri, Feb 13, 2009 at 12:09 PM, Dimitri Liakhovitski wrote: > Hello!

[R] need help with errors in betareg analysis

2009-02-13 Thread knussear
Hi I'm trying to fit a model in betareg and I'm getting errors, but have no idea what they mean or how to solve them. Does anyone have experience with this? > model <- betareg(ACT ~ ST*SoilT, data = actDL_F) Warning messages: 1: In sqrt(W) : NaNs produced 2: In sqrt(W) : NaNs produced 3: In sqrt

Re: [R] odfWeave & prettyR

2009-02-13 Thread Dieter Menne
lauramorgana bluewin.ch bluewin.ch> writes: > > Hello, > I've been trying to use odfWeave and prettyR packages to create documents with both text and graphs, but so far I haven't been very lucky... ... > library(odfWeave) I get this message: > > Loading: XML > Error: package 'XML' not loaded

[R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Dimitri Liakhovitski
Hello! I have encountered a really weird problem. Maybe you've encountered it before? I have a large data frame "importances". It has one factor ($A) with 3 levels: 3, 9, and 15. $B is a regular numeric variable. Below I am picking a really small sub-frame (just 3 rows) based on "indices". "indices

Re: [R] loading mgcv package

2009-02-13 Thread Simon Wood
Have you created an object called .Random.seed? The error looks to be triggered by the mgcv startup code calling the RNG via `runif', and the RNG finding something unexpected in .Random.seed. (See ?.Random.seed for more information). best, Simon On Friday 13 February 2009 16:25, Veerappa Ch

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > On Fri, Feb 13, 2009 at 10:47 AM, Gabor Grothendieck > wrote: > >> See ?get and try: >> > > Interesting. I hadn't paid attention to the 'mode' argument before. > > Where would it be advisable to use anything but mode='any' or mode='function'? > > don't know i

Re: [R] Problems with Histogram

2009-02-13 Thread Patrick Burns
One possibility is something along the lines of: plot(density(bootstraps)) abline(v=original.value) Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of "The R Inferno" and "A Guide for the Unwilling S User") TomPoes wrote: Hello Currently i'm working o

Re: [R] analogue to "lines" commant in "plot" when using boxplot

2009-02-13 Thread David Winsemius
No example and I find the specification unclear, but perhaps you can follow the steps outlined in this earlier posting to get closer what you want. or, as always, provide a base example and description of what is needed. http://finzi.psych.upenn.edu/R/Rhelp08/archive/154176.html -

[R] loading mgcv package

2009-02-13 Thread Veerappa Chetty
Hi ,When I try to load the 'mgcv" package, often, but not always, get this error message. What am I doing wrong? __ This is mgcv 1.4-1.1 Error in runif(1) : .Random.seed is not an integer vector but of type 'list' Error : .onAttach failed in 'attachNamespace' Error: package/namesp

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-13 Thread Greg Snow
Why do you care what distribution your data comes from? That is a serious question, the more we know about what your actual question/goal is, the more we can help. It is a common mistake for people who know enough statistics to be dangerous to focus on the distribution of the data rather than

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Stavros Macrakis
On Fri, Feb 13, 2009 at 10:47 AM, Gabor Grothendieck wrote: > See ?get and try: Interesting. I hadn't paid attention to the 'mode' argument before. Where would it be advisable to use anything but mode='any' or mode='function'? -s __ R-help@r

Re: [R] select on letter

2009-02-13 Thread David Winsemius
You really should not assign a new value to "letters" since it is a very useful constant vector that allows working with lowercase letters. Notice that Domitris did not copy your code exactly. Next time you start R type letters at the R prompt. You cannot do so now, since you overwrote that

Re: [R] Problem with loading rJava in R

2009-02-13 Thread charis
Thank you everyone for the help. Dieter's advice resolved the issue. charis Dieter Menne wrote: > > charis kaskiris.com> writes: > >> >> >> Thank you for helping. >> >> I am running the 32-bit version of R on a 64-bit Windows XP machine. >> After >> reinstalling the rJava package I starte

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Gabor Grothendieck
See ?get and try: sin <- 1 get("sin", mode = "numeric") get("sin", mode = "function") On Fri, Feb 13, 2009 at 10:20 AM, wrote: > guRus: > > I have a variable "beta" as an argument to R's beta function. So > essentially I have a case of beta(alpha, beta). What surprises me is that > R doesn't

[R] lists on a script

2009-02-13 Thread diego Diego
Dear R experts, I have a problem with a function I wrote. The fuction looks like this: series<-function(x,s){ foo<-list(); ind3<-integer(); for (j in diff){ for (i in 1:(n-12)){ if (!(x[i,j]==0)&!(x[i+1,j]==0)&!(x[i+2,j]==0)&!(x[i+3,j]==0)&!(x[i+4,j]==0)&!(x[i+5,j]==0)&!(x[i+6,j]==0) &!(x[i+

Re: [R] Write and Load functions from an external file

2009-02-13 Thread Uwe Ligges
Moumita Das wrote: Hi All, Would be grateful,if anyone can answer my queries. I need to share code. For example, if I am working in C/C++, I would put some function declarations in .h files that you would include. In PHP, I would create files with the common functions in them and then "inc

[R] odfWeave & prettyR

2009-02-13 Thread lauramorg...@bluewin.ch
Hello, I've been trying to use odfWeave and prettyR packages to create documents with both text and graphs, but so far I haven't been very lucky... With the function R2html () in prettyR package, when I try to use a source file, which works perfectly if I run it directly form R using "source("f

[R] Problems with Histogram

2009-02-13 Thread TomPoes
Hello Currently i'm working on a paper for my study and, on advice of my tutor, i'm using R. But now i'm stuck on something. I've used the bootstrap method to determine if a found value was significant. Lets say this found value is x, the collection of random samples is y (n=1e+06) I've compare

Re: [R] select on letter

2009-02-13 Thread Dimitris Rizopoulos
one way is: index <- c(1, 2, 3) let <- c("CCTTGGAA", "NNTTGGAAT", "AACCTTNN") z <- data.frame(index, let) index[-grep("N", let)] # or z[-grep("N", let), ] I hope it helps. Best, Dimitris naomi.duijveste...@ipg.nl wrote: Hi, I was wondering if anybody can help me. In the small data set bel

Re: [R] copy directory command

2009-02-13 Thread Tony Breyal
Hi Tim, This is what i usually try and do (see ?file.copy) ## R Start... > src.dir <- 'PFO-SBS001\\Redirected\\tonyb\\Desktop\\folderA\\' > dest.dir <- 'PFO-SBS001\\Redirected\\tonyb\\Desktop\\folderB\\' > > file.names <- dir(src.dir) > sapply(file.names, function(x) { +

[R] equivalent to SAS genmod code in R?

2009-02-13 Thread Nicole Schneider
Hello, I have to run a general linear mixed model which looks at 2 dependent variables at the same time (var1 divided by var2). I have tryed to search for such a kind of model structure but since I just started using R my search was not successful. Especielly since I only have an old SAS GENMOD co

[R] Distinguishing variables from functions with the same name

2009-02-13 Thread JLucke
guRus: I have a variable "beta" as an argument to R's beta function. So essentially I have a case of beta(alpha, beta). What surprises me is that R doesn't barf on this stupid programming practice. R gets the right answer. How does R know "beta the variable" from "beta the function"? Josep

[R] select on letter

2009-02-13 Thread naomi . duijvesteijn
Hi, I was wondering if anybody can help me. In the small data set below I would like to select the index which doesn't contain the letter 'N' in the variable 'letters'. How can I discard these rows when the letter has a different position everytime (but the same letter for the whole column)? i

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-13 Thread David Winsemius
This is probably the right time to issue a warning about the error of making transformations on the dependent variable before doing your analysis. The classic error that newcomers to statistics commit is to decide that they want to "make their data normal". The assumptions of most regressio

Re: [R] copy directory command

2009-02-13 Thread Prof Brian Ripley
On Fri, 13 Feb 2009, Tim Smith wrote: I was trying to copy a directory from one location to another. Is there a command to do this (similar to the file.copy command)? file.copy() does this in the development version of R. Most people use system(paste("cp -r", from, to)) in earlier versi

[R] Write and Load functions from an external file

2009-02-13 Thread Moumita Das
Hi All, Would be grateful,if anyone can answer my queries. I need to share code. For example, if I am working in C/C++, I would put some function declarations in .h files that you would include. In PHP, I would create files with the common functions in them and then "include()" them. So far, I

Re: [R] directory manipulation

2009-02-13 Thread Uwe Ligges
Tim Smith wrote: Hi all, I was trying to copy a directory from one location to another. Is there a command (similar to file copy command) that will let me do this? I suggest to make a system() (or shell, if you are under Windows) call to the OS in order to copy recursively. Uwe Ligges

[R] R crashes when using the RODBC Package

2009-02-13 Thread Bill Cunliffe
Hi, I’ve written some code that fetches data from an Access Database (2003), processes the data, then saves the modified data back into a table in the Access database. It works if I only pass through the code once, but if I put a loop around the code so that I fetch data from a different source t

Re: [R] Looping multiple output values to dataframe

2009-02-13 Thread David Winsemius
?list files ... in particular the pattern argument -- David Winsemius On Feb 12, 2009, at 3:38 PM, Stropharia wrote: Thanks a lot Levi. Your code was much shorter and more elegant. With a few minor alterations I got this (see below) to work. Does anyone know if there is a way to automa

Re: [R] variable values

2009-02-13 Thread David Winsemius
Step 1: Read the R-FAQ 7.31: Step 2: Ask yourself whether it is likely that such a small value can be sensibly distinguished from zero using a program that stores values in double precision. Step 3: Consider alternate methods, perhaps logarithms or programs that are equipped to deal with

[R] Difference MNP-package and rmnpGibbs from bayesm-package

2009-02-13 Thread Tryntsje Wesselius
Hi all, For my research I have to use a Multinomial Probit model. I saw that there are two packages, that include a method to estimate my parameters. The first one is the MNP-package of Imai and van Dyk. The second one is part of the bayesm-package of Rossi. The results for both packages are not t

Re: [R] summary of a list

2009-02-13 Thread lauramorg...@bluewin.ch
Thank you a lot!!! That was fantastic! It worked perfectly!!! Laura Hi Laura, try using the functions try() and inherits() to "catch" any errors in the loop: summaryList <- list() for (i in 1:35) { tempSummary <- try(summary(resultList[[i]]), silent = TRUE) if (inherits(tempSummary, "tr

Re: [R] Aggregrate function

2009-02-13 Thread Monica Pisica
Hi again, Thanks a lot for all the suggestions. It will take me a little bit to wrap my head around to understand what is what, though! This will help me quite a bit. One difference in the result output between you're solution and Mark's solution is this: loc sp tot L1L1 b 60 L2.5

[R] Making plot with "sub"-X values

2009-02-13 Thread joe1985
Hello I have a big dataset where i have pulled out some periods of time acording to a herd-number (see below): CHR_NR DATO_TEST SALMO_INDEX didiffdatoperiode 113772003-06-20 7.929 113772003-09-01 4.359 113772004-02-24 5

Re: [R] Efficent way to create an nxn upper triangular matrix of one's

2009-02-13 Thread David Winsemius
The other solutions offered are perfectly workable. Here is a strategy that is generalizable to other matrix designs (and on checking the source of upper.tri and lower.tri, it's not surprising that they use precisely the same strategy): n <- 9 dm <- matrix(0, nrow=n, ncol=n) dm[col(dm) >=

[R] directory manipulation

2009-02-13 Thread Tim Smith
Hi all, I was trying to copy a directory from one location to another. Is there a command (similar to file copy command) that will let me do this? thanks. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

[R] copy directory command

2009-02-13 Thread Tim Smith
Hi, I was trying to copy a directory from one location to another. Is there a command to do this (similar to the file.copy command)? thanks! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-13 Thread Gabor Grothendieck
You might also want to look at the idealized situation: library(playwith) library(sn) playwith(qqnorm(qsn(1:99/100, shape = shape)), parameters = list(shape = seq(-3, 3, .1))) On Fri, Feb 13, 2009 at 6:43 AM, Gabor Grothendieck wrote: > You can readily create a dynamic display for using

  1   2   >