Re: [R] logical 'or' on list of vectors

2007-06-08 Thread Sundar Dorai-Raj
Tim Bergsma said the following on 6/8/2007 5:57 AM: > Suppose I have a list of logicals, such as returned by lapply: > > Theoph$Dose[1] <- NA > Theoph$Time[2] <- NA > Theoph$conc[3] <- NA > lapply(Theoph,is.na) > > Is there a direct way to execute logical "or" across all vectors? The > follow

Re: [R] ievent.wait

2007-06-13 Thread Sundar Dorai-Raj
Hi, Greg, type = 'b' won't work according to ?locator. Try type = 'o'. HTH,x --sundar Greg Snow said the following on 6/13/2007 7:27 AM: > Does > > locator(type='l') > > (or type ='b') > > Work for you? > > -Original Message- > From: "ryestone" <[EMAIL PROTECTED]> > To: "r-help@

Re: [R] abline plots at wrong abscissae after boxplot

2007-06-21 Thread Sundar Dorai-Raj
Brian Wilfley said the following on 6/21/2007 2:44 PM: > Hi folks, > > I'm using R 2.5.0 under ESS under Windows XP. (This also happens using > the Rgui application.) > > I'm trying to add lines to a plot originally made with "boxplot", but > the lines appear in the wrong place. Below is a scri

Re: [R] from character string to function body?

2007-07-07 Thread Sundar Dorai-Raj
Atte Tenkanen said the following on 7/7/2007 8:41 AM: > Dear R users, > > I wonder if it is possible to form a function from a character string. Here > is an example: > > >> x=3 >> `-`(`+`(`^`(x,3),`^`(x,2)),1) # Here is my function evaluated. > [1] 35 > >> V=list("`-`","(","`+`","(","`^`","

Re: [R] Lattice: vertical barchart

2007-07-10 Thread Sundar Dorai-Raj
Michael Hoffman said the following on 7/10/2007 7:06 AM: > barchart(Titanic, stack=F) produces a very nice horizontal barchart. > Each panel has four groups of two bars. > > barchart(Titanic, stack=F, horizontal=F) doesn't produce the results I > would have expected, as it produces this warnin

Re: [R] How to plot two variables using a secondary Y axis

2007-07-10 Thread Sundar Dorai-Raj
Felipe Carrillo said the following on 7/10/2007 7:58 AM: > Date Fo Co6/27/2007 57.1 13.96/28/2007 57.7 14.3 > 6/29/2007 57.8 14.36/30/2007 57 13.97/1/2007 57.1 13.9 > 7/2/2007 57.2 14.07/3/2007 57.3 14.17/4/2007 57.6 14.2 > 7/5/2007

Re: [R] reversing the x-axis terms on a boxplot

2007-07-25 Thread Sundar Dorai-Raj
Dylan Beaudette said the following on 7/25/2007 11:18 AM: > Hi, > > I am able to reverse the order of plotting on regular plots (i.e. with the > plot() function) by manually setting the xlim variable. > > Is there some trick like this which will work for a boxplot? > > * for example: > > l

Re: [R] Tabs in PDF documents

2007-07-30 Thread Sundar Dorai-Raj
Dennis Fisher said the following on 7/30/2007 6:25 AM: > Colleagues, > > I am using R 2.5.1 on an Intel Mac (OS 10) to create PDF outputs > using pdf(); same problem exists in Linux (RedHat 9) > > While adding text to the document with text() and mtext(), I > encounter the following problem

Re: [R] setup trellis.device to color=F inside the xyplot function

2007-08-05 Thread Sundar Dorai-Raj
Ronaldo Reis Junior said the following on 8/5/2007 6:18 AM: > Hi, > > it is possible to setup trellis.device(color=F) inside teh function xyplot? > > I try to use > >> xyplot(ocup~tempo| > nitro+estacao,col="white",ylim=c(0,0.7),par.settings=list(color=F)) > > But dont work, the only way tha

Re: [R] .C interface and Strings...

2007-01-12 Thread Sundar Dorai-Raj
Stephane Cruveiller said the following on 1/12/2007 4:15 AM: > Dear R users, > > I am trying to include C code into R via the .C interface. I have read > that arguments passed to a C function have to be correctly DEreferenced. > This is something that can be easily done for numbers (integers or

Re: [R] extract standard errors, write them to file

2007-01-12 Thread Sundar Dorai-Raj
Indermaur Lukas said the following on 1/12/2007 7:55 AM: > Hello > > I want to repeatedly extract coefficients and standard errors from a GLM and > write them into a file (1row=all coefficients of model A, 2 row=all > coefficients of model B, etc.). I can extract coefficients but not standard

Re: [R] How to get correct integration in C for step function?

2007-01-21 Thread Sundar Dorai-Raj
Hi, Lynette, A few pointers: 1. Not an R question. 2. Not an ESS question. 3. No reproducible example. 4. (x >= 1/4) is comparing a pointer. Surely, this is not what you intended to do. Plus, if you're using void* then this is not even a C function called by R. And I'm not familiar with Rdqags.

Re: [R] lattice: put key where unused panel would have been

2007-01-22 Thread Sundar Dorai-Raj
Benjamin Tyner said the following on 1/22/2007 3:18 PM: > Hi, > > Say I have > > z<-data.frame(y=runif(190), >x=runif(190), >f=gl(5,38), >g=gl(19,10)) > > plot<-xyplot(y~x|g, > data=z, >

Re: [R] Error in upgrade

2007-03-15 Thread Sundar Dorai-Raj
Giovanni Parrinello said the following on 3/15/2007 6:43 AM: > Dear All, > update.packages(ask='graphics') > --- Please select a CRAN mirror for use in this session --- > Error in .readRDS(pfile) : unknown input format. > ??? > TIA > Giovanni > I cannot replicate this in R-2.4.1. What version o

Re: [R] lattice key (legend) with both points and lines

2007-03-20 Thread Sundar Dorai-Raj
Peter McMahan said the following on 3/20/2007 3:16 PM: > Hello, > I'm running into a frustrating problem with the legend on a lattice > plot I'm working with. The plot is a stripplot with a panel.linejoin > () line running through the mean of each of the categories. Thus > there are both poi

Re: [R] conditional replacement

2006-05-23 Thread Sundar Dorai-Raj
Sachin J wrote: > Hi > > How can do this in R. > > >df > > 48 > 1 > 35 > 32 > 80 > > If df < 30 then replace it with 30 and else if df > 60 replace it with 60. > I have a large dataset so I cant afford to identify indexes and t

Re: [R] Joining variables

2006-05-24 Thread Sundar Dorai-Raj
Guenther, Cameron wrote: > Hello, > > If I have two variables that are factors or characters and I want to > create a new variable that is the combination of both what function can > I use to accomplish this? > > Ex. > > Var1 Var2 > SA100055113 19851113 > > And I wa

Re: [R] Wavelet Functions

2006-05-25 Thread Sundar Dorai-Raj
Peter Lauren wrote: > Does R have any wavelet functions? When I type > >>help.search("wavelet") > > I get > " No help files found with alias or concept or title > matching 'wavelet' using fuzzy matching." > > Thanks, > Peter. > > __ > R-help@stat.m

Re: [R] qqmath - Lattice error

2006-05-25 Thread Sundar Dorai-Raj
Witold Wolski wrote: > Hi, > > Don't have a clue what teh following error message > > > generated by this function call: > qqmath( ~val|ind,data = xx >,distribution = function(p){ qt(p,df=20)} >,ylab="Sample Quatinles" >,xlab="Theoretical Quantiles" > >,panel=f

Re: [R] mtext in trellis-loop & colorkey

2006-05-29 Thread Sundar Dorai-Raj
Marius Hofert wrote: > Hello, > > I would like to create a sequence of plots (using a for loop). I read > in the FAQ that print() has to be used in order to obtain any output. > This works perfectly fine as long as I only consider one function > call in the loop, but I would like to add mt

Re: [R] correlating values

2006-05-30 Thread Sundar Dorai-Raj
Ahamarshan jn wrote: > I did a correlation for the values > > - EX4577 EX4599 EX4566 EX4522 > WL917 2.53528 0.79077 0.21499 -0.01084 > WP429S-0.192723715 > WP819 -1.016997552 > WP977 1.378674-0.070710.6250890.4728363 > WI205S-0

Re: [R] merging

2006-05-30 Thread Sundar Dorai-Raj
Gavin Simpson wrote: > Dear List, > > Given, > > y <- matrix(c(0,1,1,1,0,0,0,4,4), ncol = 3, byrow = TRUE) > rownames(y) <- c("a","b","c") > colnames(y) <- c("1","2","3") > y > y2 <- y[2:3, ] > rownames(y2) <- c("x","z") > y2 > > how can I stop > > merge(y, y2, all = TRUE, sort = FALSE) > >

Re: [R] R search plug-in

2006-05-31 Thread Sundar Dorai-Raj
Hi, Arin, This was already done: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/53597.html And works well. Try "firefox search plugin". --sundar arin basu wrote: > Hi All: > > I have written an R search plug-in based on Prof Jonathan Baron's R search > site. This Firefox/Netscape plug-in le

Re: [R] trouble with boot ()

2006-05-31 Thread Sundar Dorai-Raj
Rogério Rosa da Silva wrote: > Dear members, > > > I am trying to use boot () to compute the distributions of a statistic > of a data set. The statistic is defined in the following code: > > eds<-function(x) { > r<-cor(x) > paren<-1-abs(r)/2 >

Re: [R] Key titles in Lattice

2006-06-01 Thread Sundar Dorai-Raj
Kuhn, Max wrote: > Hi, > > I'm creating some lattice plots that have a key and I'd like to put a > label on the key. The problem is that the text label for the key > prevents the values of the group variables from being shown (see example > below). I don't think that this is a feature, but I mig

Re: [R] quantile() with weights

2006-06-09 Thread Sundar Dorai-Raj
Wouter wrote: > Hi list, > > I'm looking for a way to calculate quantiles (such as in quantile()), but > with the ability to assign a different weight to each member of the sample > vector. > > It is possible to write it out completely, but maybe there is a dedicated > function out somewhere

Re: [R] quantile() with weights

2006-06-09 Thread Sundar Dorai-Raj
Wouter wrote: > Hi list, > > I'm looking for a way to calculate quantiles (such as in quantile()), but > with the ability to assign a different weight to each member of the sample > vector. > > It is possible to write it out completely, but maybe there is a dedicated > function out somewhere

Re: [R] function parameters - testing

2006-06-09 Thread Sundar Dorai-Raj
Larry Howe wrote: > Hello, > > I am trying to test a function argument to see if it is or is not a useful > number. However I cannot seem to find a test that works. For example > > >>f = function(x) { > > + print(exists("x")) > + print(is.null(x)) > + } > >>rm(x) >>f(z) > > [1] TRUE > Er

Re: [R] if syntax error :(

2006-06-13 Thread Sundar Dorai-Raj
Sarah Goslee wrote: > You need more brackets: > > if(blah) { > do something > } else { > do something different > } > > Sarah > > PS Using underscores in variable names is not encouraged, and > can cause you problems in certain contexts. > Hi, Sarah, Why do you say this? And in what sit

[R] changes to terms.formula in 2.3.x

2006-06-20 Thread Sundar Dorai-Raj
Hi, all, I just recently noticed a change in terms.formula from 2.2.1 to 2.3.1 (possibly 2.3.0, but I didn't check). Here's the problem: ## 2.2.1 > update(~ x | y, z ~ .) z ~ x | y ## 2.3.1 > update(~ x | y, z ~ .) z ~ (x | y) and in the NEWS for 2.3.1 o terms.formula needed to add p

Re: [R] changes to terms.formula in 2.3.x

2006-06-20 Thread Sundar Dorai-Raj
Thanks, Gabor. Works like a charm. --sundar Gabor Grothendieck wrote: > Try this: > >> fo <- ~ x | y >> fo[[3]] <- fo[[2]] >> fo[[2]] <- as.name("z") >> fo > > z ~ x | y > > On 6/20/06, Sundar Dorai-Raj <[EMAIL PROTECTED]&

Re: [R] xyplot, type="b"

2006-06-20 Thread Sundar Dorai-Raj
I think Paul's suggestion works if you use: panel.points(x, y, col = "white", cex = 1.5, pch = 16, ...) instead of the default background color. For me trellis.par.get("background")$col returns "transparent". HTH, --sundar Benjamin Tyner wrote: > I can imagine the intended effect of this, bu

Re: [R] IMSL Wrapper

2006-06-21 Thread Sundar Dorai-Raj
Manoj wrote: > Dear All, >Is there any Wrapper written around IMSL C libraries that makes > it possible to access the IMSL C functions from within R? > > Any pointers would be greatly appreciated! > > Cheers > > Manoj > What functions are you looking for? I'd be surprised if

Re: [R] PowerPoint

2006-06-23 Thread Sundar Dorai-Raj
Hi, all, (Sorry to highjack the thread, but I think the OP should also know this) One of the plots Marc mentions is xyplot. Has anybody else on this list had a problem with lattice and win.metafile (or Ctrl-W in the R graphics device)? I will sometimes import wmf files (or Ctrl-V) with lattice

Re: [R] PowerPoint

2006-06-23 Thread Sundar Dorai-Raj
> as the reappearance of the missing lines on re-sizing shows that that the > necessary information **is** in the imported .wmf file, right? > > -- Bert > > > >>-Original Message- >>From: [EMAIL PROTECTED] >>[mailto:[EMAIL PROTECTED] On Behalf Of Sund

Re: [R] Running executable files from R

2006-06-23 Thread Sundar Dorai-Raj
Julian Burgos wrote: > Hello fellow R's, > > I apologize if this question was answer elsewhere. I have an executable > file that I need to run from R. Basically I want to use R to create the > input files this executable requires, then run it, and finally use R > again to analyze the output

Re: [R] How to generate a figure using par( ) with some densityplot( )'s

2006-06-26 Thread Sundar Dorai-Raj
Amir Safari wrote: > > Hi Dear R users, > For a pair plotting, usaully we use par( ) function. Apparently it does not > work anywhere. I want to have 3 plots in a single figure, like this: > par(mfrow=c(3,1)) > densityplot( a) > densityplot(b) > densityplot(c) > But it does not

Re: [R] Finding a color code.

2006-06-26 Thread Sundar Dorai-Raj
A Ezhil wrote: > Hi, > > Is it possible to find corresponding color code in R > for the following RGB (R185, G35 & B80)? > > Thanks in advance. > > Best regards, > Ezhil > How about: x <- c(185, 35, 80) class(x) <- "hexmode" paste("#", paste(format(x), collapse = ""), sep = "") [1] "#b923

Re: [R] How to generate a figure using par( ) with some densityplot( )'s

2006-06-26 Thread Sundar Dorai-Raj
Deepayan Sarkar wrote: > On 6/26/06, Sundar Dorai-Raj <[EMAIL PROTECTED]> wrote: > >> >> >> Amir Safari wrote: >> > >> > Hi Dear R users, >> > For a pair plotting, usaully we use par( ) function. Apparently it >> does not wor

Re: [R] Inverse Error Function

2006-06-26 Thread Sundar Dorai-Raj
Nathan Dabney wrote: > Do any of the R libraries have an implementation of the Inverse Error > Function (Inverse ERF)? > > ref: > http://mathworld.wolfram.com/InverseErf.html > http://functions.wolfram.com/GammaBetaErf/InverseErf/ > > Thanks, > Nathan > > [[alternative HTML version delet

Re: [R] numerical integration problem

2006-06-29 Thread Sundar Dorai-Raj
przeszczepan wrote: > Hi, > > I have got problems integrating the following function using "integrate": > > lambdat<-function(t){ > tempT<-T[k,][!is.na(T[k,])]#available values from k-th row of matrix T > tempJ<-J[k,][!is.na(J[k,])] > > hg<-length(tempT[tempT<=t & tempJ==0])#counts observatio

Re: [R] Colinearity Function in R

2006-07-05 Thread Sundar Dorai-Raj
Peter Lauren wrote: > Is there a colinearty function implemented in R? I > have tried help.search("colinearity") and > help.search("collinearity") and have searched for > "colinearity" and "collinearity" on > http://www.rpad.org/Rpad/Rpad-refcard.pdf but with no > success. > > Many thanks in ad

Re: [R] i suspect that there a memory leak in "vmmin"?

2006-07-05 Thread Sundar Dorai-Raj
Vumani Dlamini wrote: > Dear listers, > Am currently using MCMC approaches to estimate some parameters of my model. > One parameter has to be updated using a tuned gamma distribution. So at each > iteration I estimate the mean and variance of the density of the gamma > approximation using "vmm

Re: [R] use of NULL environment is deprecated?

2006-07-11 Thread Sundar Dorai-Raj
Patrick Connolly wrote: > ]> version >_ > platform x86_64-unknown-linux-gnu > arch x86_64 > os linux-gnu > system x86_64, linux-gnu > status

[R] RODBC, missing values, and Excel

2006-07-12 Thread Sundar Dorai-Raj
Hi, all, I'm trying to use RODBC to read data from Excel. However, I'm having trouble converting missing values to NA and rather perplexed by the output. Below illustrates my problem: ## DATA - copy to Excel and save as "tmp.xls" ## tmp.xls!Sheet1 x 0.11 0.11 na na na 0.11 ## tmp.xls!Sheet2 x

Re: [R] RODBC, missing values, and Excel

2006-07-12 Thread Sundar Dorai-Raj
>>R.version.string # XP > > [1] "Version 2.3.1 Patched (2006-06-04 r38279)" > >>packageDescription("gdata")$Version > > [1] "2.1.2" > >>packageDescription("RODBC")$Version > > [1] "1.1-7" > > > On

Re: [R] RODBC, missing values, and Excel

2006-07-13 Thread Sundar Dorai-Raj
onality its not that difficult to access >>it yourself. Assume your excel file is in \test.xls . Just >>switch to that folder. paste together a command to run the perl >>program, run it, get a list of the file names it produced and read them in: >> >>library(gdata) >

Re: [R] Sweave and multipage lattice

2006-07-19 Thread Sundar Dorai-Raj
Dieter Menne wrote: > Dear R-Listeners, > > as the Sweave faq says: > > http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html > > creating several figures from one figure chunk does not work, and for > standard graphics, a workaround is given. Now I have a multipage trellis > plot with an a-prior

Re: [R] Wrap a loop inside a function

2006-07-19 Thread Sundar Dorai-Raj
Doran, Harold wrote: > I need to wrap a loop inside a function and am having a small bit of > difficulty getting the results I need. Below is a replicable example. > > > # define functions > pcm <- function(theta,d,score){ > exp(rowSums(outer(theta,d[1:score],'-')))/ > apply(exp(apply

Re: [R] throwaway() function

2006-07-20 Thread Sundar Dorai-Raj
John Wiedenhoeft wrote: > Dear all, > > I apologize if this is a FAQ (seems a bit like one, but I didn't find > anything). > > I'm looking for an easy way to cut one value out of a vector and shorten > the vector accordingly. Something like: > > x <- c(1, 1, 0, 6, 2) > throwaway(x[3]) > > which

Re: [R] intersect of list elements

2006-07-21 Thread Sundar Dorai-Raj
Georg Otto wrote: > Hi, > > i have a list of several vectors, for example: > > >>vectorlist > > $vector.a.1 > [1] "a" "b" "c" > > $vector.a.2 > [1] "a" "b" "d" > > $vector.b.1 > [1] "e" "f" "g" > > > I can use intersect to find elements that appear in $vector.a.1 and > $vector.a.2: > >

Re: [R] combining dataframes with different numbers of columns

2006-11-07 Thread Sundar Dorai-Raj
hadley wickham said the following on 11/7/2006 8:46 PM: > On 11/7/06, Denis Chabot <[EMAIL PROTECTED]> wrote: >> Dear list members, >> >> I have to combine dataframes together. However they contain different >> numbers of variables. It is possible that all the variables in the >> dataframe with f

Re: [R] Question about error message - or is it a bug?

2006-11-10 Thread Sundar Dorai-Raj
Carmen Meier said the following on 11/10/2006 9:46 AM: > Hi to all ... the same code, but another question. > > I changed only the type='n' to type='l' and debugged the function xy.coords. > with type = 'l' : > there are the correct values of x and y inside the function xy.coords > but the y valu

Re: [R] lattice plots - variables in columns

2006-12-04 Thread Sundar Dorai-Raj
Matt Pocernich said the following on 12/4/2006 12:32 PM: > I an using xyplot in lattice. I have data in a dataframe. Some columns > contains data, each from a different group. Is there a direct way to > specify a range of column names as a grouping variables? Currently, I > am stacking the d

Re: [R] How to use read.xls in R

2006-12-07 Thread Sundar Dorai-Raj
Lisa Wang said the following on 12/7/2006 3:01 PM: > Hello there, > > In gdata package, read.xls is to be used for reading excel data (from > windows). > The following is my code:('C:/session/sampledata.xls' is where the file > is stored) > > data1<-read.xls('C:/session/sampledata.xls',sheet=1

Re: [R] sapply problem

2006-12-14 Thread Sundar Dorai-Raj
Joerg van den Hoff said the following on 12/14/2006 7:30 AM: > I have encountered the following problem: I need to extract from > a list of lists equally named compenents who happen to be 'one row' > data frames. a trivial example would be: > > a <- list(list( > df = data.frame(A = 1, B = 2, C =

Re: [R] problem using uniroot with integrate

2005-03-09 Thread Sundar Dorai-Raj
Ken Knoblauch wrote on 3/9/2005 10:27 AM: Hi, I'm trying to calculate the value of the variable, dp, below, in the argument to the integral of dnorm(x-dp) * pnorm(x)^(m-1). This corresponds to the estimate of the sensitivity of an observer in an m-alternative forced choice experiment, given the

Re: [R] Lattice device page options-margins

2005-03-09 Thread Sundar Dorai-Raj
Bock, Michael wrote on 3/9/2005 1:19 PM: I am using lattice to make figures as pdfs: trellis.device(device = "pdf",file = "Figure6.pdf",color = FALSE) I need to specify some blank space on the left-hand margins (the pages will be bound so we need about 0.5 inch)). I have tried a number of solution

Re: [R] How to get standard deviation of rows in a matrix

2005-03-10 Thread Sundar Dorai-Raj
Jagarlamudi, Choudary wrote on 3/9/2005 1:49 PM: Hi all, I am trying to find sd of my rows in a matrix and i get column sd inspite of extracting rows. I tried to do the sqrt(var(x)) but that did'nt work as well, Here is my data genes 15 24 63 40 25 42 46 35 23 53 37 45 30 37 50 55 40 51 3

Re: [R] Note: "The default device has been opened to honour attempt to modify trellis settings"

2005-03-16 Thread Sundar Dorai-Raj
Luis Ridao Cruz wrote on 3/16/2005 5:16 AM: R-help, I'm using a function whose end result is a trellis plot. When I call the function I get sometimes the following message: "Note: The default device has been opened to honour attempt to modify trellis settings " leading up to any plot whatsoever. I

Re: [R] Summing up matrices in a list

2005-03-16 Thread Sundar Dorai-Raj
Vicky Landsman wrote on 3/16/2005 10:21 AM: Dear all, I think that my question is very simple but I failed to solve it. I have a list which elements are matrices like this: mylist [[1]] [,1] [,2] [,3] [1,]135 [2,]246 [[2]] [,1] [,2] [,3] [1,]79 11

Re: [R] Help in persp (VERY URGENT ASSISTANCE)

2005-03-16 Thread Sundar Dorai-Raj
Lakshmi Dhevi Baskar wrote on 3/16/2005 12:02 PM: Dear All, I am very new to R projects.May be i am wrong in some steps.I have given the code which i tried for drawing 3d surface using persp.I need to label the axes with scales z <- array(topnew2$V2, dim=c(600,2)) x <- 10 * (1:nrow(z)) y

correlation with NA (was Re: [R] (no subject))

2005-03-16 Thread Sundar Dorai-Raj
Brett Stansfield wrote on 3/16/2005 3:54 PM: Dear R I'm trying to do a correlation matrix for some variables I have. Unfortunately there are some NA entries for some of the variables I tried the following cor(sleep[c("logbw", "logbrw", "SlowSleep", "ParaSleep", "loglife", "loggest")]) but it tol

Re: [R] Line plot using xyplot function in lattice package

2005-03-17 Thread Sundar Dorai-Raj
Ghosh, Sandeep wrote on 3/17/2005 1:25 PM: Hi All, For the following data when I use xyplot in package lattice the intervals are in the order of 2, 24, 8, but instead I want them to be in the order 2, 8, 24. Treatment Interval value A 2 0.448 A24

Re: [R] Line plot using xyplot function in lattice package

2005-03-17 Thread Sundar Dorai-Raj
Sundar Dorai-Raj wrote on 3/17/2005 2:27 PM: Ghosh, Sandeep wrote on 3/17/2005 1:25 PM: Hi All, For the following data when I use xyplot in package lattice the intervals are in the order of 2, 24, 8, but instead I want them to be in the order 2, 8, 24. Treatment Interval value A

Re: [R] (no subject)

2005-03-17 Thread Sundar Dorai-Raj
Please use a meanful subject line! You want SlowSleep == 7.7, not SlowSleep = 7.7. Have you read the posting guide as others (including myself) have suggested? Have you also read "An Introduction To R," which comes with all R distributions? --sundar Brett Stansfield wrote on 3/17/2005 8:09 PM: I

Re: [R] (no subject)

2005-03-17 Thread Sundar Dorai-Raj
Please use a meaningful subject line! You want SlowSleep == 7.7, not SlowSleep = 7.7. Have you read the posting guide as others (including myself) have suggested? Have you also read "An Introduction To R," which comes with all R distributions? --sundar Brett Stansfield wrote on 3/17/2005 8:09 PM

Re: [R] Lattice - parallel: xlim and adding lines

2005-03-29 Thread Sundar Dorai-Raj
T.A.Wassenaar wrote on 3/29/2005 2:17 PM: Hi, I'm trying to set the minimum and maximum in a parallel plot, but trying xlim=c(-1,1) gives strange results. Am I missing something? The call I give is: parallel(~X[,c(6,9,12,15,18)]|X$ff,X,panel=panel.parallel.new,groups=X$protein,layout=c(3,1),xli

Re: [R] Lattice - parallel: xlim and adding lines

2005-03-29 Thread Sundar Dorai-Raj
wd, lty = superpose.line$lty, ...) { superpose.line <- trellis.par.get("superpose.line") panel.abline(v = 0.5, lwd = 3) panel.parallel(z, subscripts, col, lwd, lty, ...) } HTH, --sundar On Tue, 29 Mar 2005 14:42:05 -0600 Sundar Dorai-Raj <[EMAIL

Re: [R] is there a function like %in% for characters?

2005-04-03 Thread Sundar Dorai-Raj
Terry Mu wrote on 4/2/2005 9:38 PM: like: "a" %in% "abcd" TRUE Thanks. See ?regexpr. regexpr("a", "abcd") > 0 However, the first argument is not vectorized so you may also need something like: > sapply(c("a", "b", "e"), regexpr, c("abcd", "bcde")) > 0 ab e [1,] TRUE TRUE FALSE

Re: [R] plotting mathematical notation and values substitution

2005-04-04 Thread Sundar Dorai-Raj
Luca Scrucca wrote on 4/4/2005 1:50 PM: Dear R-users, I'm trying to add a title on a plot with both mathematical notation and values substitution. I read the documentation and search the mailing list but I was not able to solve my problem. Actually, there is a message by Uwe Ligges on June 2003 wh

Re: [R] Error in hist.default(A) : `x' must be numeric

2005-04-06 Thread Sundar Dorai-Raj
Mag. Ferri Leberl wrote on 4/6/2005 9:57 AM: Dear everybody! I have load a list A of numbers and want a histogram to be drawn. on hist(Y) the Machine returns: Error in hist.default(A) : `x' must be numeric I found out, that the list is of type data.frame. Y<-as.numeric(Y) returns Error in as.doubl

correlation by group (was Re: [R] kunamorph@web.de)

2005-04-08 Thread Sundar Dorai-Raj
Christfried Kunath wrote on 4/8/2005 10:39 AM: Hello, how can I use the function "cor()" with x and y in function "aggregate()" or "by()"? The data are like this: x y group 1 4 B 2 4 B 3 5 C I would like obtain the correlation between x and y for each subset. I don't want to use

Re: [R] Trying to undo an assignment

2005-04-11 Thread Sundar Dorai-Raj
Uzuner, Tolga wrote on 4/11/2005 7:33 AM: Hi, I defined corr to be a function, not realising that this was also the name for correlation in package=boot. How do I explicitly call the corr function within package boot (so, scope up over the current frame, I guess is another way of saying it) withou

Re: [R] not plotting when non-existent

2005-04-12 Thread Sundar Dorai-Raj
Luis Ridao Cruz wrote on 4/12/2005 10:08 AM: R-help, I'm trying to plot the following: year lgd 1 1986 136.97479 2 1987 69.10377 3 1988 67.66744 4 1989 71.60316 5 1990 62.06897 6 1992 6.25000 7 1993 27.72021 8 1995 23.83648 9 1996 10.29412 10 1997 95.67487 11 1998 82.

Re: [R] aggregation question

2005-04-15 Thread Sundar Dorai-Raj
Christoph Lehmann wrote on 4/15/2005 9:51 AM: Hi I have a question concerning aggregation (simple demo code S. below) I have the data.frame idmeas date 1 a 0.6375137471 2 a 0.1877100632 3 a 0.2470984592 4 a 0.3064476903 5 b 0.4075735772 6 b 0.783255085

Re: [R] example on front page doesn't work in R 2.0.1

2005-04-15 Thread Sundar Dorai-Raj
Hubert Feyrer wrote on 4/15/2005 3:04 PM: On http://www.r-project.org/, there is an R script linked to the top graphic, http://www.r-project.org/misc/acpclust.R. This script says it works in R 1.8.1, but in 2.0.1 it gives (me): source("acpclust.R") Loading required package: ade4 Loading require

Re: [R] example on front page doesn't work in R 2.0.1

2005-04-15 Thread Sundar Dorai-Raj
Hubert Feyrer wrote on 4/15/2005 3:43 PM: On Fri, 15 Apr 2005, Sundar Dorai-Raj wrote: Loading required package: ade4 Loading required package: mva Loading required package: RColorBrewer Loading required package: pixmap Loading required package: ade4 Error in plotacpclust(swiss[, 1:5], 1, 3, hcut

Re: [R] A question about function behavior

2005-04-20 Thread Sundar Dorai-Raj
Jorge Ahumada wrote on 4/20/2005 12:02 PM: Hello, I have been trying to figure this one out, but don't seem to go anywhere. I have a function like this: a = function(t) { max(0,t+1) } very simple, but if I pass a vector of n values to this function I expect n evaluations of max and instead I ge

Re: [R] CRAN mirror - how many amount?

2005-04-21 Thread Sundar Dorai-Raj
Lukasz Komsta wrote on 4/21/2005 10:54 AM: Dear colleagues, I have just read http://cran.r-project.org/mirror-howto.html, but there is no information what amount of disk space is enough to download complete CRAN copy and setup a mirror. Is there any person informed here? Regards, Others might c

Re: [R] Split dataset as factor and numeric

2005-04-27 Thread Sundar Dorai-Raj
Jan Sabee wrote on 4/27/2005 5:58 AM: Dear all, If I have dataset like, A125 B 2 AA0 C 0 A11 B 3 A10 C 3 B 0 A145 A17 C 0 B 0 A10 B 6 B 3 Is there any function to split like, A125 A11 A10 A145 A17 A10 or AA

Re: [R] Automating plot labelling in custom function in lapply() ?

2005-04-29 Thread Sundar Dorai-Raj
Gavin Simpson wrote on 4/29/2005 5:00 AM: Dear List, Consider the following example: dat <- data.frame(var1 = rnorm(100), var2 = rnorm(100), var3 = rnorm(100), var4 = rnorm(100)) oldpar <- par(mfrow = c(2,2), no.readonly = TRUE) invisible(lapply(dat, function(x)

Re: [R] summary(as.factor(x) - force to not sort the result according factor levels

2005-05-02 Thread Sundar Dorai-Raj
Christoph Lehmann wrote on 5/2/2005 3:29 PM: Hi The result of a summary(as.factor(x)) (see example below) call is sorted according to the factor level. How can I get the result not sorted but in the original order of the levels in x? > test <- c(120402, 120402, 120402, 1323, 1323,200393, 20039

Re: [R] bivariate log-normal distribution

2005-05-02 Thread Sundar Dorai-Raj
Dimitri Joe wrote on 5/2/2005 5:29 PM: Hi, I am looking for the density function of the bivariate log-normal distribution. Would anyone have it written? Thanks a lot, Dimitri [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch maili

Re: [R] Lattice dotplot with symbols sized and colored

2005-05-03 Thread Sundar Dorai-Raj
David Kidd wrote on 5/3/2005 3:08 AM: Apologies if this is a naive beginners question. I am trying to create a dotplot with the lattice dotplot function in which my dots are colored differently depending on if positive or negative and sized by sp.nc.bdrs.data$mwZ I have tried... dotplot(sporder

Re: [R] Using "|"

2005-05-03 Thread Sundar Dorai-Raj
Jim Milks wrote on 5/3/2005 8:34 AM: Dear all, I have a rodent dataset that I am reanalyzing. The set consists of several variables (#Microtus captured, Grass stems/m^2, etc), among which is a Grid factor variable c(North,South). I have evidence that there are significant differences in veget

Re: [R] JGR and R 2.0.X

2005-05-04 Thread Sundar Dorai-Raj
Christoph Scherber wrote on 5/4/2005 4:44 AM: Dear all, I am running Windows XP with several parallel installations of R (2.0.1; 2.1 and so on). How can I install JGR for the 2.0.1 version? I keep on getting error messages when trying to install it. Best wishes Christoph Hi Christoph, Which ver

Re: [R] rank of a matrix

2005-05-04 Thread Sundar Dorai-Raj
mingan wrote on 5/4/2005 8:54 AM: how do I check the rank of a matrix ? say A= 1 0 0 0 1 0 then rank(A)=2 what is this function? thanks I did try help.search("rank"), but all the returned help information seem irrelevant to what I want. I would like to know how people search for h

Re: [R] body of non-visible function

2005-05-05 Thread Sundar Dorai-Raj
Anna Oganyan wrote on 5/5/2005 7:42 AM: Hello, Is there any possibility in R to see the body of the “non-visible” function, for example “princomp”? If I do : > methods(princomp) so, I get that princomp.default and princomp.formula are non-visible functions and body(princomp.default) doesn’t sh

Re: [R] Need some quick help with lattice - barchart

2005-05-05 Thread Sundar Dorai-Raj
Ghosh, Sandeep wrote on 5/5/2005 11:10 AM: For the following code below, the x-axis ticks are 1,2,3,4,5,6,7 when I was expection them to be 1,2,8,9,10,11,12. Please help me figure out where is the mistake. library(lattice) testdata <- as.data.frame(t(structure(c( 1,2005,9.24,6.18,634, 2,2005,8.6

Re: [R] Re: Need some quick help with lattice - barchart

2005-05-05 Thread Sundar Dorai-Raj
Deepayan Sarkar wrote on 5/5/2005 12:03 PM: On Thursday 05 May 2005 13:10, Ghosh, Sandeep wrote: For the following code below, the x-axis ticks are 1,2,3,4,5,6,7 when I was expection them to be 1,2,8,9,10,11,12. Please help me figure out where is the mistake. [...] colnames(testdata) <- c('month',

Re: [R] how to get such a subset of a matrix?

2005-05-06 Thread Sundar Dorai-Raj
Xiao Shi wrote on 5/6/2005 6:21 AM: Hi everybody, Maybe this question is quite simple but i just don't know how to make it. I have a matrix a somewhat like this one but bigger: a f g h i j k a NA NA 11 16 21 26 b NA NA 12 17 22 27 c NA 8 13 18 23 28 d NA 9 14 19 24 29 e NA 10 15 20 25 30 And i wan

Re: [R] acf problem ?

2005-05-12 Thread Sundar Dorai-Raj
Ernesto Jardim wrote on 5/12/2005 11:01 AM: Hi I'm getting the following error that do not make sense to me, what am Idoing wrong ? > acf(Recsim[1,], lag.max=1) Error in acf(Recsim[1, ], lag.max = 1) : 'lag.max' must be at least 1 Regards EJ Hi, Ernesto, What is Recsim[1,]? I can reproduce this

Re: [R] lattice plots question

2005-05-18 Thread Sundar Dorai-Raj
Laura Holt wrote: Dear R People: Is there any way to have the background of lattice plots be white instead of grey, please? This is not a criticism by any means...the lattice stuff is UNbelievable! Thanks, Laura Holt mailto: [EMAIL PROTECTED] R Version 2.1.0 Windows Hi, Laura, See ?trellis.par.

Re: [R] attached file with syntax error

2005-05-20 Thread Sundar Dorai-Raj
You can in R-2.1.0 Patched: > c(1,) [1] 1 --sundar Eric Lecoutre wrote: Well... You just can't end vector declaration with a comma... x <- c(0,1,) Error: syntax error x <- c(0,1) Eric Eric Lecoutre UCL / Institut de Statistique Voie du Roman Pays, 20 1348 Louvain-la-Neuve Belgium tel: (+32)(0)10

Re: [R] Deleting multiple rows from a matrix

2005-05-25 Thread Sundar Dorai-Raj
Gottfried Gruber wrote: Hi, i want to delete multiple rows from a matrix. I know how to delete one by x=x[,-3] # deleting 3. column Is there a quick method how to delete e.g. the 3., 5., 7. and 8. column at once? TiA gg x[, -c(3, 5, 7, 8)] --sundar _

Re: [R] DOING CLUSTERING WITH THE EM ALGORITHM

2005-05-25 Thread Sundar Dorai-Raj
Dominique Emmanuel wrote: Hello, I am looking for documentation (PDF ?) about doing clustering with the EM Algorithm on R... I'm sorry for this question which may be trivial... Thanks... Dominique Your question is a bit vague, but the mclust package might be what you're looking for. Fro

Re: [R] setting elements of matrix

2005-05-25 Thread Sundar Dorai-Raj
Richard Valliant wrote: This is, no doubt, an easy problem, but I need help. I want to set values in a matrix based on entries in a vector. Here is an example: D is an r x m matrix initilized to all zeroes. r=6, m=5 in the example. Ro <- c(1, 3, 4, 4, 6) Co <- c(1, 2, 3, 4, 5) I want to

Re: [R] Linear system

2005-05-25 Thread Sundar Dorai-Raj
Jim Gustafsson wrote: Dear R-help I have a problem solving a linear system like 353a+45b+29c=79 45a+29b+3c=5 29a+3b+4c=8 Is there any way of doing this in R? Best Regards Jim Use ?solve: X <- matrix(c(353, 45, 29, 45, 29, 3, 29, 3, 4), 3, 3, byrow = TRU

Re: [R] To find how R defined the function of "coxph"?

2005-05-26 Thread Sundar Dorai-Raj
Li, Jia wrote: Dear all, I am wondering if there is a way to find how R defined(or wrote) the function of "coxph"? I don not mean the one that we get by checking help(coxph), but the one like coxph<-function(){...} Thanks, Jia At the commandline, type the following: library(surviv

<    1   2   3   4   5   6   7   >