Re: [R] density estimate

2009-02-20 Thread Dieter Menne
Edna Bell gmail.com> writes: > I have a tiny data set: > > xs > [1] 0.7 2.8 0.1 1.9 0.0 1.4 0.2 2.3 0.3 0.2 > > > > and generate the density function for it. > > I would like to replicate this. Is there a straightforward way to do > this, please? See chapter 5 in MASS and the examples in lib

[R] 24 hour axis /time plots

2009-02-20 Thread somewhereondearth
Hi, i have a data with values against time and date. for plotting against date i used axis.Date() option. but I need a 24hr time plot as well. i have extracted and plotted, but not being able to put the time ticks ( eg. 6am, 7 am etc) on the x-axis. Im new to R, any help would be appreciated!! -

Re: [R] 3D or 4D plot

2009-02-20 Thread Tony Breyal
Wow, i had no idea R was capable of producing graphics like that, smegging awesome! On 20 Feb, 19:28, Duncan Murdoch wrote: > On 2/20/2009 1:55 PM, Duncan Murdoch wrote: > > > > > On 2/20/2009 1:46 PM, kapo coulibaly wrote: > >> Ideally I would want it to look like a rubik cube with each little c

Re: [R] importing data to SQLite database with sqldf

2009-02-20 Thread Stephen Tucker
Thanks yet another time, Gabor - I think I am slowly understanding - particularly I was confused by persistence of connections. So starting with some parts of your example 12, ## gc() rm(list=ls()) unlink("mydb") sqldf("attach 'mydb' as new") irishead <- file("irishead.dat") iristail <- file("

[R] Matrix multiplication multivariate

2009-02-20 Thread MarcioRibeiro
Hi listers... I am trying to do a matrix multiplication... Suppose my data has 100 obs and 2 variables... I calculated the estimateurs of location and dispersion... So now I would like to do the following... t(Xi-location)%*%solve(dispersion)%*%(Xi-location) My code is... Z<-rep(2,200) Z<-matrix(Z

[R] problems in package "wavelets" function "wt.filter"

2009-02-20 Thread mauede
> wt.filter("d8") Error in validObject(.Object) : invalid class "wt.filter" object: invalid object for slot "transform" in class "wt.filter": got class "function", should be or extend class "character" How come ? The above function works fine with the other Daubechies filters. Thank you. Best

[R] density estimate

2009-02-20 Thread Edna Bell
Hi R Gurus: I have a tiny data set: > xs [1] 0.7 2.8 0.1 1.9 0.0 1.4 0.2 2.3 0.3 0.2 > and generate the density function for it. I would like to replicate this. Is there a straightforward way to do this, please? According to the help file, the FFT is used. How does this compare to Silverman'

Re: [R] Grouped bwplots?

2009-02-20 Thread Deepayan Sarkar
On 2/20/09, Fredrik Karlsson wrote: > Dear list, > > I am sorry for asking you this, but I am trying to do again what I > thought I have done before, although this time it does not work. > > So, given the data set: > >> testdf <- data.frame(grfak=sample(c("One","Two"),size=100,replace=TRUE), >> pa

Re: [R] plotting questions

2009-02-20 Thread Greg Snow
The dev.new function starts the default graphics device for that platform, so is the device independent method for doing this. Individual users can change the default using options(). Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@i

[R] Debian Power PC Compile R

2009-02-20 Thread stephen sefick
I have the libx11-dev package installed through the aptitude application. This is on 5.0 power pc. What can I provide to help with this? I don't know where to begin. -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they rea

Re: [R] plotting questions

2009-02-20 Thread Oliver
thanks you both for the reply. yes, the second question is two-in-one, a bit confusing: I was thinking about Matlab's hold command, but also waiting for user input to proceed. So you have provided the complete answer. The first question though - yes, windows() will give you a different window on

Re: [R] how to add names to an object created using assign

2009-02-20 Thread David Winsemius
At this point, the function would only return the names because unless specified otherwise they return the result of the last evaluation. Add another line with just "a" and assign the results of the function to something: > testold=function(){ + assign("a",c(1,2,3),env=.GlobalEnv) + names(a

Re: [R] smoothing 2D vector field

2009-02-20 Thread David Winsemius
You might take a look at this competitor to conv2: http://www.advancedsourcecode.com/ffw.asp ... which is Open Source, not too long, and appears to be built out of tools which have analogs in the signal package: http://cran.r-project.org/web/packages/signal/signal.pdf -- David winsemius

Re: [R] orthogonal/perpendicular distance from regression line

2009-02-20 Thread Jeff Newmiller
On Fri, 20 Feb 2009, GAF wrote: > > Hi there, > I am trying to measure orthogonal/perpendicular distances from regression > lines (i.e. the shortest distance from a given point to my regression line). > As it sounds rather easy (basically just an orthogonal/perpendicular > residual) I hoped that t

[R] How Google and Facebook are using R - notes from use R! SF panel

2009-02-20 Thread Michael E. Driscoll
Of interest to R Users, here are notes from a panel Jim Porzak and I co-hosted this week -- how two companies in the Bay Area are using R. http://dataspora.com/blog/predictive-analytics-using-r/ "Facebook's Data Team used R in 2007 to answer two questions about new users: (i) which data points p

Re: [R] plotting questions

2009-02-20 Thread David Winsemius
On Feb 20, 2009, at 4:53 AM, Simon Pickett wrote: Hi Oliver, 1) thats easy, if you want to display several graphs at once type windows(), once for each new graph. 2) Not sure exactly what you mean here but you have complete control over graphs in R. e.g. plot a blank graph then add axex

Re: [R] Sorting rows in a matrix based on vector of indecies

2009-02-20 Thread Esmail Bonakdarian
Hi David, This was useful, thanks. The example was just that, there are no "a"s, "b",s etc I was just trying to show what I was trying to do. Using m[v,] where m was the matrix in my example and v the vector of index values works great as you suggested Thanks. R is quite a powerful language

Re: [R] Matrix package: band matrix

2009-02-20 Thread Martin Maechler
> "KK" == Ken Knoblauch > on Fri, 20 Feb 2009 14:11:55 + (UTC) writes: KK> Thomas Lumley u.washington.edu> writes: >> I want to construct a symmetric band matrix in the Matrix >> package from a matrix where the first column contains >> data for the main diagonal,

Re: [R] Sorting rows in a matrix based on vector of indecies

2009-02-20 Thread David Winsemius
Since you do not offer reproducible code, I must guess that you were thinking of this as a matrix with 6 instances of "a" across the top row. See if this helps: > mtx<-matrix( rep(letters[1:4], 6), nrow=4) > mtx [,1] [,2] [,3] [,4] [,5] [,6] [1,] "a" "a" "a" "a" "a" "a" [2,] "b" "b

Re: [R] [package-car:Anova] extracting residuals from Anova for Type II/III Repeated Measures ?

2009-02-20 Thread John Fox
Dear Peter, Yes, you're absolutely right -- of course (though I didn't notice it!), the precedence of / and * in a formula is like division and multiplication in an arithmetic expression. With this correction, the SSs and error SSs are properly matched by aov(), producing the same F-tests as Anova

[R] how to add names to an object created using assign

2009-02-20 Thread Fuchs Ira
If I assign a variable in a function, as in: test=function(){ assign("a",c(1,2,3),env=.GlobalEnv) } How can I do the equivalent of: names(a)=c("one","two","three") within the function? Merely adding the call to names does not work within the function as it only affects a local variable: t

[R] Sorting rows in a matrix based on vector of indecies

2009-02-20 Thread Esmail Bonakdarian
Hello I have a matrix of size rows x cols. I also have a vector of size rows. The vector contains index values that corresponds to rows in the matrix. I would like to re-arrange/sort the contents of the matrix according to the entries in the vector. Can this be done efficiently in R and possib

Re: [R] [package-car:Anova] extracting residuals from Anova for Type II/III Repeated Measures ?

2009-02-20 Thread Tal Galili
Hello John, thanks for your reply and correction. I apologies for my crude mistake in applying the aov (now I have learned better). I hope to get a hold of "Statistical Models in S", but I don't predict it could easily happen in the near future. Also, I would be very happy if you could supply me w

Re: [R] [package-car:Anova] extracting residuals from Anova for Type II/III Repeated Measures ?

2009-02-20 Thread Peter Dalgaard
John Fox wrote: Dear Tal, I didn't have time to look at all this yesterday. Since aov() doesn't do what I typically want to do, I guess I've not paid much attention to it recently. I can see, however, that you appear to have specified the error strata incorrectly, since (given your desire to co

Re: [R] [package-car:Anova] extracting residuals from Anova for Type II/III Repeated Measures ?

2009-02-20 Thread John Fox
Dear Tal, I didn't have time to look at all this yesterday. Since aov() doesn't do what I typically want to do, I guess I've not paid much attention to it recently. I can see, however, that you appear to have specified the error strata incorrectly, since (given your desire to compare to Anova) th

Re: [R] write.table

2009-02-20 Thread Wacek Kusnierczyk
Rolf Turner wrote: > > On 21/02/2009, at 12:54 AM, lauramorg...@bluewin.ch wrote: > >> Thank you for your advice, but I didn't manage to make it work... >> I tried >> >> carichi.annui <- >> data.frame(anno,loadPTG,loadPO4,loadNT,loadNH4,loadNO3,loadBOD5,loadSiO2) >> >> >> And I got this error messa

[R] Grouped bwplots?

2009-02-20 Thread Fredrik Karlsson
Dear list, I am sorry for asking you this, but I am trying to do again what I thought I have done before, although this time it does not work. So, given the data set: > testdf <- data.frame(grfak=sample(c("One","Two"),size=100,replace=TRUE), > panfak= sample(c("Yes","No"),size=100,replace=TRUE)

Re: [R] write.table

2009-02-20 Thread Rolf Turner
On 21/02/2009, at 12:54 AM, lauramorg...@bluewin.ch wrote: Thank you for your advice, but I didn't manage to make it work... I tried carichi.annui <- data.frame (anno,loadPTG,loadPO4,loadNT,loadNH4,loadNO3,loadBOD5,loadSiO2) And I got this error message: Error in data.frame(anno, loadPTG,

[R] Random labeling hypothesis in spatstat

2009-02-20 Thread Karla Falk
Hi, I am trying to test the random labeling hypothesis with my data. I have a point pattern of bird nests and each nest has a mark that it is either predated or not-predated. I want to test the null hypothesis that the K distribution of predation events is equal to the K distribution of all

Re: [R] 3D or 4D plot

2009-02-20 Thread Duncan Murdoch
On 2/20/2009 1:55 PM, Duncan Murdoch wrote: On 2/20/2009 1:46 PM, kapo coulibaly wrote: Ideally I would want it to look like a rubik cube with each little cube color coded based on the fourth column (data column). Your suggestion might work if I could color code based on data in the fourth colum

Re: [R] orthogonal/perpendicular distance from regression line

2009-02-20 Thread roger koenker
For the bivariate case: g <- function(b,x,y) (abs(y - b[1] - b[2] * x))/sqrt(1 + crossprod(b)) url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 2

[R] ML estimators of bivariate cauchy

2009-02-20 Thread MarcioRibeiro
Hi all, I am using the function COV.WT to estimate the estimators (location and scale) of a bivariate cauchy distribution. My doubt is about the option WT (weight), cause at the R-help shows that the weight is uniform according to the number of observations. But, checking the theory, for example,

[R] Uni and multivariate analyses on binary data

2009-02-20 Thread busisiwe mlotshwa
Hi, I have a large data set in binary code, no covariates. Say, positions along a genomic sequence where reference sequence is represented by 0 and changes represented by 1. I have 99 positions and 2000 sequences to analyze. I want to run a univariate analysis to isolate positions where majorit

[R] Diagnostics for single-observation deletion in Cox models

2009-02-20 Thread Ravi Varadhan
Hi, Storer and Crowley (JASA 1985) presented an approach for approximating the changes in maximum partial-likelihood parameter estimates for the Cox model when a single observation is deleted. Is there an R implementation of this approach? Any help is greatly appreciated. Thanks. Best, Ravi

[R] orthogonal/perpendicular distance from regression line

2009-02-20 Thread GAF
Hi there, I am trying to measure orthogonal/perpendicular distances from regression lines (i.e. the shortest distance from a given point to my regression line). As it sounds rather easy (basically just an orthogonal/perpendicular residual) I hoped that there was some function in R that can do that

Re: [R] 3D or 4D plot

2009-02-20 Thread Duncan Murdoch
On 2/20/2009 1:46 PM, kapo coulibaly wrote: Ideally I would want it to look like a rubik cube with each little cube color coded based on the fourth column (data column). Your suggestion might work if I could color code based on data in the fourth column. Thanks There's no primitive "cube" symbo

Re: [R] 3D or 4D plot

2009-02-20 Thread kapo coulibaly
Ideally I would want it to look like a rubik cube with each little cube color coded based on the fourth column (data column). Your suggestion might work if I could color code based on data in the fourth column. Thanks On Fri, Feb 20, 2009 at 10:56 AM, Duncan Murdoch wrote: > On 2/20/2009 10:50 AM

Re: [R] How to transfer a list of space delimited character elements into a char vector?

2009-02-20 Thread Wacek Kusnierczyk
baptiste auguie wrote: > Hi, > > something like this perhaps, > > > create_string <- function(.s){ > result <- read.table(textConnection(.s)) > sapply(result, as.character) > } > > (test <- create_string("ab cd ef")) or: unlist(strsplit('ab cd ef', split=' ')) vQ > > hope this helps >

Re: [R] problem with comparing a part of string with whole string

2009-02-20 Thread Daniel Malter
Imagine the following data of noises that people make, and you want to know who makes the noise "blub." data=data.frame(rbind(c("blah, boo, blub"),c("blabber, baeh, blib"),c("quack, cheer, blub"))) names(data)=c("noises") data searchTerm="blub" #The first gives a list of all noises that people m

[R] multiplication between a matrix and a block-diagonal matrix (without vectorization)

2009-02-20 Thread Camarda, Carlo Giovanni
Dear R-users, I would have a question regarding the multiplication between a matrix (A, mXn) and a block-diagonal matrix, B, (m*n)X(m*n). The easy solution would be to, first, vectorize A and use simple matrix multiplication, but my aim is to avoid such vectorization. Is it possible? Pleas

Re: [R] NOT an R problem: cannot install packages from distant repository

2009-02-20 Thread Renaud Lancelot
Still searching what's going on In fact, I can download manually any package and install it. The problem occurs when updating the html files. I can reproduce it with this: > link.html.help() Error in .readRDS(pfile) : unknown input format > traceback() 5: .readRDS(pfile) 4: .packages(all.avail

Re: [R] Cycle through graphs

2009-02-20 Thread Uwe Ligges
par(ask=TRUE) Uwe Ligges Will Stone wrote: Hi, How do you set up the graphics window so that when clicked by the mouse; it cycles through your different plots? ie, run a function with multiple graphs in it: one graphics window pops up and clicking it goes to the next graph. I have seen this

Re: [R] lm and aov produce different results for nested fixed-factor anova

2009-02-20 Thread Mark Difford
Hi Sergii, >> I have trouble obtaining the same results for nested Anova with two fixed >> factors when using >> lm and aov functions. There is no difference between the two if you treat them equally, i.e. if you summarize them in the same way. ## Try: anova(e2) summary(e1) ## Or: summary.lm(

Re: [R] change attributes of all data.frame elements

2009-02-20 Thread Prof Brian Ripley
On Fri, 20 Feb 2009, Philipp Pagel wrote: On Fri, Feb 20, 2009 at 04:12:53PM +, Jarrod Hadfield wrote: I was wondering whether there was an easy way to change the attributes of all elements in a data.frame (rather than looping through elements)? Specifically, I would like to set the "dim"

[R] Cycle through graphs

2009-02-20 Thread Will Stone
Hi, How do you set up the graphics window so that when clicked by the mouse; it cycles through your different plots? ie, run a function with multiple graphs in it: one graphics window pops up and clicking it goes to the next graph. I have seen this done before but cannot remember how to replicate

Re: [R] How to transfer a list of space delimited character elements into a char vector?

2009-02-20 Thread baptiste auguie
Hi, something like this perhaps, create_string <- function(.s){ result <- read.table(textConnection(.s)) sapply(result, as.character) } (test <- create_string("ab cd ef")) hope this helps baptiste On 20 Feb 2009, at 16:38, Sean Zhang wrote: My dear R-helpers: I am a novic

[R] e1071 package for SVM

2009-02-20 Thread Alex Roy
Dear all, I got a code for e1071 package in R for SVM regression. I have used *m$coefs* for extracting the coefficients but I am getting only 72 . How can I extract coefficients of the predictors set? Does it mean that I will get only 72 as *Number of Support Vectors: 72. * **

Re: [R] change attributes of all data.frame elements

2009-02-20 Thread Philipp Pagel
On Fri, Feb 20, 2009 at 04:12:53PM +, Jarrod Hadfield wrote: > I was wondering whether there was an easy way to change the attributes > of all elements in a data.frame (rather than looping through elements)? > > Specifically, I would like to set the "dim" attributes to NULL Maybe I just don'

[R] How to transfer a list of space delimited character elements into a char vector?

2009-02-20 Thread Sean Zhang
My dear R-helpers: I am a novice in R and have the following text string manipulation question. Is there a function that performs the job described below? Say, wanted_output <- c("ab", "cd", "ef") #the function_wanted can generate c("ab", "cd", "ef") using ab cd ef as the single input argument w

[R] package "wavelets" does nor recognize filter "d2"

2009-02-20 Thread mauede
I take the liberty of pasting the on-line documentation for package "wavelets", functions "dwt" and "wt.filter", pertinent to the wavelet/filter choice. While I apologize for my verbose messages with huge attachments, I encourage whoever loads packages to CRAN to take some minutes to reread th

Re: [R] Sweave schunk placement

2009-02-20 Thread Ista Zahn
Right, thanks. I feel a bit sheepish about asking the question now. I'm using the latex function in the Hmisc package to generate the tables, which is why it wasn't obvious to me that I just needed to insert the new line myself. Thanks, Ista On Fri, Feb 20, 2009 at 11:24 AM, Duncan Murdoch wrote:

Re: [R] Sweave schunk placement

2009-02-20 Thread Duncan Murdoch
On 2/20/2009 11:08 AM, Ista Zahn wrote: Dear Professor Leisch + R helpers, For the past few days I have been trying to figure out why the LaTeX endfloat package is not working with Sweave. I figured it out, and it's trivial: The endfloat package requires that \begin{table} and \end{table} command

Re: [R] cluster analysis: mean values for each variable and cluster

2009-02-20 Thread Marcelino de la Cruz
Try this: c4 <- cutree(cluster, k=4) by(data, c4, mean) HTH Marcelino On 2009-02-20 Jgaspard wrote: Hi all! I'm new to R and don't know many about it. Because it is free, I managed to learn it a little bit. Here is my problem: I did a cluster analysis on 30 observations and 16 variab

Re: [R] cluster analysis: mean values for each variable and cluster

2009-02-20 Thread Uwe Ligges
jgaspard wrote: Hi all! I'm new to R and don't know many about it. Because it is free, I managed to learn it a little bit. Here is my problem: I did a cluster analysis on 30 observations and 16 variables (monde, figaro, liberation, etc.). Here is the .txt data file: "monde","figaro","liberat

[R] change attributes of all data.frame elements

2009-02-20 Thread Jarrod Hadfield
Hi, I was wondering whether there was an easy way to change the attributes of all elements in a data.frame (rather than looping through elements)? Specifically, I would like to set the "dim" attributes to NULL Thanks for any help, Jarrod -- The University of Edinburgh is a charitable bod

[R] Sweave schunk placement

2009-02-20 Thread Ista Zahn
Dear Professor Leisch + R helpers, For the past few days I have been trying to figure out why the LaTeX endfloat package is not working with Sweave. I figured it out, and it's trivial: The endfloat package requires that \begin{table} and \end{table} commands are on their own line. But Sweave is wri

Re: [R] 3D or 4D plot

2009-02-20 Thread Huang, Guo-Hao
You can try rgl package. It utilizes OpenGL library. Or, check the CRAN to find other gtk based package - Original Message - From: "kapo coulibaly" To: Sent: Friday, February 20, 2009 11:50 PM Subject: [R] 3D or 4D plot I have data on a regular grid in the format: x y z data. I wou

Re: [R] 3D or 4D plot

2009-02-20 Thread Duncan Murdoch
On 2/20/2009 10:50 AM, kapo coulibaly wrote: I have data on a regular grid in the format: x y z data. I would like to be able to plot them in 3d kind of like a volume or a mesh with colors. Is that possible in R and how? There are lots of ways, depending on what you want the plot to look lik

Re: [R] Problems installing RODBC as part of Rcmdr and as separatepackage

2009-02-20 Thread John Sorkin
Marc Schwarz's solution solved my problem. Thank you Marc! John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone)

[R] 3D or 4D plot

2009-02-20 Thread kapo coulibaly
I have data on a regular grid in the format: x y z data. I would like to be able to plot them in 3d kind of like a volume or a mesh with colors. Is that possible in R and how? Thanks [[alternative HTML version deleted]] __ R-help@r-project.or

[R] cluster analysis: mean values for each variable and cluster

2009-02-20 Thread jgaspard
Hi all! I'm new to R and don't know many about it. Because it is free, I managed to learn it a little bit. Here is my problem: I did a cluster analysis on 30 observations and 16 variables (monde, figaro, liberation, etc.). Here is the .txt data file: "monde","figaro","liberation","yespeople","n

[R] NOT an R problem: cannot install packages from distant repository

2009-02-20 Thread Renaud Lancelot
I met today a computer crash and our maintenance officer had to reinstall some components of the OS (MS Windows XP Pro) as well as the Internet browser (among other things). Now, I cannot install packages from a distant repository: > utils:::menuInstallPkgs() Error in .readRDS(pfile) : unknown inp

Re: [R] Problems installing RODBC as part of Rcmdr and as separate package

2009-02-20 Thread Prof Brian Ripley
You need unixODBC or iodbc. Specifically on F10 gannet% rpm -q --whatprovides /usr/include/sql.h unixODBC-devel-2.2.12-9.fc10.x86_64 This is in the RODBC/README (well, not the exact RPM for F10). On Fri, 20 Feb 2009, John Sorkin wrote: Fedora 10 R 2.8.1 I hope someone can tell me the meanin

Re: [R] Problems installing RODBC as part of Rcmdr and as separate package

2009-02-20 Thread Marc Schwartz
on 02/20/2009 09:27 AM John Sorkin wrote: > Fedora 10 > R 2.8.1 > > I hope someone can tell me the meaning of error I received trying to install > RODBC and how I can get around the problem. > n.b. The error originally occurred then I was installing Rcmdr. I then tried > to install RODBC separa

Re: [R] why doesn't table() have a data=argument?

2009-02-20 Thread Achim Zeileis
On Fri, 20 Feb 2009, Michael Friendly wrote: In an Rweave tutorial written for possibly naive R users, I felt it necessary to explain why table() had to be used inside with(), whereas other tools like xtabs() had a data= argument. I think the simple rule is: If there is a "formula", there is

[R] Problems installing RODBC as part of Rcmdr and as separate package

2009-02-20 Thread John Sorkin
Fedora 10 R 2.8.1 I hope someone can tell me the meaning of error I received trying to install RODBC and how I can get around the problem. n.b. The error originally occurred then I was installing Rcmdr. I then tried to install RODBC separately and received the same error. checking sql.h usabil

Re: [R] why doesn't table() have a data=argument?

2009-02-20 Thread Marc Schwartz
on 02/20/2009 09:11 AM Michael Friendly wrote: > In an Rweave tutorial written for possibly naive R users, I felt it > necessary to explain why > table() had to be used inside with(), whereas other tools like xtabs() > had a data= argument. > > with() is quite nice for such cases, but it seems an

[R] why doesn't table() have a data=argument?

2009-02-20 Thread Michael Friendly
In an Rweave tutorial written for possibly naive R users, I felt it necessary to explain why table() had to be used inside with(), whereas other tools like xtabs() had a data= argument. with() is quite nice for such cases, but it seems an unnecessary thing to learn right off. Before I turn thi

Re: [R] R scripts and parameters

2009-02-20 Thread Jeffrey J. Hallman
Here's how I do this: The last lines of my .First() function are these: ## Run command line program if there is one if(length(.cmd <- commandArgs(trailingOnly = TRUE)) > 0) try(source(textConnection(.cmd), echo = T, prompt.echo = "> ")) and on my Linux path I have this csh script, called "runR"

Re: [R] Matrix package: band matrix

2009-02-20 Thread Martin Maechler
> "TL" == Thomas Lumley > on Fri, 20 Feb 2009 05:49:10 -0800 (PST) writes: TL> On Fri, 20 Feb 2009, David Winsemius wrote: >> If you can tolerate the subdiagonal and superdiagonal zero elements being >> populated, then perhaps this is useful. If there is a subset functio

Re: [R] Matrix package: band matrix

2009-02-20 Thread David Winsemius
Then? : xxx <- data.frame(x1 =rnorm(5), offd= c(1:4,0) ) M <-Matrix(0,5,5) rrr <- dim(M)[1] for (rr in 1:rrr){ M[rr,rr] <- xxx$x1[rr] } for (rr in 1:(rrr-1)){ M[rr+1,rr] <- xxx$offd[rr] ; M[rr,rr+1] <- xxx $offd[rr]} > M 5 x 5 sparse Matrix of class "dgCMatrix" [1,] -1.494930 1.000 .

Re: [R] write.table

2009-02-20 Thread lauramorg...@bluewin.ch
Thank you!!! unlist() worked perfectly!!! Have a nice weekend Laura Messaggio originale Da: petr.pi...@precheza.cz Data: 20.02.2009 14.58 A: Copia: Oggetto: Re: [R] write.table Hi r-help-boun...@r-project.org napsal dne 20.02.2009 12:54:41: > Thank you for your advice, but I didn't man

Re: [R] everybody loves R...

2009-02-20 Thread Huang, Guo-Hao
I also plan to create a R website in Taiwan (locale: Traditional Chinese). My reason is the same as you. Welcome people in taiwan to give me suggestion. - Original Message - From: "UsuarioR España" To: ; Cc: Sent: Friday, February 20, 2009 5:59 PM Subject: Re: [R] everybody loves R..

Re: [R] Roadmap for selecting an approach to analyzing repeated measures data

2009-02-20 Thread Doran, Harold
Thanks for this, Frank. Quick comment (decided to put on list rather than just send to you directly, hope that's OK). Under mixed models, you might consider creating two smaller columns, one for the fixed effects and another for the random effects. Under the random effects, you might consider check

Re: [R] log-minus-log plot

2009-02-20 Thread Marc Schwartz
on 02/20/2009 07:23 AM Frank E Harrell Jr wrote: > C.H. wrote: >> Dear experts, >> >> I would like to know how to plot the log-minus-log plot for survival >> analysis (to check the proportional assumption) in R. >> >> Using the AML example. >> >> fit <- survfit(Surv(time, status) ~ x, data=aml) >>

Re: [R] Matrix package: band matrix

2009-02-20 Thread Ken Knoblauch
Thomas Lumley u.washington.edu> writes: > I want to construct a symmetric band matrix in the Matrix > package from a matrix where the first column > contains data for the main diagonal, the second column > has data for the first subdiagonal/superdiagonal > and so on. > > Since the Matrix will

Re: [R] everybody loves R...

2009-02-20 Thread Carlos J. Gil Bellosta
Hello, I do not know any such "community of R users in Spain and Latin America" but it sounds like a great idea. A number of R official documents have already been translated into Spanish, but enhancing local language support on basic documentation would facilitate adoption of the language by un

[R] Odp: equivalent function to MatLab 'step' ?

2009-02-20 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 20.02.2009 02:22:35: > I have to admit I don't fully understand how MatLab's step() function > works, but I'm learning that part. Can someone point me to > equivalent&related functions in R? Maybe ?step. Howewer without knowing what Matlab's step fu

Re: [R] write.table

2009-02-20 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 20.02.2009 12:54:41: > Thank you for your advice, but I didn't manage to make it work... > I tried > > carichi.annui <- data.frame > (anno,loadPTG,loadPO4,loadNT,loadNH4,loadNO3,loadBOD5,loadSiO2) > > And I got this error message: > > Error in data.f

[R] Odp: An error in fitting a non linear regression

2009-02-20 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 20.02.2009 11:21:26: > > Hi > > I have a data set with two variables "q" and "depth" as follows: > > q<-c(tapply(weight[Soil=="Jy"], Depth[Soil=="Jy"], mean)). This commns > returns 7 "q" values: > 0.68790 0.84555 0.405416667 0.15277 0.033

Re: [R] Matrix package: band matrix

2009-02-20 Thread Thomas Lumley
On Fri, 20 Feb 2009, David Winsemius wrote: If you can tolerate the subdiagonal and superdiagonal zero elements being populated, then perhaps this is useful. If there is a subset function as you suggest, then perhaps further reduction would be feasible from this as a starting point. At least i

Re: [R] Using "rep", but don't know what to put after each =

2009-02-20 Thread jim holtman
Here is one way of doing it. It does not check for errors in the case that there are not enough values in the first dataframe: > x1 <- read.table(textConnection("CHR_NR diffdatoperiode + 1137729 + 1137759 + 1137778"), header=TRUE) > > x2 <- rea

Re: [R] write.table

2009-02-20 Thread Huang, Guo-Hao
May you put your code and data in the internet? It will be easy for others to find your real problem. - Original Message - From: To: Sent: Friday, February 20, 2009 7:54 PM Subject: Re: [R] write.table Thank you for your advice, but I didn't manage to make it work... I tried carichi.

Re: [R] C function calling in R

2009-02-20 Thread Duncan Murdoch
On 2/20/2009 7:07 AM, Cetinyürek Aysun wrote: Dear all, I have a problem in calling my C code from R. If I do not need to use #include, the codes work properly. But when I need to use it, my codes produce an error as: logpostCLM.cpp:7:15: error: R.h: No such file or directory logpostCLM.cpp:8:24

[R] Odp: adding a reference line to an xyplot

2009-02-20 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 20.02.2009 10:34:02: > > > Hi, > > I want to add a dashed vertical line to a number of xyplots. > > Here is a simple script of the type of plot I have but then I want to add a > reference line to 1995 on each of the panels. I have tried panel.ablin

Re: [R] Matrix package: band matrix

2009-02-20 Thread David Winsemius
If you can tolerate the subdiagonal and superdiagonal zero elements being populated, then perhaps this is useful. If there is a subset function as you suggest, then perhaps further reduction would be feasible from this as a starting point. At least it would reduce the size from 10^5 x 10^5

Re: [R] log-minus-log plot

2009-02-20 Thread Frank E Harrell Jr
C.H. wrote: Dear experts, I would like to know how to plot the log-minus-log plot for survival analysis (to check the proportional assumption) in R. Using the AML example. fit <- survfit(Surv(time, status) ~ x, data=aml) length(fit$surv) #20 as the length of fit$surv is shorter than aml$x and

Re: [R] importing data to SQLite database with sqldf

2009-02-20 Thread Gabor Grothendieck
Have just added an example 12 on the home page: http://sqldf.googlecode.com that shows an example. Note use of notation main.mytable to refer to an existing table in the main database (as opposed to a data frame in R). On Thu, Feb 19, 2009 at 11:55 PM, Stephen Tucker wrote: > Hi all, > > I am

Re: [R] misleading example or ...

2009-02-20 Thread Michael Dewey
At 10:18 20/02/2009, mau...@alice.it wrote: Your email has gone to hundreds of people all over the world many of whom read their mail over quite slow connections especially in less developed countries. Sending all of them half a megabyte of unwanted mail is not very polite. [mail content del

[R] Rpad sever version

2009-02-20 Thread Paul Schmidt
Hello, I have a poblem with the Rpad server version. I've created a three-step-calculation with Rpad. It consists of three .Rpad pages linked to each other. It works perfect on he local version, because on every page Rpad is communicating with the same R process. So all the variables are sti

[R] Spearman-Karber method for toxicity data

2009-02-20 Thread Schmidt, Susanne, Dr.
Dear all, I tried help.search("karber") and RSiteSearch("karber") and RSiteSearch("*karber*") to find whether the (trimmed) Spearman-Karber method for LD50 evaluation in toxicity data (e.g. according to Hamilton 1977) has been implemented in R. Or does this method feature under a different n

[R] link between dynamic web pages and R

2009-02-20 Thread lamack lamack
Dear all, I would like to hear about the best way between an dynamic web page an R. (rpad, rapache, rphp son on ???). I am producing dynamic web pages with PHP and need some data analysis in these pages. Best regards. JL _ [[e

[R] C function calling in R

2009-02-20 Thread Cetinyürek Aysun
Dear all, I have a problem in calling my C code from R. If I do not need to use #include, the codes work properly. But when I need to use it, my codes produce an error as: logpostCLM.cpp:7:15: error: R.h: No such file or directory logpostCLM.cpp:8:24: error: Rinternals.h: No such file or directory

Re: [R] Python and R

2009-02-20 Thread Gabor Grothendieck
Note that using solve can be numerically unstable for certain problems. On Fri, Feb 20, 2009 at 6:50 AM, Kenn Konstabel wrote: > Decyphering formulas seems to be the most time consuming part of lm: > > mylm1 <- function(formula, data) { > # not perfect but works > F <- model.frame(formula

Re: [R] write.table

2009-02-20 Thread lauramorg...@bluewin.ch
Thank you for your advice, but I didn't manage to make it work... I tried carichi.annui <- data.frame(anno,loadPTG,loadPO4,loadNT,loadNH4,loadNO3,loadBOD5,loadSiO2) And I got this error message: Error in data.frame(anno, loadPTG, loadPO4, loadNT, loadNH4, loadNO3, : the arguments have a di

Re: [R] Python and R

2009-02-20 Thread Kenn Konstabel
Decyphering formulas seems to be the most time consuming part of lm: mylm1 <- function(formula, data) { # not perfect but works F <- model.frame(formula,data) y <- model.response(F) mt <- attr(F, "terms") x <- model.matrix(mt,F) coefs <- solve(crossprod(x), crossprod(x,y))

[R] Using "rep", but don't know what to put after each =

2009-02-20 Thread joe1985
Hello I have one DF (detheleny1periode), with some variables that mathes, in some way, variables in another DF (y2). The DF named detheleny1periode look like this (i have not included alle variables): CHR_NR diffdatoperiode 1137729 1137759 11377

Re: [R] write.table

2009-02-20 Thread Prof Brian Ripley
On Fri, 20 Feb 2009, lauramorg...@bluewin.ch wrote: Sorry, I'm using R 2.8.1 on Microsoft Windows XP professional 2002 Service Pack 2. The error I get is Error in write.table(x, file, nrow(x), p, rnames, sep, eol, na, dec, as.integer(quote), : 'list' type not implemented in 'EncodeElement

Re: [R] mean over previous cells

2009-02-20 Thread Gabor Grothendieck
Using the zoo package: Lines <- "SST_dateSST 2008-01-01 22.2 2008-01-02 21.8 2008-01-03 22.8 2008-01-04 22.9 2008-01-05 23.1 2008-01-06 23.2" library(zoo) # z <- read.zoo("myfile.dat", header = TRUE) z <- read.zoo(textConnection(Lines), header = TRUE) merge(z, avg3 = rollmean(z, 3, align = "

[R] lm and aov produce different results for nested fixed-factor anova

2009-02-20 Thread Sergii Ivakhno
Dear R users, I have trouble obtaining the same results for nested Anova with two fixed factors when using lm and aov functions. The formulas are: > e1=aov(y~x/z) > e2=lm(y~x/z) summary(e1) Df Sum Sq Mean Sq F valuePr(>F) x 47 260.0 5.5 18.0088 < 2.

  1   2   >