Re: [R] Question about evalq

2007-05-28 Thread ronggui
Got it. Thanks very much. On 5/28/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: How about 'traceback'? (It does not necesssarily show all the frames, but it does help and the exceptions are fairly esoteric.) On Mon, 28 May 2007, ronggui wrote: In that the meaning of parent.frame depends

Re: [R] error: GLX extension missing on server

2007-05-28 Thread Alexander.Herr
Thanks Brian, I have Load glx in the Module section of xorg.conf - However, based on my latest probing the graphics card is not in the opensuse xgl database, and the 3D acceleration is not enabled. So I will have to wait till a new package comes available with the driver for the intel GMA

[R] problems with index within a strata

2007-05-28 Thread Vumani Dlamini
dear useRs, I have several datasets which are in repeated measurements format and I would like to extract the first measurement for each individual. In some cases measurements of certain characteristics are also stacked on top of each other and thats where the problem lies. A prototype of the

Re: [R] pie chart in lattice - trellis class

2007-05-28 Thread Patrick Giraudoux
Deepayan Sarkar a écrit : On 5/27/07, Patrick Giraudoux [EMAIL PROTECTED] wrote: Dear all, After going through the Lattice doc and R-help list and google, I got the feeling that there is no function in lattice or other package to compute a pie chart object of class trellis. Although pie

Re: [R] na.approx and columns with NA's

2007-05-28 Thread antonio rodriguez
Dear Gabor, In order to perform your suggestion I needed to split my 'big' 720*5551 matrix into small ones of the type: 720*400 due to memory constraints. But after performing the task I get less rows in the new matrix. For example: zz1-zz[,1:400] dim(zz1) [1] 720 400 zz1[,1] 1985-01-05

Re: [R] learning lattice graphics

2007-05-28 Thread Ulises M. Alvarez
Adrian Dragulescu wrote: Check the documentation link from http://cm.bell-labs.com/cm/ms/departments/sia/project/trellis/software.writing.html Adrian On 5/26/07, Tyler Smith [EMAIL PROTECTED] wrote: Hi, I've just produced my first lattice plot - the graphic is very impressive, but I

[R] using cutree() to figure out the heatmap cluster labels on the left

2007-05-28 Thread Andrew Yee
I've been using heatmap(), hclust(), and cutree(), and I'm trying to figure out the column labels of the left (as opposed to the right) cluster. Using cutree(x, k=2), I get two clusters labeled 1 and 2. How do you figure out if cluster 2 is the one associated with the left cluster on the heatmap

[R] Yearly statistics

2007-05-28 Thread Alfonso Sammassimo
Dear R-experts, Sorry if I've overlooked a simple solution here. I have calculated a proportion of the number of observations which meet a criteria, applied to five years of data. How can I break down this proportion statistic for each year? For example (data in zoo format):

Re: [R] ratio distribution - missing attachment

2007-05-28 Thread Martin Maechler
Thank you, Ravi. You probably will have noticed, that the attachment didn't make it to the mailing list. The reason is that the we let the mailing list software strip binary attachments which can easily be misused to spread viruses; see -- http://www.r-project.org/mail.html (search attachment)

Re: [R] File path expansion

2007-05-28 Thread Martin Maechler
Duncan == Duncan Murdoch [EMAIL PROTECTED] on Fri, 25 May 2007 15:38:54 -0400 writes: Duncan On 5/25/2007 1:09 PM, Prof Brian Ripley wrote: On Fri, 25 May 2007, Martin Maechler wrote: path.expand(~) [1] /home/maechler Yes, but beware that may not do what

Re: [R] File path expansion

2007-05-28 Thread Prof Brian Ripley
On Mon, 28 May 2007, Martin Maechler wrote: Duncan == Duncan Murdoch [EMAIL PROTECTED] on Fri, 25 May 2007 15:38:54 -0400 writes: Duncan On 5/25/2007 1:09 PM, Prof Brian Ripley wrote: On Fri, 25 May 2007, Martin Maechler wrote: path.expand(~) [1] /home/maechler

Re: [R] normality tests [Broadcast]

2007-05-28 Thread Martin Maechler
LuckeJF == Lucke, Joseph F [EMAIL PROTECTED] on Fri, 25 May 2007 12:29:49 -0500 writes: LuckeJF Most standard tests, such as t-tests and ANOVA, LuckeJF are fairly resistant to non-normalilty for LuckeJF significance testing. It's the sample means that LuckeJF have to be

Re: [R] creating txt file from data.frame

2007-05-28 Thread Vladimir Eremeev
apply(dfr,1,FUN=function(x){ cat(c(x[1], ifelse(x[2]==x[3],x[2],paste(x[2],x[3],sep=-)),\n), file=filename.txt) }) This code assumes the data frame with at least 3 columns, errors will occur if there will be

Re: [R] 'trim' must be numeric of length one?

2007-05-28 Thread Gavin Simpson
On Mon, 2007-05-28 at 10:58 +0800, Ruixin ZHU wrote: Hi everybody, When I followed a practice example, I got an error as follows: ### cc-read.table('example5_2.dat',header=TRUE)

Re: [R] Yearly statistics

2007-05-28 Thread jim holtman
Here is one way to break it down to years. x -open high lowclose hc lc + 2004-12-29 4135 4135 4106 4116 8 -21 + 2004-12-30 4120 4131 4115 4119 15 -1 + 2004-12-31 4123 4124 4114 4117 5 -5 + 2005-01-04 4106 4137 4103 4137 20 -14 + 2005-01-06 4085 4110 4085

Re: [R] na.approx and columns with NA's

2007-05-28 Thread Gabor Grothendieck
Without a small reproducible example there is not much to say. Try cutting the columns down to half successively until you have an object with 4 columns that exhibits the same behavior and then do the same with rows until you get a 4x6 example. Here is another, slightly shorter, solution:

[R] RODBC and Date/Time variables

2007-05-28 Thread David Scott
This is really a query about MySQL which I am trying to use to set up a database which I will then access with RODBC. I have my data in a .csv file, and some of the fields are date/time fields. I tried to create a table using mysql with the definition of the date/time field given by CallDate

Re: [R] Yearly statistics

2007-05-28 Thread Gabor Grothendieck
Here are a couple of solutions: 1. using zoo package First add Date to the header so there are the same number of column headers as columns and then read in using read.zoo. Then aggregate over years using mean. For more on zoo try library(zoo); vignette(zoo) and for more on dates see the R

Re: [R] RODBC and Date/Time variables

2007-05-28 Thread Prof Brian Ripley
I do this by having a POSIXct variable in R and using sqlSave in RODBC to write the SQL table. Examples are part of my test suite, so I am sure they do work. It is not at all clear how you are trying to import the data into MySQL. On Tue, 29 May 2007, David Scott wrote: This is really a

Re: [R] pie chart in lattice - trellis class

2007-05-28 Thread Patrick Giraudoux
Jim Lemon a écrit : Patrick Giraudoux wrote: Dear all, After going through the Lattice doc and R-help list and google, I got the feeling that there is no function in lattice or other package to compute a pie chart object of class trellis. Although pie charts are obviously not considered

Re: [R] pie chart in lattice - trellis class

2007-05-28 Thread Ben Bolker
P Yes indeed. Thats' likely what I am going to do. Anyway, to plot axes, labels of sophisticated graphs on maps may be interesting anyway. For instance, we are monitoring fox and hare populations in tens of game areas. Drawing observations (panel.xyplot) over time and representing the

Re: [R] RODBC and Date/Time variables

2007-05-28 Thread Gabor Grothendieck
Without any code in your post (see last line of every post to r-help) its impossible to really know what you are doing but here is an example: library(RODBC) channel - odbcConnect(db01) # existing data base # add a table with a datetime field sqlQuery(channel, create table table02 (field01

[R] monthly least squares estimation

2007-05-28 Thread Benoit Chemineau
Hi R-programmers ! I would like to perform a linear model regression month by month using the 'lm' function and i don't know how to do it. The data is organised as below: Month ExcessReturn Return STO 8 0.047595875 0.05274292 0.854352503 8 0.016134874 0.049226941 4.399372005 8

[R] How to use filter function for this?

2007-05-28 Thread Farhat Iqbal
Hello, I have been trying to compute the following: for(t in 3:n){ h[t]-(omegac/(1-betac))+alphac*Y[t-1] b[t]-Y[t-1] bb[t]-0 for(j in 2:(t-1)){ h[t]-h[t]+alphac*((betac)^(j-1))*Y[t-j]

[R] linear model by month

2007-05-28 Thread Benoit Chemineau
Hi R-programmers ! I would like to perform a linear model regressio using the 'lm' function and i don't know how to do it. The data is organised as below: Month ExcessReturn Return STO 8 0.047595875 0.05274292 0.854352503 8 0.016134874 0.049226941 4.399372005 8 -0.000443869

[R] Where to find nprq?

2007-05-28 Thread Rainer M. Krug
Hi I am trying to install the package pheno, but it needs the package nprq by Roger Koenker et al. which I can I find this package? It does not seem to be on CRAN and googling also doesn't give me an URL - is it still somewhere available? Thanks, Rainer -- NEW EMAIL ADDRESS AND ADDRESS:

Re: [R] Parametric bootstrapped Kolmogorov-Smirnov GoF: what's wrong

2007-05-28 Thread Shiazy Fuzzy
(... sorry! the first post was in HTML format ...) Dear R-users, I want to perform a One-Sample parametric bootstrapped Kolmogorov-Smirnov GoF test (note package Matching provides ks.boot which is a 2-sample non-parametric bootstrapped K-S version). So I wrote this code: ---[R Code] ---

[R] Need Help

2007-05-28 Thread CHANDRAMOULI BANERJEE
Hi, I have 2 text files the first one is in the following format: CC: Some statements ... this is continued for 11-12 lines of variable length. then a line containing the variable names used in the file and then the variable fields with their

Re: [R] S4 object slot of type 'call'

2007-05-28 Thread Uwe Ligges
Roberto Brunelli wrote: I'm using an S4 object with a slot of type 'call': I would like to be able to initialize it with something like NULL or NA (indicating that there is no information in the slot) but the value should comply with the fact that it must be of type call. Is there any

Re: [R] removing all NA rows from a data.frame

2007-05-28 Thread Uwe Ligges
Taka Matzmoto wrote: Dear R-users, I have a data.frame having NA (e.g., 2nd, 4th rows, etc). Start End Length Variable_name [1,] 1 1 1a [2,] NANANA [3,] 2 2 1b [4,] NANANA [5,] 3 6 4c [6,] 7 10 4d : : : I like to

Re: [R] pie chart in lattice - trellis class

2007-05-28 Thread Christos Hatzis
In case you haven't seen this, there is an example in Paul Murrell's book that plots temperatures on a map using 'thermometer' charts. I would imagine it should be relatively straight forward to combine the floating.pie function with Paul's grid-base code (but I have not tried it myself).

Re: [R] S4 object slot of type 'call'

2007-05-28 Thread Prof Brian Ripley
On Mon, 28 May 2007, Uwe Ligges wrote: Roberto Brunelli wrote: I'm using an S4 object with a slot of type 'call': I would like to be able to initialize it with something like NULL or NA (indicating that there is no information in the slot) but the value should comply with the fact that

Re: [R] monthly least squares estimation

2007-05-28 Thread Gabor Grothendieck
Here are three ways. The first uses a common error term and the others separate. They all give the same coefficient estimates. Lines - Month ExcessReturn Return STO 8 0.047595875 0.05274292 0.854352503 8 0.016134874 0.049226941 4.399372005 8 -0.000443869 0.004357305 -1.04980297 9

Re: [R] S4 object slot of type 'call'

2007-05-28 Thread Uwe Ligges
Prof Brian Ripley wrote: On Mon, 28 May 2007, Uwe Ligges wrote: Roberto Brunelli wrote: I'm using an S4 object with a slot of type 'call': I would like to be able to initialize it with something like NULL or NA (indicating that there is no information in the slot) but the value

[R] do not eval vignettes during R CMD build

2007-05-28 Thread johan Faux
Hi, I was not able to find a way such that R CMD build run Sweave with eval=FALSE. I have a package where I want the R code in the vignettes to run only during R CMD check but not on R CMD build. Is there any way to achieve this ? thank you.

Re: [R] do not eval vignettes during R CMD build

2007-05-28 Thread Duncan Murdoch
On 5/28/2007 2:11 PM, johan Faux wrote: Hi, I was not able to find a way such that R CMD build run Sweave with eval=FALSE. I have a package where I want the R code in the vignettes to run only during R CMD check but not on R CMD build. Is there any way to achieve this ? You can use the

Re: [R] normality tests [Broadcast]

2007-05-28 Thread Thomas Lumley
On Mon, 28 May 2007, Martin Maechler wrote: LuckeJF == Lucke, Joseph F [EMAIL PROTECTED] on Fri, 25 May 2007 12:29:49 -0500 writes: LuckeJF Most standard tests, such as t-tests and ANOVA, LuckeJF are fairly resistant to non-normalilty for LuckeJF significance testing. It's the

[R] RODBC

2007-05-28 Thread Bill Szkotnicki
Hello, I have installed R2.5.0 from sources ( x86_64 ) and added the package RODBC and now I am trying to connect to a mysql database In windows R after installing the 3.51 driver and creating the dsn by specifying server, user, and password it is easy to connect with channel - odbcConnect(dsn)

Re: [R] RODBC

2007-05-28 Thread Prof Brian Ripley
yOn Mon, 28 May 2007, Bill Szkotnicki wrote: Hello, I have installed R2.5.0 from sources ( x86_64 ) and added the package RODBC and now I am trying to connect to a mysql database In windows R after installing the 3.51 driver and creating the dsn by specifying server, user, and password it

[R] off-topic: affine transformation matrix

2007-05-28 Thread Dylan Beaudette
This may sound like a very naive question, but... give two lists of coordinate pairs (x,y - Cartesian space) is there any simple way to compute the affine transformation matrix in R. I have a set of data which is offset from where i know it should be. I have coordinates of the current data,

Re: [R] off-topic: affine transformation matrix

2007-05-28 Thread Prof Brian Ripley
Isn't this just a regression (hopefully with a near-zero error). coef(lm(cbind(xnew, ynew) ~ xold + yold)) should do what I think you are asking for. (I am not clear which direction you want the transformation, so choose 'old' and 'new' accordingly.) On Mon, 28 May 2007, Dylan Beaudette

[R] parallel processing an lme model

2007-05-28 Thread toby909
Hi All Had anyone of you seen if it is possible to split a large lme() job to be processed by multiple cpus/computers? I am just at the very beginning to understand related things, but does the lme() use solution finding functions like nlm() mle(), and I-dont-know-what-else of the standard R

[R] where did the factor name go

2007-05-28 Thread Richard M. Heiberger
tmp - data.frame(y=rnorm(12), a=factor(rep(letters[1:4],3))) tmp y a 1 -0.60866099 a 2 0.55500538 b 3 0.12231693 c 4 -0.24613790 d 5 -0.09253593 a 6 -1.54652581 b 7 0.17204210 c 8 -1.22778942 d 9 1.22151194 a 10 -0.43982577 b 11 -1.25444287 c 12 -0.97251060 d tmp.aov -

Re: [R] where did the factor name go

2007-05-28 Thread jim holtman
Don't know what it happening, but when I compared the output of 'str(tmp.aov)' before and after the 'source', I saw at least the following differences: before: $ terms:Classes 'terms', 'formula' length 3 y ~ a .. ..- attr(*, variables)= language list(y, a) .. ..- attr(*, factors)=

Re: [R] linear model by month

2007-05-28 Thread Bill.Venables
dat - + Month ExcessReturn Return STO + 8 0.047595875 0.05274292 0.854352503 + 8 0.016134874 0.049226941 4.399372005 + 8 -0.000443869 0.004357305 -1.04980297 + 9 0.002206554 -0.089068828 0.544809429 + 9 0.021296551 0.003795071 0.226875834 + 9 0.006741578 0.014104606

[R] looking for the na.omit equivalent for a matrix of characters

2007-05-28 Thread Andrew Yee
I have a matrix of characters (actually numbers that have been read in as numbers), and I'd like to remove the NA. I'm familiar with na.omit, but is there an equivalent of na.omit when the NA are the actual characters NA? Thanks, Andrew [[alternative HTML version deleted]]

Re: [R] S4 object slot of type 'call'

2007-05-28 Thread Seth Falcon
Roberto Brunelli [EMAIL PROTECTED] writes: I'm using an S4 object with a slot of type 'call': I would like to be able to initialize it with something like NULL or NA (indicating that there is no information in the slot) but the value should comply with the fact that it must be of type call.

[R] How to assign RODBC object as R class slots and method signature? [Please respond!]

2007-05-28 Thread adschai
HiI have a class which would like to hold a connection to ODBC data connection. The handle to the connection is something like (according to RODBC manual):channel = odbcConnect(DSN,uid=user,pwd=password)However, I would like to make a slot of my foo class to hold this object. For

[R] R's Spearman

2007-05-28 Thread Raymond Wan
Hi all, I am trying to figure out the formula used by R's Spearman rho (using cor(method=spearman)) because I can't seem to get the same value as by calculating by hand. Perhaps I'm using cor wrong, but I don't know where. Basically, I am running these commands:

Re: [R] looking for the na.omit equivalent for a matrix of characters

2007-05-28 Thread jim holtman
Since they are characters you can just compare for them. You did not show what your data looks like, or what you want to do if there are NA. Do you want the row removed? You can use 'apply' to test a row for NA: x - matrix(0,5,5) x[1,3] - x[4,4] - NA x [,1] [,2] [,3] [,4] [,5] [1,] 0

Re: [R] R's Spearman

2007-05-28 Thread Chung-hong Chan
Hi, You can try with cor.test(rank(y[1]),rank(y[2])) On 5/29/07, Raymond Wan [EMAIL PROTECTED] wrote: Hi all, I am trying to figure out the formula used by R's Spearman rho (using cor(method=spearman)) because I can't seem to get the same value as by calculating by hand. Perhaps I'm

Re: [R] looking for the na.omit equivalent for a matrix of characters

2007-05-28 Thread Bill.Venables
Surely all you need to do is change them to missing and use na.omit. e.g. x - matrix(letters, 13, 2) x[4] - NA # put one in the middle is.na(x[x == NA]) - TRUE (x - na.omit(x)) Bill Venables CSIRO Laboratories PO Box 120, Cleveland, 4163 AUSTRALIA Office Phone (email preferred): +61 7 3826

Re: [R] looking for the na.omit equivalent for a matrix of characters

2007-05-28 Thread Stephen Tucker
You can also use type.convert() if you did want to convert your characters to numbers and NA's to NA's so that you can use na.omit(). x - matrix(0,5,5) x[1,3] - x[4,4] - NA newx - apply(x,2,type.convert) newx [,1] [,2] [,3] [,4] [,5] [1,]00 NA00 [2,]0000

Re: [R] R's Spearman

2007-05-28 Thread Raymond Wan
Hi, Chung-hong Chan wrote: Hi, You can try with cor.test(rank(y[1]),rank(y[2])) Thanks for this! It didn't solve my problem, but it helped me realize that the formula I was using by hand is invalid for the tie case. I just realized that with R's cor function, the Pearson correlation