[R] mean over previous cells

2009-02-20 Thread clion
Dear RUsers, I guess this is an easy question for someone a little familiar with programming...(which I am not)... I've got 2 colummns, one shows just dates(SST_date, Class 'Date' num), the other one shows the SeaSurfaceTemperature (SST, num) at that certain date. SST_dateSST 2008-01-01

Re: [R] write.table

2009-02-20 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of lauramorg...@bluewin.ch Sent: Thursday, February 19, 2009 11:57 PM To: r-help@r-project.org Subject: [R] write.table Hello, I tried to turn lists into vectors and then bind

Re: [R] write.table

2009-02-20 Thread Simon Pickett
Hi Laura, You need to specify where you want to write your table. Like this... write.table(result, file=C:/Documents and Settings/simonp/Desktop/result.csv, sep = ,,row.names = F) If you have to do this alot I think you can set your working drive up to always write table in the same

Re: [R] mean over previous cells

2009-02-20 Thread lauramorg...@bluewin.ch
If, suppose, the name of your dataframe is dataframe , you could try something like: mean60days-c() for(i in 1:length(dataframe$SST)) + { + mean60days[[i]]-mean(dataframe$SST[i-10:i]) + } I'm not really sure it will work... my skills aren't that great... Anyway, it worked on a sample I tried it

[R] request

2009-02-20 Thread alis villiyam
Dear Prof. Hello, Regarding to R Language , I have some problems.could you please help me.I have Four treatments in randomized block with 3 replications . I am going to comprise between medium of treatments with LSD test.is it possible in R. could you please advise me.I am going to

[R] R and JavaGD?

2009-02-20 Thread nicro
As a followup to my previous question on R and Java interaction, it looks like there may be some promise to use JRI and JavaGD together. But, I have been unable to find any documentation or examples anywhere on how to use JavaGD. Does anyone have any experience on how to use JavaGD? I am

[R] plotting questions

2009-02-20 Thread Oliver
hi, There are two types of plotting I miss dearly in Matlab, can anyone enlighten me how to do similar stuff in R? - multiple figures with individual windows (not multiple figures in same window)? - draw something, hold on the drawing, wait for a key action, then overlay on top? Not sure if

Re: [R] dotplot points color

2009-02-20 Thread Deepayan Sarkar
On 2/19/09, glaporta glapo...@freeweb.org wrote: Dear list, is it possible to change the background color of dotplot's points? I tried in many ways but unsuccessfully Thanks in advance Gianandrea require(lattice) dotplot(variety ~ yield | site, data = barley, groups = year, pch=21)

Re: [R] dotplot points color

2009-02-20 Thread glaporta
Thank you Deepayan, for this suggestion dotplot(variety ~ yield | site, data = barley, groups = year, pch=21, fill = c(1, 2)) glaporta wrote: Dear list, is it possible to change the background color of dotplot's points? I tried in many ways but unsuccessfully Thanks in advance

Re: [R] mean over previous cells

2009-02-20 Thread lauramorg...@bluewin.ch
Sorry, I meant: If, suppose, the name of your dataframe is dataframe , you could try something like: mean60days-c() for(i in 1:length(dataframe$SST)) + { + mean60days[[i]]-mean(dataframe$SST[i-60:i]) + } I'm not really sure it will work... my skills aren't that great... Anyway, it worked on a

Re: [R] write.table

2009-02-20 Thread lauramorg...@bluewin.ch
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' The problem is that I can' t manage to save the

Re: [R] color maps with counts

2009-02-20 Thread Jim Lemon
Alina Sheyman wrote: I have yet another question concerning maps. This time I want to create a colored map of number of students by state. Can this be done using palettes in Rcolor brewer, is there some other way? Hi Alina, color.scale in the plotrix package linearly converts numbers to a

Re: [R] Barplot with Sorted X-Axis

2009-02-20 Thread Jim Lemon
Gundala Viswanath wrote: ... How do you do that? Yes I am using that data exactly for the plotting. Say you have this data frame (I'm too lazy to type in your example): testdat-cut(rnorm(100,3),breaks=0:6) get a table: testtable-table(testdat) testtable (0,1] (1,2] (2,3] (3,4] (4,5]

Re: [R] plotting questions

2009-02-20 Thread Simon Pickett
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 using axis(), add points using points(), etc. etc.

Re: [R] everybody loves R...

2009-02-20 Thread UsuarioR España
Hi all This topic is very interesting to me as I was planning to do something similar, but in Spanish. In my opinion with the existing infrastructure in English, new resources are not necessary. However, local language support, and, in particular, in Spanish, is rather weak. I don't actually

[R] System of logistics Equations

2009-02-20 Thread Bernardo Rangel Tura
Hi R-masters I need yours help about a problema in one of may ongoing researchers. In my research the subjects (20 in total) answer 60 questions (20 type G, 20 type S and 20 type P). Which questions is classified about 3 factor (2 level each) and the subject score with 2 scale (not integer

[R] An error in fitting a non linear regression

2009-02-20 Thread Saeed Ahmadi
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.03310 0.03140 0.00518 The depth values are produced using this command whish depth

Re: [R] request

2009-02-20 Thread Jim Lemon
alis villiyam wrote: Dear Prof. Hello, Regarding to R Language , I have some problems.could you please help me.I have Four treatments in randomized block with 3 replications . I am going to comprise between medium of treatments with LSD test.is it possible in R. could you please advise

[R] adding a reference line to an xyplot

2009-02-20 Thread Chris Bennett
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.abline and other suggestions on the forum but can't get it to work.

[R] System of logistics Equations-correction

2009-02-20 Thread Bernardo Rangel Tura
Hi R-masters Sorry but i make a error in script the correct code to fake database of research Subj-rep(1:20,each=60) Sti-rep(c(G,S,P),40) SP-rep(c(S,P),each=60) AG-rep(c(A,P),60) Mer-rep(c(M,NM,M,NM),each=30) Car-round(runif(120,1,7),0) Val-round(runif(120,-7,7),0)

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

2009-02-20 Thread baptiste auguie
Another approach using latticeExtra, more ggplot2-like: p - xyplot(matter~year|plot,type=l) p + latticeExtra::layer(panel.abline(v=1995)) On 20 Feb 2009, at 09:34, Chris Bennett wrote: Hi, I want to add a dashed vertical line to a number of xyplots. Here is a simple script of the type

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

2009-02-20 Thread Christian Ritz
Hi Saeed, one approach is to try out several initial value combinations for a and b. It often helps to find initial values of the same order of magnitude and of the same sign as the final estimates. To get such initial values, you could linearize the model: lm(log(q) ~ I(-depth)) and supply

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

2009-02-20 Thread baptiste auguie
Hi, try this: p - xyplot(matter~year|plot,type=l) update(p, panel=function(...){ panel.xyplot(...) panel.abline(v=1995) } ) On 20 Feb 2009, at 09:34, Chris Bennett wrote: Hi, I want to add a dashed vertical line to a number of xyplots. Here is a simple script of the

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

2009-02-20 Thread Philipp Pagel
On Fri, Feb 20, 2009 at 01:34:02AM -0800, Chris Bennett wrote: 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.abline and other

Re: [R] mean over previous cells

2009-02-20 Thread clion
well, it kind of works now, I get means from the 61st SST-value on (which is reasonable, so no carful discarding of the first 60 values) but aswell I only get means until the 186st SST-value (although I 've got about 4900 in total). Allt the rest is NA - besides the 60th value is NaN Any idea,

[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

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 = right))

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

[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] 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))

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

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 lebats...@gmail.com wrote: Decyphering formulas seems to be the most time consuming part of lm: mylm1 - function(formula, data) { # not perfect but works F -

[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 #includeR.h, 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

[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 _

[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 name?

[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

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

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 brown_...@yahoo.com wrote:

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] 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

[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.abline and

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 #includeR.h, 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

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: lauramorg...@bluewin.ch To: r-help@r-project.org Sent: Friday, February 20, 2009 7:54 PM Subject: Re: [R] write.table Thank you for your advice, but I didn't

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 -

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

[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.03310 0.03140

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

[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 equivalentrelated functions in R? Maybe ?step. Howewer without knowing what Matlab's step

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

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) length(fit$surv)

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

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 kurtney...@hotmail.com To: waclaw.marcin.kusnierc...@idi.ntnu.no; landronim...@gmail.com

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: lauramorg...@bluewin.ch Copia: r-help@r-project.org Oggetto: Re: [R] write.table Hi r-help-boun...@r-project.org napsal dne 20.02.2009 12:54:41:

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] Matrix package: band matrix

2009-02-20 Thread Martin Maechler
TL == Thomas Lumley tlum...@u.washington.edu 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

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 #!

[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

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] 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

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

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 separately

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

[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

[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:

[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]] __

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

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

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 kmcou...@gmail.com To: r-help@r-project.org Sent: Friday, February 20, 2009 11:50 PM Subject: [R] 3D or 4D plot I have data on a regular

[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

[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

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:

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}

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

[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 the

[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 wanted_output

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't

[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] 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 novice in

[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

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

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(e1)

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] 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:

[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?

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 make #who

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 murd...@stats.uwo.cawrote:

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 symbol

[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

[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,

[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

[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,

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:

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

[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), xfak=

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 message: Error in

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)

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

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

[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

[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:

  1   2   >