Re: [R] Opinion on R plots: connecting X and Y

2007-04-20 Thread Stephen Tucker
Edward Tufte seems to have some opinions on this topic. In The Visual Display of Quantitative Information (Chapter 6: Data-Ink Maximization and Graphical Design -> Redesign of the Scatterplot), he presents several alternatives (1) "non-data-bearing frame" in conventional scatterplots (equivalent

Re: [R] Using R to create pdf's from each file in a directory

2007-04-20 Thread Jeffrey Horner
gecko951 wrote: > The Platform I am using R on is RHEL3. I run a bash script that collects > data into many CSV files and have been processing them one at a time on my > local machine with an excel macro. I would like to use R to take data > points from each of the CSV files and create line graph

Re: [R] Using R to create pdf's from each file in a directory

2007-04-20 Thread Robert A LaBudde
At 11:06 PM 4/20/2007, I wrote: >At 09:40 PM 4/20/2007, gecko951 wrote: > > > >list <- dir("/tmp/data") > >for(x in list){ > >d <- read.table(x, sep="\t", header=TRUE) # read data > >pdf("/tmp/graph/x.pdf") # file for graph > > > >I'm a tyro at R, but it's obvious here

Re: [R] simply this loop?

2007-04-20 Thread jim holtman
try this: lapply(1:4, function(j) {n=ncol(y0[[j]]); do.call('cbind',lapply(1:n, function(i) y0[[j]][,i]))}) On 4/20/07, Weiwei Shi <[EMAIL PROTECTED]> wrote: > Hi, anyone interested in this: > > I tried to simply this loop with lapply or something but haven't figured it > out: > > mapt = c("2

Re: [R] Using R to create pdf's from each file in a directory

2007-04-20 Thread Robert A LaBudde
At 09:40 PM 4/20/2007, gecko951 wrote: > >list <- dir("/tmp/data") >for(x in list){ >d <- read.table(x, sep="\t", header=TRUE) # read data >pdf("/tmp/graph/x.pdf") # file for graph > I'm a tyro at R, but it's obvious here that the line pdf("/tmp/graph/x.pdf") has the

Re: [R] R: Appending the files

2007-04-20 Thread Prof Brian Ripley
The output is "","V1","V2","V3" "1",0,0,0 "2",0,0,0 "","V1","V2","V3" "1",1,1,1 "2",1,1,1 and the warning is because no csv-reader is going to make much sense of that. You want col.names=FALSE on the second call. On Fri, 20 Apr 2007, Vaibhav Gathibandhe wrote: > Hello R-Experts, > > I am a b

Re: [R] Using R to create pdf's from each file in a directory

2007-04-20 Thread Duncan Murdoch
On 4/20/2007 9:40 PM, gecko951 wrote: > The Platform I am using R on is RHEL3. I run a bash script that collects > data into many CSV files and have been processing them one at a time on my > local machine with an excel macro. I would like to use R to take data > points from each of the CSV files

[R] Using R to create pdf's from each file in a directory

2007-04-20 Thread gecko951
The Platform I am using R on is RHEL3. I run a bash script that collects data into many CSV files and have been processing them one at a time on my local machine with an excel macro. I would like to use R to take data points from each of the CSV files and create line graphs in PDF format because

Re: [R] importing sas datasets

2007-04-20 Thread John Kane
Hi Anna, I'm the sas.get problem man. I still have not gotten it to work but I think that is because I have some slightly dodgy SAS files. Assuming that the sas.get problem is what was described in the earlier thread it appears to have been fixed. You might want to do an update to R to get the

Re: [R] Character coerced to factor and I cannot get it back

2007-04-20 Thread John Kane
--- Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Just one caveat. I personally would try to avoid > using > global options since it can cause conflicts when > two different programs assume two different settings > of the same global option and need to interact. Thanks, Gabor. A good point.

Re: [R] R: Appending the files

2007-04-20 Thread John Kane
--- Vaibhav Gathibandhe <[EMAIL PROTECTED]> wrote: > Hello R-Experts, > > I am a beginner to R. Can someone please look at my > problem > > I am trying to append the files in R but couldn't > get the answer properly. > > My code is > > mat1<-matrix(0,2,3) > mat2<-matrix(1,2,3) > > write.tabl

Re: [R] Suggestions for statistical computing course

2007-04-20 Thread Giovanni Petris
Thanks to everybody who responded to my query. I got many useful suggestions about books and editors, plus notes and other material online. Summarizing, the books suggested were - Monahan, Numerical Methods of Statistics - Lange, Numerical analysis for statisticians In terms of Editors, TINN-R

[R] R: Appending the files

2007-04-20 Thread Vaibhav Gathibandhe
Hello R-Experts, I am a beginner to R. Can someone please look at my problem I am trying to append the files in R but couldn't get the answer properly. My code is mat1<-matrix(0,2,3) mat2<-matrix(1,2,3) write.table(mat1,"foo.csv",sep=",",col.names=NA) write.table(mat2,"foo.csv", sep=",", col.n

Re: [R] Estimating a Normal Mixture Distribution

2007-04-20 Thread rolf
[EMAIL PROTECTED] wrote: > mix.gr<-function(p,x){ > p<-p[1] > u1<-p[2] > s1<-p[3] > u2<-p[4] > s2<-p[5] > colSums(attr(lmix2a(x,p,u1,s1,u2,s2),"gradient"))} > The problem is with the position of ``p <- p[1]''. Afterwards ``p'' is a scalar

Re: [R] nlme trouble

2007-04-20 Thread Francisco J. Zagmutt
I didn't look at your code closely but I suspect you are taking the log of zeros, hence the NA/NaN/Inf error you are getting... Francisco Chris Myers wrote: > I am not certain how nlme works so I followed an example from the web ( > http://www.menne-biomed.de/gastempt/gastempt1.html). I was ab

Re: [R] faster image display?

2007-04-20 Thread Michael Lawrence
Hi, You could try the RGtk2 package using the GtkImage widget. Like this: library(RGtk2) win <- gtkWindow() image <- gtkImage(filename="foo.jpg") win$add(image) Should be fast... if you need to draw R graphics on top of the image, you'd need to do something a bit different and more complicated

[R] simply this loop?

2007-04-20 Thread Weiwei Shi
Hi, anyone interested in this: I tried to simply this loop with lapply or something but haven't figured it out: mapt = c("203929_s_at", "203930_s_at", "203928_x_at", "206401_s_at") mapt.combn <- lapply(1:4, function(i) combn(mapt, i)) out = list() k = 1 for (i in 1:length(mapt.combn)){ fo

Re: [R] Opinion on R plots: connecting X and Y

2007-04-20 Thread rolf
I would say ``de gustibus non disputandum'', except that I can't speak Latin. cheers, Rolf Turner [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https:

Re: [R] Opinion on R plots: connecting X and Y

2007-04-20 Thread Clint Bowman
Okay, Brant. It's Friday and I'm opinionated. Since the plotted data extend to lower values on both axes that 'n' draws them, I like 'l' better. Clint Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality

Re: [R] Fastest way to repeatedly subset a data frame?

2007-04-20 Thread Tony Plate
This type of information about speeds of various techniques can really only be found out by trying things out, especially because R-core has recently made a fair number of improvements to some of the underlying code in R. That's part of the reason I put these tests together -- I wanted to know

[R] Opinion on R plots: connecting X and Y

2007-04-20 Thread Inman, Brant A. M.D.
Attention R users, especially those that are experienced enough to be opinionated, I need your input. Consider the following simple plot: x <- rnorm(100) y <- rnorm(100) plot(x, y, bty='n') A colleague (and dreaded SAS user) commented that she thought that my plots could be "cleaned up" by conn

Re: [R] Fastest way to repeatedly subset a data frame?

2007-04-20 Thread Iestyn Lewis
This is fantastic. I just tested the first match() method and it is acceptably fast. I'll look into some of the even better methods later. Thank you for taking the time to put this together. Is this kind of optimization information on the web anywhere? I can imagine that a lot of people ha

Re: [R] sorting data in R

2007-04-20 Thread Kevin Wright
Now that "sort" is a generic function, I have modified my original sort.data.frame function to be s 'data.frame' method to sort. (You now have to specify the formula as the 'by' argument). See the R Wiki: http://wiki.r-project.org/rwiki/doku.php?id=tips:data-frames:sort&s=sort%20data There are a

[R] nlme trouble

2007-04-20 Thread Chris Myers
I am not certain how nlme works so I followed an example from the web ( http://www.menne-biomed.de/gastempt/gastempt1.html). I was able to successfully reproduce the example. However, when I modified my the example to use my data and with my formula, I get a set of errors having to do with the log(

Re: [R] Fastest way to repeatedly subset a data frame?

2007-04-20 Thread Tony Plate
Here's some timings on seemingly minor variations of data structure showing timings ranging by a factor of 100 (factor of 3 if the worst is omitted). One of the keys is to avoid use of the partial string match that happens with ordinary data frame subscripting. -- Tony Plate > n <- 1 # n

Re: [R] Suggestions for statistical computing course

2007-04-20 Thread Tobias Verbeke
Giovanni Petris wrote: > Dear R-helpers, > > I am planning a course on Statistical Computing and Computational > Statistics for the Fall semester, aimed at first year Masters students > in Statistics. Among the topics that I would like to cover are linear > algebra related to least squares calculat

[R] faster image display?

2007-04-20 Thread Issac Trotts
Does someone here know of a way to display images in R that isn't slow? Here are the things I've tried so far: library(rimage) i<-read.jpeg('foo.jpg') plot(i) # very slow library(pixmap) i <- read.pnm('foo.pnm') plot(i) # also slow chans <- getChannels(i) image(chans[,,1]) # this is slow too I

Re: [R] Fastest way to repeatedly subset a data frame?

2007-04-20 Thread Iestyn Lewis
Good tip - an Rprof trace over my real data set resulted in a file filled with: pmatch [.data.frame [ FUN lapply pmatch [.data.frame [ FUN lapply pmatch [.data.frame [ FUN lapply pmatch [.data.frame [ FUN lapply pmatch [.data.frame [ FUN lapply ... with very few other calls in there. pmatch seem

[R] Empirical Likelihood

2007-04-20 Thread Antonio_Paredes
Hello Everyone, I am currently writing a C function to compute confidence interval for generalized linear models ("binomial data") based on Empirical Likelihood. I wanted to ask if there is a function in R capable of performing this computation. My current plan is to call C form R, and hopefull

[R] Estimating a Normal Mixture Distribution

2007-04-20 Thread András Danis
Hi everyone, I am using R 2.4.1 on a MacOS X ("Tiger") operating system. In the last few day I was trying to estimate the parameters of a mixture of two normal distributions using Maximum Likelihood. The code is from Modern Applied Statistics with S (4th edition), chapter 16 ("Optimization")

Re: [R] Fastest way to repeatedly subset a data frame?

2007-04-20 Thread hadley wickham
> But... it's not any faster, which is worrisome to me because it seems > like your code uses rownames and would take advantage of the hashing > potential of named items. I'm pretty sure it will use a hash to access the specified rows. Before you pursue an environment based solution, you might wan

Re: [R] Suggestions for statistical computing course

2007-04-20 Thread John Fox
Dear Duncan and Giovanni, > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Duncan Murdoch > Sent: Friday, April 20, 2007 10:13 AM > To: Giovanni Petris > Cc: r-help@stat.math.ethz.ch > Subject: Re: [R] Suggestions for statistical computing course >

Re: [R] Fastest way to repeatedly subset a data frame?

2007-04-20 Thread Iestyn Lewis
That is a seriously neat bit of code there. (I'm new to non-loop-based programming, forgive my enthusiasm). But... it's not any faster, which is worrisome to me because it seems like your code uses rownames and would take advantage of the hashing potential of named items. I'm currently lookin

Re: [R] xyplot: Combining 'subscripts' and 'allow.multiple=T'

2007-04-20 Thread Deepayan Sarkar
On 4/20/07, Sundar Dorai-Raj <[EMAIL PROTECTED]> wrote: > > Hi, Deepayan, > > Neither Søren nor I mentioned sessionInfo, which may be the reason our > error messages differ from yours: > > > sessionInfo() > R version 2.4.1 (2006-12-18) > i386-pc-mingw32 > > locale: > LC_COLLATE=English_United Stat

[R] Approaches of Frailty estimation: coxme vs coxph(...frailty(id, dist='gauss'))

2007-04-20 Thread Mohammad Ehsanul Karim
Dear List, In documents (Therneau, 2003 : On mixed-effect cox models, ...), as far as I came to know, coxme penalize the partial likelihood (Ripatti, Palmgren, 2000) where as frailtyPenal (in frailtypack package) uses the penalized the full likelihood approach (Rondeau et al, 2003). How, then,

Re: [R] xyplot: Combining 'subscripts' and 'allow.multiple=T'

2007-04-20 Thread Sundar Dorai-Raj
Deepayan Sarkar said the following on 4/20/2007 11:42 AM: > On 4/20/07, Sundar Dorai-Raj <[EMAIL PROTECTED]> wrote: >> >> >> Søren Højsgaard said the following on 4/20/2007 3:57 AM: >> > Dear all, Consider this plot >> > >> > xyplot(Sepal.Length + Sepal.Width ~ Petal.Length | Species, >> >d

Re: [R] Fastest way to repeatedly subset a data frame?

2007-04-20 Thread hadley wickham
On 4/20/07, Iestyn Lewis <[EMAIL PROTECTED]> wrote: > Hi - > > I have a data frame with a large number of observations (62,000 rows, > but only 2 columns - a character ID and a result list). > > Sample: > > > my.df <- data.frame(id=c("ID1", "ID2", "ID3"), result=1:3) > > my.df >id result > 1

Re: [R] Using power.t.test over a range of conditions

2007-04-20 Thread Inman, Brant A. M.D.
Chuck Cleland and Steve Weigand both pointed out my mistake in the loop...trying to assign a list (i.e. the output from power.t.test) to a cell in a data.frame. Thanks guys. Brant __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman

Re: [R] xyplot: Combining 'subscripts' and 'allow.multiple=T'

2007-04-20 Thread Deepayan Sarkar
On 4/20/07, Sundar Dorai-Raj <[EMAIL PROTECTED]> wrote: > > > Søren Højsgaard said the following on 4/20/2007 3:57 AM: > > Dear all, Consider this plot > > > > xyplot(Sepal.Length + Sepal.Width ~ Petal.Length | Species, > >data = iris, allow.multiple=T, outer=F, > >panel = function

Re: [R] Fastest way to repeatedly subset a data frame?

2007-04-20 Thread Iestyn Lewis
Hi Phil - Sadly, although your syntax is certainly a lot cleaner and more elegant than mine, the elapsed time is about the same. 5 minutes may have been an exaggeration, but we are looking at a timescale of minutes, where the C# hashtable method was under a second. I have a feeling the inher

Re: [R] sequences extraction

2007-04-20 Thread GREGOR Brian J
Here's a solution which uses diff() and apply. findSequences <- function(Data){ # Sort the vector in case it hasn't been sorted Data <- sort(Data) # Check that there are no duplicate values in Data if(any(duplicated(Data))) stop("Function with not work if Data argument contains

Re: [R] Using power.t.test over a range of conditions

2007-04-20 Thread Chuck Cleland
Inman, Brant A. M.D. wrote: > R-Helpers: > > I would like to perform sample size calculations for an experiment. As > part of this process, I would like to know how various assumptions > affect the sample size calculation. For instance, one thing that I > would like to know is how the calculated

Re: [R] Character coerced to factor and I cannot get it back

2007-04-20 Thread Gabor Grothendieck
Just one caveat. I personally would try to avoid using global options since it can cause conflicts when two different programs assume two different settings of the same global option and need to interact. On 4/20/07, John Kane <[EMAIL PROTECTED]> wrote: > Thanks Stephen and Gabor. > > It works li

Re: [R] importing sas datasets

2007-04-20 Thread Daniel Nordlund
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of [EMAIL PROTECTED] > Sent: Friday, April 20, 2007 6:36 AM > To: r-help@stat.math.ethz.ch > Subject: [R] importing sas datasets > > Hello, > > I wanted to ask help about importing sas datasets. > > 1)I

Re: [R] cat() to STDERR

2007-04-20 Thread ivo welch
thank you, peter and brian. I had not found the stderr() function. (I had looked at the R Input/Output guide.) This is great. regards, /ivo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the postin

Re: [R] Udpate R under a proxy

2007-04-20 Thread Liaw, Andy
This is what I just tried (thanks, Dirk!): Start R and then Sys.putenv("http_proxy", "whatever"), options(download.file.method="wget") doesn't work. Open up a command prompt, define http_proxy there, then run Rgui. Set options(download.file.method="wget"). This works. Perhaps you can define

Re: [R] cat() to STDERR

2007-04-20 Thread Peter Dalgaard
Prof Brian Ripley wrote: > On Fri, 20 Apr 2007, Peter Dalgaard wrote: > > >> ivo welch wrote: >> >>> Dear R wizards---I read Brian Ripley's post from 2004 which said that >>> it was not possible to print to STDERR. Alas, I have more modest >>> needs. I was wondering if it was possible to

[R] Using power.t.test over a range of conditions

2007-04-20 Thread Inman, Brant A. M.D.
R-Helpers: I would like to perform sample size calculations for an experiment. As part of this process, I would like to know how various assumptions affect the sample size calculation. For instance, one thing that I would like to know is how the calculated sample size changes as I vary the diff

Re: [R] Error: cannot change value of locked binding for

2007-04-20 Thread Martin Becker
Did you have a look at the posting guide? We have to guess that you are using some version of fOptions in some version of R under some OS, and that you run code from the examples section of ?MonteCarloOption relying on other code from that section which is not mentioned at all. Given that these

[R] limmaGUI

2007-04-20 Thread solie . alizadeh
Dear all, I have a question about limmaGUI that is usually run in R environment. My problem is loading data into the programm. I have 6 gpr files that apparently are not compatible with limma. Everytime I'm trying to load the data (including a RNA targets file, an error appears:Error reading

Re: [R] Udpate R under a proxy

2007-04-20 Thread Prof Brian Ripley
See rw-FAQ Q2.19, and of course the posting guide. Claiming 'it always fail' does not help us help you, but blaming your tools in this way could be considered discourteous (or worse). On Fri, 20 Apr 2007, justin bem wrote: dear all, I get internet via a proxy server when I try to downlaod p

[R] Fastest way to repeatedly subset a data frame?

2007-04-20 Thread Iestyn Lewis
Hi - I have a data frame with a large number of observations (62,000 rows, but only 2 columns - a character ID and a result list). Sample: > my.df <- data.frame(id=c("ID1", "ID2", "ID3"), result=1:3) > my.df id result 1 ID1 1 2 ID2 2 3 ID3 3 I have a list of ID vectors.

Re: [R] Partitioning around mediods (PAM)

2007-04-20 Thread Ranjan Maitra
The question is not reproducable, therefore useless. Perhaps you are forgetting what a medoid is when you expect a mean? HTH, Ranjan On Fri, 20 Apr 2007 17:09:09 +0200 (CEST) nathaniel Grey <[EMAIL PROTECTED]> wrote: > Hi, > > I need some help understanding the output from PAM. When I look a

Re: [R] Hiding "Warning messages" in coxme output

2007-04-20 Thread Henrique Dallazuanna
Try: options(warn=-1) To restore: options(warn=1) -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 4/20/07, Mohammad Ehsanul Karim

Re: [R] xyplot: Combining 'subscripts' and 'allow.multiple=T'

2007-04-20 Thread Sundar Dorai-Raj
Søren Højsgaard said the following on 4/20/2007 3:57 AM: > Dear all, Consider this plot > > xyplot(Sepal.Length + Sepal.Width ~ Petal.Length | Species, >data = iris, allow.multiple=T, outer=F, >panel = function(x,y,...) { > panel.xyplot(x,y,...) >} > ) >

Re: [R] Suggestions for statistical computing course

2007-04-20 Thread Fred Bacon
On Fri, 2007-04-20 at 16:02 +0200, ONKELINX, Thierry wrote: > > > >While I am looking for simple and effective solutions that do not > >require installing emacs in our computer lab, the answer "you > >should teach your students emacs/ess on top of R" is perfecly > >acceptable. >

Re: [R] cat() to STDERR

2007-04-20 Thread Prof Brian Ripley
On Fri, 20 Apr 2007, Peter Dalgaard wrote: > ivo welch wrote: >> Dear R wizards---I read Brian Ripley's post from 2004 which said that >> it was not possible to print to STDERR. Alas, I have more modest >> needs. I was wondering if it was possible to just send a string to >> STDERR with cat() wh

[R] Hiding "Warning messages" in coxme output

2007-04-20 Thread Mohammad Ehsanul Karim
Dear list, I have been trying to use coxme in R 2.3.1. When I use coxme in the following data sim.fr1, i get "Warning messages: using 'as.environment(NULL)' is deprecated" Why does it occur? How can I hide such warning message, especially when coxme is under a loop? Mohammad Ehsanul Karim (I

Re: [R] cat() to STDERR

2007-04-20 Thread Peter Dalgaard
ivo welch wrote: > Dear R wizards---I read Brian Ripley's post from 2004 which said that > it was not possible to print to STDERR. Alas, I have more modest > needs. I was wondering if it was possible to just send a string to > STDERR with cat() while in CMD BATCH mode. > > Is it not possible to o

Re: [R] Partitioning around mediods (PAM)

2007-04-20 Thread Martin Maechler
You've asked the almost identical question yesterday. {that *de*creases the probability of getting help in some cases!} If you take a little effort and follow the posting guide (keywords "reproducible example"; "not using HTML in e-mails"), I (and many others) gladly will help you further. M

Re: [R] Problem with ?curve

2007-04-20 Thread Greg Snow
Try this for now (a combination of my previous answer and the example from the tkrplot help page): library(tkrplot) library(TeachingDemos) tkcurve <- function(expr, from, to, ...){ tt <- tktoplevel() myx <- from myfun <- function(){ curve(expr, from, to, ...) tmp1 <- cnvrt.coords(0,0, inp

[R] RE : Re: Change the mode of a list

2007-04-20 Thread justin bem
see ?unlist --- Soare Marcian-Alin <[EMAIL PROTECTED]> a écrit : > Hello, > > I dont know if it works, but try: storage.mode(xxx) > = "numeric" > > Alin > > 2007/4/20, Felix Wave <[EMAIL PROTECTED]>: > > > > Hello, > > can anybody tell me a easy way to change the mode > of an "aggregate list"

[R] Udpate R under a proxy

2007-04-20 Thread justin bem
dear all, I get internet via a proxy server when I try to downlaod package it always fail. Even when i add and environnment variable for the http proxy server. I use windows XP SP2 Sincerly Justin BEM Elève Ingénieur Statisticien Economiste BP 294 Yaoundé. Tél (00237)9597295. __

Re: [R] Hi

2007-04-20 Thread John Kane
--- [EMAIL PROTECTED] wrote: > Please add me to mailing list. > > regards > Astha I think you need to go here to subscribe https://stat.ethz.ch/mailman/listinfo/r-help __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] How to return more than one variable from function

2007-04-20 Thread Liaw, Andy
From: Vincent Goulet > > Le Vendredi 20 Avril 2007 07:46, Julien Barnier a écrit : > > Hi, > > > > > I have written a function which computes variance, sd, > > > r^2, R^2adj etc. But i am not able to return all of > > > them in return statement. > > > > You can return a vector, or a list. > > > >

Re: [R] Suggestions for statistical computing course

2007-04-20 Thread Mike Prager
Giovanni Petris <[EMAIL PROTECTED]> wrote: > > 2. I do most of my work in R using Emacs and ESS. That means that I >keep a file in an emacs window and I submit it to R one line at a >time or one region at a time, making corrections and iterating as >needed. When I am done, I just save

[R] modified test of phillips-perron

2007-04-20 Thread Martin Ivanov
Hello! I would like to know whether the test of Phillips-Perron, modified for time series with large negative moving average terms implemented in R. Besides I would also like to ask the same question about the Leybourne-McCabe test for stationarity. Regards, Martin _

[R] Partitioning around mediods (PAM)

2007-04-20 Thread nathaniel Grey
Hi, I need some help understanding the output from PAM. When I look at the output it doesn't list the cluster number by the median vlaues on each of the variables (like it does with k-means) Instead I have the following: So I know for instance cluster 1 has a mean for variable1 of 33.33, howeve

Re: [R] How to return more than one variable from function

2007-04-20 Thread Vincent Goulet
Le Vendredi 20 Avril 2007 07:46, Julien Barnier a écrit : > Hi, > > > I have written a function which computes variance, sd, > > r^2, R^2adj etc. But i am not able to return all of > > them in return statement. > > You can return a vector, or a list. > > For example : > > func <- function() { > .

Re: [R] importing excel-file

2007-04-20 Thread Alberto Monteiro
Hans-Peter wrote: > >> I can't call read.xls while Excel is opening the xls file. >> R crashes and must be aborted. > > Could not reproduce here (Win2000, Excel 2003, R 2.4.1 and > 2.5.0.alpha). Who knows... > This is Windows XP, Excel 2003, R 2.4.1. > but I cannot think of anything that could >

Re: [R] Help on averaging sets of rows defined by row name

2007-04-20 Thread Liaw, Andy
Do note that I used dat[1] instead of dat[,1] or dat[[1]] as the second argument to aggregate(): If dat is a data frame, then dat[1] is also a data frame with only the first column. Since data frame is also a list, dat[1] is a one-component list. My guess is that Tierry didn't try his suggestio

[R] Fwd: Re: Character coerced to factor and I cannot get it back

2007-04-20 Thread John Kane
--- John Kane <[EMAIL PROTECTED]> wrote: > Date: Fri, 20 Apr 2007 10:47:45 -0400 (EDT) > From: John Kane <[EMAIL PROTECTED]> > Subject: Re: [R] Character coerced to factor and I > cannot get it back > To: jim holtman <[EMAIL PROTECTED]> > > Thanks Jim, > > I can live with it as a factor or I wi

[R] cat() to STDERR

2007-04-20 Thread ivo welch
Dear R wizards---I read Brian Ripley's post from 2004 which said that it was not possible to print to STDERR. Alas, I have more modest needs. I was wondering if it was possible to just send a string to STDERR with cat() while in CMD BATCH mode. Is it not possible to open STDERR in R? (Or does R

Re: [R] Suggestions for statistical computing course

2007-04-20 Thread Duncan Murdoch
On 4/20/2007 9:34 AM, Giovanni Petris wrote: > Dear R-helpers, > > I am planning a course on Statistical Computing and Computational > Statistics for the Fall semester, aimed at first year Masters students > in Statistics. Among the topics that I would like to cover are linear > algebra related to

Re: [R] Suggestions for statistical computing course

2007-04-20 Thread ONKELINX, Thierry
> 2. I do most of my work in R using Emacs and ESS. That means that I >keep a file in an emacs window and I submit it to R one line at a >time or one region at a time, making corrections and iterating as >needed. When I am done, I just save the file with the last, >working, correct

Re: [R] Help on averaging sets of rows defined by row name

2007-04-20 Thread Liaw, Andy
You might want to check which of the following scales better for the size of data you have. ## Make up some data to try. R> dat <- data.frame(gene=rep(letters[1:3], each=3), s1=runif(9), s2=runif(9)) R> dat genes1s2 1a 0.9959172 0.9531052 2a 0.2064497 0.4257022 3a 0.4

Re: [R] Character coerced to factor and I cannot get it back

2007-04-20 Thread John Kane
Thanks Stephen and Gabor. It works like a charm both ways. It took me a minute or two to find the global command but I definately like it :) Now to remember to change it on the USB installation too. Any idea what the rationale was for setting the option to TRUE? I can see advantages eithe

Re: [R] Suggestions for statistical computing course

2007-04-20 Thread Liaw, Andy
I really like John Monahan's Numerical Methods of Statistics (Cambridge University Press). As to running/editing R scripts, you may want to look into JGR. The built-in editor is not as "smart" as ESS in some respect, but "smarter" than ESS in others. The only thing that keep me from using it r

Re: [R] Suggestions for statistical computing course

2007-04-20 Thread John Kane
--- Ravi Varadhan <[EMAIL PROTECTED]> wrote: > Hi Giovanni, > I have been quite satisfied with Tinn-R (http://www.sciviews.org/Tinn-R/ ) in a Windows environment. It is small fast and I can run both it and R from a USB if I need a portable setup. > 2. I do most of my work in R using Emac

[R] help for dynlm command

2007-04-20 Thread zahid khan
Suppose we have the time series “y” When I regress this series on its first lag then I use the following command in dynlm as r=dynlm( y~L(y,1)) if I put the command of summary of above regression model then by the command summary (r ) I will get the following out put elements Coeffi

Re: [R] importing excel-file

2007-04-20 Thread Alberto Monteiro
Please ignore the last test case. I thought I had saved it, but I hadn't, sheet = 2 was empty. Now it works. Alberto Monteiro __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://

Re: [R] How to return more than one variable from function

2007-04-20 Thread Ron Michael
?list - Original Message From: vinod gullu <[EMAIL PROTECTED]> To: r-help@stat.math.ethz.ch Sent: Friday, April 20, 2007 5:00:45 PM Subject: [R] How to return more than one variable from function Dera R users, I have written a function which computes variance, sd, r^2, R^2adj etc. But

Re: [R] Help on averaging sets of rows defined by row name

2007-04-20 Thread ONKELINX, Thierry
Dear Marije, I think that aggregate() would make your life a lot easier. aggregate(table.imputed, by = table.imputed[, 1], FUN = "mean") Cheers, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / R

Re: [R] Change the mode of a list

2007-04-20 Thread Felix Wave
Hello, unfortunately storage.mode won't run. >storage.mode(MEAN) = "numeric" Default in as.double.default(list(Group.1 = c(1, 2, 3, 4, 5, 6, 7, 8, 9, : (list) Object can't change in 'double' I also tried: MEASURE <- sapply( MEAN, as.numeric ) But then, the first colum is +1 greater and

Re: [R] importing excel-file

2007-04-20 Thread Alberto Monteiro
Hans-Peter wrote: > >> I added colClasses = "double", and now it works - but I lose all >> strings, that become NAs (they don't matter - maybe if they matter, >> I just have to call read.xls twice). Without colClasses = "double", >> the numbers become meaningless stuff. > > If a scalar colClasses

Re: [R] importing excel-file

2007-04-20 Thread Erich Neuwirth
I am coming in late in this discussion because I am away from home and do not read my email regularly. Here are my few cents. If you are working on Windows and have Excel installed, an easy way of transferring data between R and Excel is my RExcel package which ships with Thomas Baier's R(D)COM pa

Re: [R] Change the mode of a list

2007-04-20 Thread Felix Wave
With >as.matrix(MEAN[unlist(lapply(MEAN, is.numeric))]) I will get two colums not three and only the last colum are my values (MEAN[,3]). The first is only a rising number. I also tried: >MEASURE <- sapply( MEAN, as.numeric ) resp. >MEAN <- unlist(MEAN) >MEASURE <- matrix(MEAN, ncol=3, b

Re: [R] how to convert the lower triangle of a matrix to a symmetricmatrix [Broadcast]

2007-04-20 Thread Liaw, Andy
Ranjan and Prof. Fox, Similar approach can be found in stats:::as.matrix.dist(). Andy From: John Fox > > Dear Ranjan, > > If the elements are ordered by rows, then the following > should do the trick: > > X <- diag(p) > X[upper.tri(X, diag=TRUE)] <- elements > X <- X + t(X) - di

[R] importing sas datasets

2007-04-20 Thread [EMAIL PROTECTED]
Hello, I wanted to ask help about importing sas datasets. 1)I tried with some functions as read.ssd (foreign package), but it doesn't import the file if the length of the variables' names are longer than 8 bite (it has to conform to the 6 version). 2)I then tried with the sas.get function (Hmis

[R] Help on averaging sets of rows defined by row name

2007-04-20 Thread Booman, M
Dear all, This is my problem: I have a table of gene expression data, where 1st column is gene name, and 2nd -39th columns each are exression data for 38 samples. There are multiple measurements per sample for each gene, so there are multiple rows for each gene name. I want to average these mea

Re: [R] Suggestions for statistical computing course

2007-04-20 Thread Ravi Varadhan
Hi Giovanni, You may want to consider: "Numerical analysis for statisticians" (Springer) by Ken Lange. We used when I was taking a graduate level (MS and PhD students) course in statistical computing. I really like it and still use it frequently. Ravi. -

[R] Suggestions for statistical computing course

2007-04-20 Thread Giovanni Petris
Dear R-helpers, I am planning a course on Statistical Computing and Computational Statistics for the Fall semester, aimed at first year Masters students in Statistics. Among the topics that I would like to cover are linear algebra related to least squares calculations, optimization and root-findi

Re: [R] Change the mode of a list

2007-04-20 Thread Felix Wave
With >as.matrix(MEAN[unlist(lapply(MEAN, is.numeric))]) I will get two colums not three and only the last colum are my values (MEAN[,3]). The first is only a rising number. I also tried: >MEASURE <- sapply( MEAN, as.numeric ) resp. >MEAN <- unlist(MEAN) >MEASURE <- matrix(MEAN, ncol=3, b

Re: [R] How to return more than one variable from function

2007-04-20 Thread Julien Barnier
Hi, > I have written a function which computes variance, sd, > r^2, R^2adj etc. But i am not able to return all of > them in return statement. You can return a vector, or a list. For example : func <- function() { ... result <- list(variance=3, sd=sqrt(3)) return(result) # you can omit t

Re: [R] Help on averaging sets of rows defined by row name

2007-04-20 Thread Booman, M
Thanks for your help everyone! I had some trouble with the 'aggregate' function because the 'table.impute[,1]' was not a list (which the 'by' argument should be), and it took a very very long time to coerce it into one. But the rowmeans method works almost instantly! And I have no problems with

[R] Error: cannot change value of locked binding for

2007-04-20 Thread gyadav
Hello R experts What does this error means and how to resolve this issue (cannot change value of locked binding for ). Please suggest > mc = MonteCarloOption(dt = 1/360, pathLength = 30, mcSteps = 5000, mcLoops = + 50, init = TRUE, innovations.gen = sobolInnovations, path.gen = wienerPath, +

Re: [R] how to convert the lower triangle of a matrix to a symmetricmatrix

2007-04-20 Thread John Fox
Dear Ranjan, If the elements are ordered by rows, then the following should do the trick: X <- diag(p) X[upper.tri(X, diag=TRUE)] <- elements X <- X + t(X) - diag(diag(X)) If they are ordered by columns, substitute lower.tri() for upper.tri(). I hope this helps, John -

Re: [R] importing excel-file

2007-04-20 Thread Hans-Peter
> This is Windows XP, Excel 2003, R 2.4.1. > Maybe the problem is with Windows XP. I know that it locks some > files, even when I open for reading. For example, if I open 'test.xls' > file, then I can't issue the DOS command 'copy test.xls new_test.xls'. Thanks for your information. Will test some

[R] automatic call generation for aov()

2007-04-20 Thread Bruno L. Giordano
Hello, I am writing down a general function to implement the bootstrapF method for repeated measures anova. I am passing the function several data frames: y = dependent subj = subject identifiers b = between-subjects factors (number = NB) w = within-subjects factors (number = NW) after grou

Re: [R] How to return more than one variable from function

2007-04-20 Thread jim holtman
use a 'list' as the return value containing the values you want returned. x<- function(){ . list(val1=a, val2=b, val3=c) } On 4/20/07, vinod gullu <[EMAIL PROTECTED]> wrote: > Dera R users, > I have written a function which computes variance, sd, > r^2, R^2adj etc. But i am not able to return

  1   2   >