Re: [R] Calculate the angles for a point dataset?

2007-09-13 Thread Rolf Turner
On 14/09/2007, at 3:41 PM, zhijie zhang wrote: > Dear Rusers, > I'd like to take the cases of cancer of the larynx in chorley > (spatstat) to > explain my question. > I want to join the points of cancer of the larynx with the disused > industrial incinerator to generate lines, and then calcu

Re: [R] Export Step Function Coefficients to Spreadsheet or Text File

2007-09-13 Thread Eric R
Thanks, this works great! --Eric D L McArthur wrote: > > Eric R juno.com> writes: >>... I want to export the coefficients to a spreadsheet > > names(w) > write.csv (w$coefficients, file=...) > > -- D L McArthur, UCLA Sch of Medicine, dmca ucla.edu > > _

[R] Calculate the angles for a point dataset?

2007-09-13 Thread zhijie zhang
Dear Rusers, I'd like to take the cases of cancer of the larynx in chorley(spatstat) to explain my question. I want to join the points of cancer of the larynx with the disused industrial incinerator to generate lines, and then calculate the angles of these line comparing the horizontal line?

Re: [R] statistics - hypothesis testing question

2007-09-13 Thread S Ellison
I may be miles off base, but could this be treated as a random-effects model, with the regression predictors as random effects grouped by week? And if so, could each set form a single lme() model, allowing you to compare the models via AIC's for 'quality' and anova for significance of the differ

Re: [R] Looking for instructions for several questions with R

2007-09-13 Thread Duncan Murdoch
On 13/09/2007 6:26 PM, Zheng Lu wrote: > Dear all: > > when I add legend into the upper right concer of the plot region, it > always has a square region in which the text is, how to get rid of that > square region, I just want pure text. Use bty="n" in the call to legend. > For the log-scale o

Re: [R] grouping data by a portion of the row name

2007-09-13 Thread Peter Dalgaard
Bricklemyer, Ross S wrote: > I am attempting to write a routine where I can run PAM (partition around > mediods) on a dataset containing multiple soil cores and PCA spectral data > from several depths per core. I want to run PAM on each individual core, so > I need to group the data by core to

Re: [R] Export Step Function Coefficients to Spreadsheet or Text File

2007-09-13 Thread D L McArthur
Eric R juno.com> writes: >... I want to export the coefficients to a spreadsheet names(w) write.csv (w$coefficients, file=...) -- D L McArthur, UCLA Sch of Medicine, dmca ucla.edu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

[R] grouping data by a portion of the row name

2007-09-13 Thread Bricklemyer, Ross S
I am attempting to write a routine where I can run PAM (partition around mediods) on a dataset containing multiple soil cores and PCA spectral data from several depths per core. I want to run PAM on each individual core, so I need to group the data by core to run the analysis. Below is an exam

[R] Looking for instructions for several questions with R

2007-09-13 Thread Zheng Lu
Dear all: when I add legend into the upper right concer of the plot region, it always has a square region in which the text is, how to get rid of that square region, I just want pure text. For the log-scale on y axis, they appear as 1e-02, 1e+00 and 1e+02, how to change to 0.01, 1, 100. how t

Re: [R] Subset Quirk?

2007-09-13 Thread Peter Dalgaard
VTLT1999 wrote: > Hello All, > > I am trying to subset a matrix using subset() and it works fine when I use > matrix notation, but doesn't work when I use established column names. > Sample code is below: > > library(mvtnorm) > library(sm) > library(ltm) > library(irtoys) > > k<- 100 > set.seed(27

Re: [R] minimize white space around lattice plot

2007-09-13 Thread Deepayan Sarkar
On 9/13/07, Sebastian Weber <[EMAIL PROTECTED]> wrote: > Dear list, > > I'm trying to produce a plot via xyplot with minimal sourounding white > space. However, I cannot find the options in xyplot, ps.options or > wherever which prevents lattice from drawing quite some white space > around my plot.

[R] Subset Quirk?

2007-09-13 Thread VTLT1999
Hello All, I am trying to subset a matrix using subset() and it works fine when I use matrix notation, but doesn't work when I use established column names. Sample code is below: library(mvtnorm) library(sm) library(ltm) library(irtoys) k<- 100 set.seed(271828) t <- rmvnorm(n=k,mean=c(-1,0,1),

[R] Export Step Function Coefficients to Spreadsheet or Text File

2007-09-13 Thread Eric R
Hello, After I use the lm() function to perform a multiple linear regression, and then use the step function to eliminate variables that predict the weakest, I need to export the final equation to a spreadsheet or a text file. Below is some sample code. In the end I want to export the coefficien

Re: [R] statistics - hypothesis testing question

2007-09-13 Thread Charles C. Berry
On Thu, 13 Sep 2007, Leeds, Mark (IED) wrote: > you're right Duncan. My bad. That was kind of dopey because R squared is > a statistic in itself. They aren't nested models because > the two predictors are different and there are no other predictors. I'm > trying to see whether the model B predi

Re: [R] Collapsing data frame; aggregate() or better function?

2007-09-13 Thread jim holtman
The second argument for aggregate is supposed to be a list, so try (notice the missing comma before "1:8"): test <- aggregate(lf1.turbot[,c(11, 12, 17:217)], lf1.turbot[1:8],sum) On 9/13/07, Tobin, Jared <[EMAIL PROTECTED]> wrote: > Hello r-help, > > I am trying to collapse or aggregate 'some' o

Re: [R] help with unit indication when plotting

2007-09-13 Thread Zheng Lu
Thank you very much! Teachers. one more curiosity is if there is a similar good way to this thing in S-PLUS? I am thinking to compare these two softwares on several functions. I appreciate. Lu Quoting Katharine Mullen <[EMAIL PROTECTED]>: > see ?plotmath > > you want to use "mu" for micro, a

Re: [R] Origin label in lattice

2007-09-13 Thread Deepayan Sarkar
On 9/13/07, Andrew Smith <[EMAIL PROTECTED]> wrote: > I would like to make what seems like a simple addition to a display > constructed from a call to levelplot -- I want to add a text label > (which will, in general, depend on the object being plotted, and so > cannot be hardcoded) to the origin,

Re: [R] [OOPS] beginner's questions ... sorry

2007-09-13 Thread Ted Harding
OOPS!! When I wrote "use readline()" below, I meant use readLInes() Sorry! For more information see ?readLines Ted. On 13-Sep-07 20:32:37, Ted Harding wrote: > On 13-Sep-07 20:06:35, Maura E Monville wrote: >> I have 316 files. Each file represents a patient's breathing >> track (respiratory

Re: [R] beginner's questions ... sorry

2007-09-13 Thread Ted Harding
On 13-Sep-07 20:06:35, Maura E Monville wrote: > I have 316 files. Each file represents a patient's breathing > track (respiratory signal recorded for a variable number of > cycles). > All files have the same are made up of a header followed by > a variable number of records. > Each record contains

Re: [R] beginner's questions ... sorry

2007-09-13 Thread Daniel Lakeland
On Thu, Sep 13, 2007 at 03:06:35PM -0500, Maura E Monville wrote: > I have 316 files. Each file represents a patient's breathing track > (respiratory signal recorded for a variable number of cycles). All files > have the same are made up of a header followed by a variable number of > records. You

Re: [R] statistics - hypothesis testing question

2007-09-13 Thread John Sorkin
Mark, Estimates of R values can be compared using Fishers r to z transform. Perhaps this will do what you wish to do. John John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of

[R] Collapsing data frame; aggregate() or better function?

2007-09-13 Thread Tobin, Jared
Hello r-help, I am trying to collapse or aggregate 'some' of a data frame. A very simplified version of my data frame looks like: > tester trip set num sex lfs1 lfs2 1 313 15 5 M23 2 313 15 3 F12 3 313 17 1 M01 4 313 17 2 F11 5 313 17

[R] beginner's questions ... sorry

2007-09-13 Thread Maura E Monville
I have 316 files. Each file represents a patient's breathing track (respiratory signal recorded for a variable number of cycles). All files have the same are made up of a header followed by a variable number of records. Each record contains 7 comma separated fields. The patient ID is recorder in th

[R] minimize white space around lattice plot

2007-09-13 Thread Sebastian Weber
Dear list, I'm trying to produce a plot via xyplot with minimal sourounding white space. However, I cannot find the options in xyplot, ps.options or wherever which prevents lattice from drawing quite some white space around my plot. However, this is quite a problem for me as I want to produce an i

Re: [R] help with unit indication when plotting

2007-09-13 Thread Greg Snow
Look at ?plotmath, could you use a greek mu for the micro part? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Zheng Lu > Sent:

Re: [R] help with unit indication when plotting

2007-09-13 Thread Duncan Murdoch
On 9/13/2007 2:47 PM, Zheng Lu wrote: > Dear all: > > Is there any one could tell me how I can represent Micro-molar as an > unit of concentration when I plot with R(S-plus), I don't want write > 'uM' from keyboard, I am thinking to write it like in word, in word, > people insert symbol for 'u'

Re: [R] help with unit indication when plotting

2007-09-13 Thread Katharine Mullen
see ?plotmath you want to use "mu" for micro, as in plot(1:10, ylab = expression(paste(mu, "M"))) On Thu, 13 Sep 2007, Zheng Lu wrote: > Dear all: > > Is there any one could tell me how I can represent Micro-molar as an > unit of concentration when I plot with R(S-plus), I don't want write > 'uM

Re: [R] Number -> Fraction

2007-09-13 Thread Alberto Monteiro
Ravi Varadhan wrote: > > Finding sufficiently accurate rational approximations to a real > number, can be done using fractions() in MASS, which uses > continued fractions. > In a slight off-topic digression, I recently learned that any irrational number that can be nicely approximated by rational

Re: [R] statistics - hypothesis testing question

2007-09-13 Thread Greg Snow
Is the data paired? i.e. do you have an A and a B from week 1, then the same for each following week? If so, then you could probably do a simple sign test, within each week see if rsquared B > rsquared A. under the null hypothesis that A and B are equivalent this should be a binomial with paramet

Re: [R] How to delete a duplicate observation

2007-09-13 Thread Sundar Dorai-Raj
nuyaying said the following on 9/13/2007 9:50 AM: > > I have a data set with 3 variables V1, V2, V3. If there are 2 data points > have the same values on both V1 and V2, I want to delete one of them which > has smaller V3 value.i.e., in the data below, I want to delete > the first observa

Re: [R] How to delete a duplicate observation

2007-09-13 Thread jim holtman
Here a way of doing it: > x <- cbind(V1=sample(1:3,20,TRUE), V2=sample(1:3,20,TRUE), V3=sample(20)) > x V1 V2 V3 [1,] 2 2 1 [2,] 1 2 6 [3,] 3 2 10 [4,] 3 1 11 [5,] 3 2 5 [6,] 3 2 7 [7,] 2 1 19 [8,] 3 3 13 [9,] 1 3 2 [10,] 3 3 20 [11,] 3 3 18 [12,] 2 1 4

Re: [R] How to delete a duplicate observation

2007-09-13 Thread Greg Snow
How about (assuming the data is in the data frame my.df): > my.df2 <- my.df[order(my.df$V3, decreasing=TRUE),] > my.df3 <- my.df2[ !duplicated( my.df2[,c('V1','V2')] ), ] If order of the rows matters then we will need to add a couple of steps to reorder. You did not say what to do if 3 or more p

[R] help with unit indication when plotting

2007-09-13 Thread Zheng Lu
Dear all: Is there any one could tell me how I can represent Micro-molar as an unit of concentration when I plot with R(S-plus), I don't want write 'uM' from keyboard, I am thinking to write it like in word, in word, people insert symbol for 'u' for uM. Am I clear? Thank you very much for your

Re: [R] statistics - hypothesis testing question

2007-09-13 Thread Leeds, Mark (IED)
you're right Duncan. My bad. That was kind of dopey because R squared is a statistic in itself. They aren't nested models because the two predictors are different and there are no other predictors. I'm trying to see whether the model B predictor is "better" than the Model A predictor. I guess h

Re: [R] loop function

2007-09-13 Thread Peter Dalgaard
Alfredo Alessandrini wrote: > Hi, > > If I have this values: > > 21 > 23 > 14 > 58 > 26 > > > How can I sum the values by a progression like this: > > (21) > (21 + 23) > (21 + 23 + 14) > (21 + 23 + 14 + 58) > (21 + 23 + 14 + 58 + 26) > (21 + 23 + 14 + 58 + 26) > > I've try with the functio

Re: [R] loop function

2007-09-13 Thread jim holtman
Is this what you want: > x [1] 21 23 14 58 26 > cumsum(x) [1] 21 44 58 116 142 On 9/13/07, Alfredo Alessandrini <[EMAIL PROTECTED]> wrote: > Hi, > > If I have this values: > > 21 > 23 > 14 > 58 > 26 > > > How can I sum the values by a progression like this: > > (21) > (21 + 23) > (21 + 2

Re: [R] statistics - hypothesis testing question

2007-09-13 Thread Duncan Murdoch
On 9/13/2007 2:18 PM, Leeds, Mark (IED) wrote: > I estimate two competing simple regression models, A and B where the LHS > is the same in both cases but the predictor is different ( > I handle the intercept issue based on other postings I have seen ). I > estimate the two models on a weekly basis

[R] loop function

2007-09-13 Thread Alfredo Alessandrini
Hi, If I have this values: 21 23 14 58 26 How can I sum the values by a progression like this: (21) (21 + 23) (21 + 23 + 14) (21 + 23 + 14 + 58) (21 + 23 + 14 + 58 + 26) (21 + 23 + 14 + 58 + 26) I've try with the function "loop" Best Wishes, Alfredo [[alternative HTML v

Re: [R] How to delete a duplicate observation

2007-09-13 Thread Peter Dalgaard
nuyaying wrote: > I have a data set with 3 variables V1, V2, V3. If there are 2 data points > have the same values on both V1 and V2, I want to delete one of them which > has smaller V3 value.i.e., in the data below, I want to delete > the first observation. How can I do that ?Thanks in

[R] statistics - hypothesis testing question

2007-09-13 Thread Leeds, Mark (IED)
I estimate two competing simple regression models, A and B where the LHS is the same in both cases but the predictor is different ( I handle the intercept issue based on other postings I have seen ). I estimate the two models on a weekly basis over 24 weeks. So, I end up with 24 RSquaredAs and 24

[R] How to delete a duplicate observation

2007-09-13 Thread nuyaying
I have a data set with 3 variables V1, V2, V3. If there are 2 data points have the same values on both V1 and V2, I want to delete one of them which has smaller V3 value.i.e., in the data below, I want to delete the first observation. How can I do that ?Thanks in advance! V1 V

Re: [R] Number -> Fraction

2007-09-13 Thread Mauro Arnoldi
Alle giovedì 13 settembre 2007, Stefano Calza ha scritto: > > see "fractions" in library MASS > Yeah! > 1/3 [1] 0.333 > fractions(0.333) [1] 1/3 Great! Thanks! (grazie :) ) Mauro __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

[R] Origin label in lattice

2007-09-13 Thread Andrew Smith
I would like to make what seems like a simple addition to a display constructed from a call to levelplot -- I want to add a text label (which will, in general, depend on the object being plotted, and so cannot be hardcoded) to the origin, which has special significance in my problem. The x and y a

Re: [R] t.test() with missing values

2007-09-13 Thread Peter Dalgaard
Birgit Lemcke wrote: > Hello! > > I am using R 2.5.1 on a Apple Power Book G4 with Mac OS X 10.4.10 and > I am still R beginner. > > I try to calculate a t.test() using this code: > > TTest75<-t.test(Fem75, Mal75, alternative= "two.sided", paired= TRUE) > > This works properly, but I have t

Re: [R] Number -> Fraction

2007-09-13 Thread Thomas Lumley
I should have remembered MASS::fractions(). This has a slightly different aim, giving continued fraction approximations to any real number, where my function just tries to handle numbers that really are close to fractions with small denominators. For example, unfrac() won't report a fraction

Re: [R] Very new help needed.

2007-09-13 Thread Charles C. Berry
On Thu, 13 Sep 2007, Abu Naser wrote: Hello all R user, I am very new with r I have been wondering whether anyone could help me. I have a 23000 row and 273 colums. What I want to do is to calculate unit vector for every 3 colums along the row. Could you please advise me how to do that using R

[R] ROracle and R 2.5.1 on Windows

2007-09-13 Thread Scillieri, John
Has anyone had any luck using the Windows ROracle package binary from http://stat.bell-labs.com/RS-DBI/index.html? It's version 0.5-7 and I've tried it with DBI version 0.1-10 (found on the site) as well as the newest 0.2-3. With both versions I get the following error: > require(ROracle) Loading

Re: [R] Number -> Fraction

2007-09-13 Thread Ravi Varadhan
Finding sufficiently accurate rational approximations to a real number, can be done using fractions() in MASS, which uses continued fractions. "Sufficient" accuracy can be specified using the number of cycles and maximum denominator size options (note that max.denom is the final term in the continu

Re: [R] smooth scrolling with windows() function

2007-09-13 Thread Greg Snow
I don't know why windows is so slow/jumpy doing it your way. One alternative is to use the tkrplot library. This does redraw the plot every time, but it is fast enough that it goes pretty smooth. Here is an example that you can start with to see if it does what you want: library(tkrplot) y <-

[R] t.test() with missing values

2007-09-13 Thread Birgit Lemcke
Hello! I am using R 2.5.1 on a Apple Power Book G4 with Mac OS X 10.4.10 and I am still R beginner. I try to calculate a t.test() using this code: TTest75<-t.test(Fem75, Mal75, alternative= "two.sided", paired= TRUE) This works properly, but I have two variables with a lot of missing

Re: [R] how to obtain the CPU time of my program

2007-09-13 Thread Stefan Grosse
Original Message Subject: [R] how to obtain the CPU time of my program From: gang xu <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Date: 13.09.2007 17:16 > Dear R users and experts, > > I am current running a program (a series of commands) in R. such as: > > A <- as.matrix(read.table

Re: [R] how to obtain the CPU time of my program

2007-09-13 Thread Gabor Csardi
Here's how to use it: f <- function() { <> } system.time( f() ) It is not required to define a function, but i think it is easier. Gabor On Thu, Sep 13, 2007 at 04:16:45PM +0100, gang xu wrote: > Dear R users and experts, > > I am current running a program (a series of commands) in R. such

Re: [R] Number -> Fraction

2007-09-13 Thread Thomas Lumley
On Thu, 13 Sep 2007, Mauro Arnoldi wrote: > Hi everybody! > I'm new to this list and also to the R program. > > I'd like to know if there is a function able to convert results into > Fractional form like my scientific calculator have. For example: > >> 1/3 > [1] 0.333 > >> function_that_return

[R] Logistic regression

2007-09-13 Thread martin pareja
Hello I am trying to get the estimated value of logit(p), along with its standard error/conf interval from a logistic regression model (for the overall sample, and for individual treatment levels), where p is the proportion of "successes". I am having difficulty in finding how to tell R to give thi

Re: [R] how to plot shaded area under a curve?

2007-09-13 Thread AA
in addition to Charles' suggestion which is more advanced, I found the link below very helpful. http://www.feferraz.net/en/shaded.html good luck AA. - Original Message - From: "Charles Annis, P.E." <[EMAIL PROTECTED]> To: "'gallon li'" <[EMAIL PROTECTED]>; "'r-help'" <[EMAIL PROTECTED]>

[R] how to obtain the CPU time of my program

2007-09-13 Thread gang xu
Dear R users and experts, I am current running a program (a series of commands) in R. such as: A <- as.matrix(read.table("C:/LP.txt")); a=which(memb==q); b=a; B=as.matrix(A[a,b]) LS=sum(B)/2; TL=sum(A)/2 i<-c(1:NN); D=sum(A[a,i]); how can i obtain the CPU time used for these commands ? I h

Re: [R] Number -> Fraction

2007-09-13 Thread Gabor Grothendieck
Try: library(MASS) ?fractions On 9/13/07, Mauro Arnoldi <[EMAIL PROTECTED]> wrote: > Hi everybody! > I'm new to this list and also to the R program. > > I'd like to know if there is a function able to convert results into > Fractional form like my scientific calculator have. For example: > > > 1

Re: [R] Number -> Fraction

2007-09-13 Thread Uwe Ligges
Mauro Arnoldi wrote: > Hi everybody! > I'm new to this list and also to the R program. > > I'd like to know if there is a function able to convert results into > Fractional form like my scientific calculator have. For example: > >> 1/3 > [1] 0.333 > >> function_that_return_a_fraction_from

Re: [R] How to use available.packages

2007-09-13 Thread Uwe Ligges
A Lenzo wrote: > Hello R gurus, > > Until recently, I used the following commands to update R: > > options(CRAN = "http://cran.stat.ucla.edu";) > install.packages(CRAN.packages()[,1]) > > But now I am told that install.packages is deprecated and that I should use > available.packages No, it t

[R] test

2007-09-13 Thread Wayne.W.Jones
Testing if I can mail to the list! None of my emails seem to be getting through. Apologies. Wayne Jones Statistical Consultant Shell Global Solutions (UK) Shell Technology Centre Thornton, P.O. Box 1, Cheste

Re: [R] How to use available.packages

2007-09-13 Thread Henrique Dallazuanna
CRAN.packages() is deprecated. On 13/09/2007, A Lenzo <[EMAIL PROTECTED]> wrote: > > Hello R gurus, > > Until recently, I used the following commands to update R: > > options(CRAN = "http://cran.stat.ucla.edu";) > install.packages(CRAN.packages()[,1]) > > But now I am told that install.packages is

Re: [R] Number -> Fraction

2007-09-13 Thread Katharine Mullen
look at ?fractions > fractions(.3) [1] 1/3 On Thu, 13 Sep 2007, Mauro Arnoldi wrote: > Hi everybody! > I'm new to this list and also to the R program. > > I'd like to know if there is a function able to convert results into > Fractional form like my scientific calculator have. For example: >

Re: [R] Bootstrap tree selection in rpart

2007-09-13 Thread Wayne.W.Jones
Hi there, Rather than cross validating or bootstrapping to prune a single tree you could use random forest instead. Look at the overview in http://www.stat.berkeley.edu/~breiman/RandomForests/cc_home.htm THere is a package in R for doing this called library(randomForest). I have found it to

Re: [R] Number -> Fraction

2007-09-13 Thread Stefano Calza
Welcome (benvenuto), see "fractions" in library MASS es: > fractions(1/2) [1] 1/2 Ciao Stefano On Thu, Sep 13, 2007 at 04:54:01PM +0200, Mauro Arnoldi wrote: Hi everybody! I'm new to this list and also to the R program. I'd like to know if there is a function able to convert results into

Re: [R] Multivariate, multilevel regression?

2007-09-13 Thread Armin Goralczyk
On 9/13/07, John McHenry <[EMAIL PROTECTED]> wrote: > Dear WizaRds, > > This is mostly a statistics question, but I'm figuring that R is the right > solution (even before I start!) > > Also have a look at these tutorials (in the journal Statistics in Medicine, needs subscription) http://dx.doi.o

[R] How to use available.packages

2007-09-13 Thread A Lenzo
Hello R gurus, Until recently, I used the following commands to update R: options(CRAN = "http://cran.stat.ucla.edu";) install.packages(CRAN.packages()[,1]) But now I am told that install.packages is deprecated and that I should use available.packages Can anyone tell me what the corresponding c

[R] Multiple R sessions, Mac version

2007-09-13 Thread David Afshartous
Hello all, I've just switched to running R 2.5.1 on a Mac 0S X 10.4.1 platform. I can't seem to find how to run simultaneous R sessions. Didn't see anything in the archives on this or under the R file menu. Thanks! David __ R-help@r-project.org maili

[R] Multiple R sessions, Mac version

2007-09-13 Thread David Afshartous
Hello all, I've just switched to running R 2.5.1 on a Mac 0S X 10.4.1 platform. I can't seem to find how to run simultaneous R sessions. Didn't see anything in the archives on this or under the R file menu. Thanks! David __ R-help@r-project.org maili

[R] Very new help needed.

2007-09-13 Thread Abu Naser
Hello all R user, I am very new with r I have been wondering whether anyone could help me. I have a 23000 row and 273 colums. What I want to do is to calculate unit vector for every 3 colums along the row. Could you please advise me how to do that using R? with regards, Abu __

[R] Number -> Fraction

2007-09-13 Thread Mauro Arnoldi
Hi everybody! I'm new to this list and also to the R program. I'd like to know if there is a function able to convert results into Fractional form like my scientific calculator have. For example: > 1/3 [1] 0.333 > function_that_return_a_fraction_from_numbers(0.333) [1] 1/3 Thanks Maur

Re: [R] Call C code from R

2007-09-13 Thread Roland Rau
Hi! Olga K. Kamneva wrote: > Hello, All! > > I have function which is written in C, the function uses other functions > also builded bu me. Now I need to use the function to build R function. > My questions are: > 1. How can I include libraries (for example, iomanip, sstream, tcl.h)? > 2. Should

Re: [R] which test for seven groups with dependency in replication and discrete values

2007-09-13 Thread Mendiburu, Felipe \(CIP\)
Dear Ralph. You can use the kruskal function of the library agricolae. greetings. Felipe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ralph Scherer Sent: Thursday, September 13, 2007 5:44 AM To: r-help@r-project.org Subject: [R] which test for seven group

Re: [R] Call C code from R

2007-09-13 Thread Seth Falcon
"Olga K. Kamneva" <[EMAIL PROTECTED]> writes: > Hello, All! > > I have function which is written in C, the function uses other functions > also builded bu me. Now I need to use the function to build R function. > My questions are: > 1. How can I include libraries (for example, iomanip, sstream, tc

Re: [R] Bootstrap tree selection in rpart

2007-09-13 Thread Fiona Callaghan
Thanks very much for replying -- just one final question: does this hold when the outcome is continuous (and not discrete) e.g instead of the outcome being multinomial we have a continuous outcome like residuals? Thanks again Fiona > Fiona Callaghan asked about using the bootstrap instead of > c

Re: [R] Call C code from R

2007-09-13 Thread Vincent Goulet
You did read the "Writing R Extensions" manual before posting, did you? Le 13 sept. à 01:05, Olga K. Kamneva a écrit : > Hello, All! > > I have function which is written in C, the function uses other > functions > also builded bu me. Now I need to use the function to build R > function. > My

Re: [R] "Save to File..." option on File menu

2007-09-13 Thread Talbot Katz
Thank you for bringing your thread to my attention. The discussion therein pretty much encapsulated what I was trying to find out. -- TMK -- 212-460-5430home 917-656-5351cell >From: "Muenchen, Robert A (Bob)" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >CC: "Talbot Katz" <[EMAIL PR

[R] which test for seven groups with dependency in replication and discrete values

2007-09-13 Thread Ralph Scherer
hello! My Problem is, that I want to compare seven groups, which have the discrete values from 0 to 3. These are damageclasses of plants. 0 is best and 3 is worst. Every group has 4 replications with 2 plants. The two plants were together in a cage with animals. I think the problem is that the

Re: [R] how to plot shaded area under a curve?

2007-09-13 Thread Charles Annis, P.E.
While it's true that polygon() is the function you need, perhaps it would be helpful to see an example of how to use polygon(). Go here: http://addictedtor.free.fr/graphiques/thumbs.php Put the mouse over the thumbnail plots to see larger pictures and look for something useful. You will find it

Re: [R] barplot border width

2007-09-13 Thread Marc Schwartz
On Wed, 2007-09-12 at 21:43 +0200, John Lande wrote: > I need to increase the width of the border in a barplot, i checked both > barplot, and barplot2, but cant find how to do it. how can I do? If you are referring to the borders of the bars themselves, you can adjust par("lwd") prior to calling b

Re: [R] handle dates in R?

2007-09-13 Thread Peter Dalgaard
Armstrong, Whit wrote: > dts <- c("2004-8-1","2004-10-1","2001-9-1") > strptime(dts,"%Y-%m-%d") > julian(strptime(dts,"%Y-%m-%d")) > > > Why do people insist on missing the obvious? > x <- c("2004-8-1","2004-10-1","2001-9-1") > as.Date(x) - as.Date("1960-1-1") Time differences in days [1] 1628

Re: [R] handle dates in R?

2007-09-13 Thread Armstrong, Whit
dts <- c("2004-8-1","2004-10-1","2001-9-1") strptime(dts,"%Y-%m-%d") julian(strptime(dts,"%Y-%m-%d")) > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of zhijie zhang > Sent: Thursday, September 13, 2007 8:19 AM > To: [EMAIL PROTECTED] > Subject: [R]

Re: [R] handle dates in R?

2007-09-13 Thread Jared O'Connell
Take a look at the "chron" package... > as.chron("2004-8-1",format=c(dates="y-m-d")) - > as.chron("1960-1-1",format=c(dates="y-m-d")) Time in days: [1] 16284 On 9/13/07, zhijie zhang <[EMAIL PROTECTED]> wrote: > > Dear Rusers, > I have some data in .csv file like "2004-8-1" and "2004-10-1",

[R] smooth scrolling with windows() function

2007-09-13 Thread Samuel Kemp
Hi, I have a large plot that I would like to display in a graphics device with scroll bars. I therefore decided to use the windows function like so... mag<- length(tick) windows(height=mag/8, width=10, rescale="fixed") However, when I use the scroll bars the device (i guess) is re-drawing the pl

[R] handle dates in R?

2007-09-13 Thread zhijie zhang
Dear Rusers, I have some data in .csv file like "2004-8-1" and "2004-10-1", and i need to convert them into days from the origin (January 1, 1960). I have tried the function date.mmdd(), but cannot get it. Anybody can show me how to handle the date data? Thanks very much! My dataset like:

Re: [R] Someone Using Java/R Interface--- JRI ?

2007-09-13 Thread Rajarshi Guha
We use JRI as par of a R web service infrastructure, where we have Java classes around specific R functions (lm, randomForest, nnet etc) as well as classes that call arbitrary R code You can look at the code at http://cicc-grid.svn.sourceforge.net/ viewvc/cicc-grid/cicc-grid/rws/trunk/src/net

Re: [R] how to plot shaded area under a curve?

2007-09-13 Thread Wayne.W.Jones
?polygon -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of gallon li Sent: 13 September 2007 11:52 To: r-help Subject: [R] how to plot shaded area under a curve? say, I am plotting x=seq(0,5,len=100) y=-(x-5)^2 plot(x,y) how can I put some color or ver

Re: [R] difference between unique() and !duplicated()

2007-09-13 Thread Duncan Murdoch
On 13/09/2007 5:47 AM, T.Lok wrote: > Yesterday I spend the whole day struggling on how to get > the maximum value of "y" for every unique value of "x" > from the dataframe "test". In the R Book (Crawley, 2007) > an example of this can be found on page 121. I tried to do > it this way, but I fa

Re: [R] how to plot shaded area under a curve?

2007-09-13 Thread jim holtman
try this: > x=seq(0,5,len=100) > y=-(x-5)^2 > > plot(x,y) > polygon(c(x,x[length(x)]), c(y, y[1]), col='red') On 9/13/07, gallon li <[EMAIL PROTECTED]> wrote: > say, I am plotting > > x=seq(0,5,len=100) > y=-(x-5)^2 > > plot(x,y) > > how can I put some color or verticle lines below the plotted c

[R] ade4 on the web: new graph gallery

2007-09-13 Thread Stéphane Dray
Dear All, there are some news on the ade4 (Analysis of Environmental Data : Exploratory and Euclidean method) website: - Information on the updates of the package are available at http://pbil.univ-lyon1.fr/ADE-4/changelog.php. This page is created automatically using the cvs repository. - The

Re: [R] difference between unique() and !duplicated()

2007-09-13 Thread Michael Dewey
At 10:47 13/09/2007, T.Lok wrote: >Yesterday I spend the whole day struggling on how to get the maximum >value of "y" for every unique value of "x" from the dataframe >"test". In the R Book (Crawley, 2007) an example of this can be >found on page 121. I tried to do it this way, but I failed. > >

Re: [R] how to plot shaded area under a curve?

2007-09-13 Thread Wayne.W.Jones
?polygon -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of gallon li Sent: 13 September 2007 11:52 To: r-help Subject: [R] how to plot shaded area under a curve? say, I am plotting x=seq(0,5,len=100) y=-(x-5)^2 plot(x,y) how can I put some color or verti

[R] how to plot shaded area under a curve?

2007-09-13 Thread gallon li
say, I am plotting x=seq(0,5,len=100) y=-(x-5)^2 plot(x,y) how can I put some color or verticle lines below the plotted curve? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] rearrange problem

2007-09-13 Thread jim holtman
Is this what you want: > n <- 10 > m <- 4 > x <- replicate(n, paste(letters[sample(1:26,m)], collapse='')) > x [1] "zmld" "tlme" "fonb" "aqwn" "onxl" "rpfx" "sler" "cvom" "ilme" "nbge" > x.sort <- sapply(x, function(.str){ + paste(sort(strsplit(.str, '')[[1]]), collapse='') + }) > x.sort zm

Re: [R] difference between unique() and !duplicated()

2007-09-13 Thread jim holtman
Try this: > a <- read.table(textConnection("x y z + 1 A 1 yes + 2 A 2 yes + 3 B 1 no + 4 B 1 yes + 5 C 2 no + 6 C 3 no + 7 D 1 no"), header=TRUE) > do.call('rbind', by(a, a$x, function(.sub){ + .sub[which.max(.sub$y),] + })) x y z A A 2 yes B B 1 no C C 3 no D D 1 no On 9/13/07,

[R] rearrange problem

2007-09-13 Thread kevinchang
Hi All, I am trying to rearrange alphabetically each element in a character vector. ex: say the first element in the vector is "cba", and my goal is to turn it into "abc". The suggested function to use is sort(). But it turns out that sort doesn't work at the level of element. So I am wondering t

Re: [R] Tick intervals

2007-09-13 Thread Jim Lemon
livia wrote: > Hi, I would like to plot a histogram with the following codes, and I would > like to make the tick intervals smaller. I tried to add "lab=c(1,1,12)", but > nothing changes. > > > par(mfrow=c(1,1),font=1, cex=0.8) > hist (data1, seq(-0.01,0.3,0.01),freq = FALSE, > main="Figure1.",xl

Re: [R] pick time intervalls

2007-09-13 Thread Wayne.W.Jones
?tapply temp.data<-data[as.character(data$time %in% c("02:00","03:00","04:00"),] # one quick and dirty method is to create a subset the data , not sure what format your time data is so converted to character strings. then something like: tapply(temp.data$V1, factor(temp.data$time), mean) W

[R] difference between unique() and !duplicated()

2007-09-13 Thread T.Lok
Yesterday I spend the whole day struggling on how to get the maximum value of "y" for every unique value of "x" from the dataframe "test". In the R Book (Crawley, 2007) an example of this can be found on page 121. I tried to do it this way, but I failed. In the end, I figured out how to get it

[R] pick time intervalls

2007-09-13 Thread jerzack
Hello, as an R beginner I have a question concerning the following data set: nr date timeV1 V2 V3 V4 V5 V6 ... 2828 26/08/05 20:00 60 38 55 58 53 56 2829 26/08/05 21:00 58 34 54 49 45 53 2830 26/08/05 22:00 56 35 52 51 46 47 2831 26/08/05 23:00 56 35 50 45

Re: [R] Someone Using Java/R Interface--- JRI ?

2007-09-13 Thread f.jamitzky
I made the observation that it is easier to call java from R by using rJava. This is very much analogous to calling C or fortran from R, but your mileage can vary. Vaibhav Gathibandhe wrote: > > Hi all, > > I am writing R code and I want to interface with JAVA i.e. I want to call > R > from J

  1   2   >