[R] utf8 encoding and postscript

2009-08-10 Thread Alexandros Droseltis
Hello! I wrote a script file with the following commands postscript() [...] barplot(pr, xlab="Länge") In the output file (Rplots.ps) the german umlaut is printed as "L..nge". How could I set the encoding correctly? Thanks for any help or tip. I am using R version 2.8.0 (2008-10-20) on openSuSE.

[R] nested repeated measures MANOVA using adonis

2009-08-10 Thread Kevin Parsons
I am trying to apply a permuation-based MANOVA (Anderson 2001) to a set of morphological data from three ecomorphs of fish reared under two different conditions and measured at two points during ontogeny. I will supply a distance matrix based on Procrustes distances calculated outside of vegan. I

Re: [R] overlap two graph

2009-08-10 Thread Zhiliang Ma
plot(allPoints, col=c(rep(2,201), rep(3,201))) On Mon, Aug 10, 2009 at 9:54 PM, Hemavathi Ramulu wrote: > Hi everyone, > I'm stuck again, need you all help. > > I managed to  plot the diagram using > > allPoints<-rbind(ellipsePoints(2,5, alpha = 30),ellipsePoints(2,5, alpha = > 60)) > plot(allPoin

[R] creating selection vector with 2 attributes

2009-08-10 Thread PDXRugger
Please consider the following: Puma=c(702, 702, 701, 702, 701, 702, 701, 702 ,702 ,702 ,701 ,702, 702, 701 ,701, 702, 701 ,702, 702, 702,701, 702 ,702 ,702 ,701) PumaNums=c(100 , 200 , 300 , 400 , 500 , 600 , 701 , 702 , 800 , 900 ,1000 ,1101, 1102, 1200 ,1301 ,1302 ,1303, 1304, 1305, 1306, 1307

Re: [R] Example scripts for R Manual

2009-08-10 Thread Gene Leynes
Have you tried running the examples? Eg: example(lm) On Monday, August 10, 2009, Peng Yu wrote: > Some examples in the manual are not in the context. In order to use > such examples, the users have to set up the variables in the examples. > Adding accompany scripts to the manuals can make the man

Re: [R] Example scripts for R Manual

2009-08-10 Thread Prof Brian Ripley
Which manuals exactly? Runnable scripts for R-intro and R-exts are in the doc/manuals directory of the R sources, alongside those manuals. If you got a binary version of R, see https://svn.r-project.org/R/trunk/doc/manual/ They are part of the test suite: no one else has suggested that it is

Re: [R] overlap two graph

2009-08-10 Thread Hemavathi Ramulu
Hi everyone, I'm stuck again, need you all help. I managed to plot the diagram using allPoints<-rbind(ellipsePoints(2,5, alpha = 30),ellipsePoints(2,5, alpha = 60)) plot(allPoints) But now I want to have different color for each ellipsepoint(the diagram) such as ellipsePoints(2,5, alpha = 30) i

Re: [R] Example scripts for R Manual

2009-08-10 Thread Peng Yu
Some examples in the manual are not in the context. In order to use such examples, the users have to set up the variables in the examples. Adding accompany scripts to the manuals can make the manuals more reader friendly. Regards, Peng On Mon, Aug 10, 2009 at 10:20 PM, Ronggui Huang wrote: > Is i

Re: [R] Example scripts for R Manual

2009-08-10 Thread Ronggui Huang
Is it really necessary? You can just copy the commands in the manual and paste them to R. Ronggui 2009/8/11 Peng Yu : > Hi, > > I am wondering if some experienced users would help put the > ready-to-run code of the examples in the manuals. It would help new > users  learn R faster by putting all

Re: [R] Example scripts for R Manual

2009-08-10 Thread stephen sefick
Why not you? Are the examples not in the text? On Mon, Aug 10, 2009 at 4:57 PM, Peng Yu wrote: > Hi, > > I am wondering if some experienced users would help put the > ready-to-run code of the examples in the manuals. It would help new > users  learn R faster by putting all the examples in an read

Re: [R] matrix power

2009-08-10 Thread cindy Guo
I think it may be important, but I am not sure. Actually I am trying to program the adaptive nearest neighbor method proposed by Hastie and Tibshirani. I am following the steps in the book 'The elements of statistical learning' by Hastie, Tibshirani and Friedman, in which the local metric is define

Re: [R] matrix power

2009-08-10 Thread cindy Guo
Hi, Dan, Yes, this is what I want. Is there better way to solve this? Cindy On Mon, Aug 10, 2009 at 2:52 PM, Nordlund, Dan (DSHS/RDA) < nord...@dshs.wa.gov> wrote: > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On > > Behalf Of cin

[R] obtain linear regression parameters from qplot

2009-08-10 Thread Jong Hoon Choi
Hi, My question is how to get linear regression parameters (e.g. slope, y-intercept, etc.) from the fittings in qplot. My code looks like this, Fig1 = qplot(data=subset(totalD, (Name=="increase1"), x=Time, y=Intensity, main="Total Data") Fig1 + stat_smooth(method="lm") I can get the linear regre

Re: [R] NotePad++ Syntax file

2009-08-10 Thread Farley, Robert
Yes, I've already D/Led and installed. It looks good, although I've already tweaked some settings :-) it's a great way to get all the commands in. Robert Farley Metro www.Metro.net -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] problem selecting rows meeting a criterion

2009-08-10 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Jim Bouldin > Sent: Monday, August 10, 2009 4:44 PM > To: John Kane; r-help@r-project.org > Subject: Re: [R] problem selecting rows meeting a criterion > > > What's wrong is I'm

Re: [R] NotePad++ Syntax file

2009-08-10 Thread Michael Bibo
Farley, Robert metro.net> writes: > > > Does anyone have an R Syntax Highlighting file {userDefineLang.xml} for NotePad++?? I've started one, > but I'm not so happy with it. > > Robert Farley Another vote for NppToR. Also note the author's comments about the future inclusion of R as a suppo

Re: [R] problem selecting rows meeting a criterion

2009-08-10 Thread Jim Bouldin
What's wrong is I'm trying to select only those rows in which X > Y, but I'm getting rows in which Y > X and losing some in which X > Y. The row numbers are not being read as values. Very confusing. Jim > > What's wrong with it? It looks okay to me. If you use > subset(data, data$X >data$Y)yo

Re: [R] R to MATLAB translation

2009-08-10 Thread cls59
apjaworski wrote: > > Hi, > > Is there any package out there that might help me with translating R code > into MATLAB? Using RSiteSearch I found a bunch of "MATLAB stuff" but it > all seems to go in the opposite direction, i.e., emulating MATLAB > functions in R. > > Thanks in advance, >

Re: [R] matrix power

2009-08-10 Thread Gabor Grothendieck
If its not important which of many solutions you use then the generalized inverse can be used, say. Just use 0 for each small eigenvalue and 1/sqrt(x) for the others. On Mon, Aug 10, 2009 at 6:36 PM, cindy Guo wrote: > Hi, Ted, > > Thanks for the sample code. It is exactly what I want. But can I

Re: [R] matrix power

2009-08-10 Thread cindy Guo
Hi, Ted, Now I understand the problem. Thank you for the explanation. It's very helpful. I appreciate it. Cindy On Mon, Aug 10, 2009 at 3:58 PM, Ted Harding wrote: > On 10-Aug-09 22:36:03, cindy Guo wrote: > > Hi, Ted, > > Thanks for the sample code. It is exactly what I want. But can > > I ask

[R] Statistician Needed

2009-08-10 Thread Noah Silverman
Hello, I've come up with some challenges with my process that are a bit too complicated for the mailing list. Is there anyone out there, preferably a real "statistician", who is willing to consult with me via phone/email for a few hours. I'm happy to pay you for your time. Thanks, -Noah

Re: [R] NotePad++ Syntax file

2009-08-10 Thread Farley, Robert
I'm using Notepad++ because it has Hex editing, Column editing, and Syntax highlighting for many languages, including awk, Batch Files, and Python built in, and I've added "User Syntaxes" for M2 macros, and R. I tried to find the Docs for TINN-R, but I don't see support for Hex, column, or othe

Re: [R] NotePad++ Syntax file

2009-08-10 Thread Linlin Yan
I think NppToR may be a good choice. http://sourceforge.net/projects/npptor/ On Tue, Aug 11, 2009 at 6:37 AM, Farley, Robert wrote: > > > Does anyone have an R Syntax Highlighting file {userDefineLang.xml} for > NotePad++??  I've started one, but I'm not so happy with it. > > > > > Robert Farley

Re: [R] NotePad++ Syntax file

2009-08-10 Thread [Ricardo Rodriguez] Your XEN ICT Team
John Kane wrote: No but have you had a look at Tinn-R http://www.sciviews.org/Tinn-R/. Any similar option for Mac OS X? Please, accept my excuses for cross posting, but I think this message could/should also be addressed to the R-SigMAC list. Thanks! Best, Ricardo -- Ricardo Rodríguez

Re: [R] NotePad++ Syntax file

2009-08-10 Thread John Kane
No but have you had a look at Tinn-R http://www.sciviews.org/Tinn-R/. --- On Mon, 8/10/09, Farley, Robert wrote: > From: Farley, Robert > Subject: [R] NotePad++ Syntax file > To: "'r-help@r-project.org'" > Received: Monday, August 10, 2009, 6:37 PM > > > Does anyone have an R Syntax Highl

Re: [R] matrix power

2009-08-10 Thread Ted Harding
On 10-Aug-09 22:36:03, cindy Guo wrote: > Hi, Ted, > Thanks for the sample code. It is exactly what I want. But can > I ask another question? The matrix for which I want the negative > square root is a covariance matrix. I suppose it should be positive > definite, so I can do 1/sqrt(V) as you wrote

[R] Matrix addition and multiplication

2009-08-10 Thread Marlin Keith Cox
I posted this earlier, but am not certain that it was in fact posted, so I will try again. Hi, I have an equation Xcp and would like to look at errors affecting it. I am applying errors of -.58 to .1 to R and -.45 to .47 to Xc. I would like to look at all combinations. I set up a matrix functio

[R] NotePad++ Syntax file

2009-08-10 Thread Farley, Robert
Does anyone have an R Syntax Highlighting file {userDefineLang.xml} for NotePad++?? I've started one, but I'm not so happy with it. Robert Farley Metro 1 Gateway Plaza Mail Stop 99-23-7 Los Angeles, CA 90012-2952 Voice: (213)922-2532 Fax:(213)922-2868 www.Metro.net [[alternat

Re: [R] problem selecting rows meeting a criterion

2009-08-10 Thread John Kane
What's wrong with it? It looks okay to me. If you use subset(data, data$X >data$Y)you get the same results. Any chance you're reading the row.numbers as values? BTW "data" is a reserved word in R and it is good practice not to use it as a variable name. My Results X Y V3 3 3

Re: [R] matrix power

2009-08-10 Thread cindy Guo
Hi, Ted, Thanks for the sample code. It is exactly what I want. But can I ask another question? The matrix for which I want the negative square root is a covariance matrix. I suppose it should be positive definite, so I can do 1/sqrt(V) as you wrote. But the covariance matrix I got in R using the

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-10 Thread Ben Bolker
library(fortunes) fortune("S4") Sean Davis: It got me going quickly with S4 methods, which it seems to me are the way to go in most cases. Rolf Turner: If you want to simultaneously handcuff yourself, strap yourself into a strait jacket, and tie yourself in knots, and moreover write code which i

Re: [R] create separate plots by factors

2009-08-10 Thread David M Smith
If you want to use foreach to do the looping, you can use the "isplit" function to create an iterator returning blocks of data, each block being the data for one site: > require(foreach) > site.data <- read.table("isplit-data.txt",header=T) # data copied from email > sites <- isplit(site.data,site

Re: [R] building a package

2009-08-10 Thread Barry Rowlingson
On Mon, Aug 10, 2009 at 10:24 PM, Erin Hodgess wrote: > Dear R People: > > I'm trying to build a package and am stuck on the last part; I keep > getting "there is no library". You seem to have more than one version of R on the go - the one in your system $PATH: > e...@erin-laptop:~/Desktop/R-2.9

[R] Example scripts for R Manual

2009-08-10 Thread Peng Yu
Hi, I am wondering if some experienced users would help put the ready-to-run code of the examples in the manuals. It would help new users learn R faster by putting all the examples in an ready-to-run R script file. Can somebody help do so sometime and post the code along with the pdf manuals? ht

Re: [R] matrix power

2009-08-10 Thread Ted Harding
On 10-Aug-09 21:31:30, cindy Guo wrote: > Hi, All, > If I have a symmetric matrix, how can I get the negative square root > of the matrx, ie. X^(-1/2) ? > > Thanks, > > Cindy X <- matrix(c(2,1,1,2),nrow=2) X # [,1] [,2] # [1,]21 # [2,]12 E <- eigen(X) V <- E$values

Re: [R] matrix power

2009-08-10 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of cindy Guo > Sent: Monday, August 10, 2009 2:32 PM > To: r-help@r-project.org > Subject: [R] matrix power > > Hi, All, > > If I have a symmetric matrix, how can I get the negativ

[R] problem selecting rows meeting a criterion

2009-08-10 Thread Jim Bouldin
When I try to select only those rows from the following data frame, called "data", in which X > Y X Y V3 2 2 1 8.062258 3 3 1 2.236068 4 4 1 6.324555 5 5 1 5.00 6 1 2 8.062258 8 3 2 9.486833 9 4 2 2.236068 10 5 2 5.656854 11 1 3 2.236068 12 2 3 9.486833 14 4 3 8.062258 15 5 3

[R] Speeding up a bootstrap routine

2009-08-10 Thread babelproofreader
I have written the R code below to perform White's Data Mining Reality Check (DMRC) but as it stands at the moment it is painfully slow. It is written as a function as I call it many times from a script file with different data input, and the output is sunk() to a text file. Could anyone suggest i

Re: [R] Bug in "seq" (or a "feature") ?

2009-08-10 Thread Erik Iverson
General floating point arithmetic issue here: See FAQ 7.31 http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Tal Galili Sent: Monday

Re: [R] Bug in "seq" (or a "feature") ?

2009-08-10 Thread Duncan Murdoch
Tal Galili wrote: (I use R 2.9.1 with win XP) If I run this code: seq(-0.1,.9, by = .05)[seq(-0.1,.9, by = .05) <= 0.5] I get this output: [1] -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 Why is 0.50 not in the results ? (It seems that it gives a slightly bigger number then 0.5

[R] building a package

2009-08-10 Thread Erin Hodgess
Dear R People: I'm trying to build a package and am stuck on the last part; I keep getting "there is no library". Here are my statements: e...@erin-laptop:~/Desktop/R-2.9.1/bin$ R CMD check RcmdrPlugin.qual * checking for working pdflatex ... OK * using log directory '/home/erin/Desktop/R-2.9.

Re: [R] Help with the internal functions

2009-08-10 Thread Duncan Murdoch
Kaiyu Shen wrote: Hi, folks: I have used R for some time and have not explore deep inside the codes of the packages. Today, I try to modify some code in a package of arrayQuality (I do not think it matters which package it is). There is a function called maQualityPlots and I use fix(maQualityPlot

Re: [R] Bug in "seq" (or a "feature") ?

2009-08-10 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Tal Galili > Sent: Monday, August 10, 2009 2:14 PM > To: r-help@r-project.org > Subject: [R] Bug in "seq" (or a "feature") ? > > (I use R 2.9.1 with win XP) > > If I run this cod

[R] matrix power

2009-08-10 Thread cindy Guo
Hi, All, If I have a symmetric matrix, how can I get the negative square root of the matrx, ie. X^(-1/2) ? Thanks, Cindy [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help P

Re: [R] how use cat() function?

2009-08-10 Thread Don MacQueen
Here is are some examples that might help. a <- 1 b <- 2 c <- 5 cat( "a=,",a, " b=,",b, " c=",c, "\n" , sep='', file="output.csv") and don't append unless you are adding more lines to an existing file. Or perhaps you want cat("a,b,c\n",file="output.csv") cat( paste( a,b,c , coll

[R] Bug in "seq" (or a "feature") ?

2009-08-10 Thread Tal Galili
(I use R 2.9.1 with win XP) If I run this code: seq(-0.1,.9, by = .05)[seq(-0.1,.9, by = .05) <= 0.5] I get this output: [1] -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 Why is 0.50 not in the results ? (It seems that it gives a slightly bigger number then 0.5 but I don't understa

[R] Sorting text docs based on document meta values in tm()

2009-08-10 Thread Kelvin Lam
Hi all, I wonder if there's any way to reshuffle the text collection by the document meta values. For instance, if I have 5 documents that correspond to the following meta data: MetaID Sex Age 0 M38 0 M46 0 F 24 0 F 49 0 F 33 Can I re

[R] manipulating text to generate different formulas to use in nls()

2009-08-10 Thread Héctor Villalobos
Hello, In doing a series of non-linear estimations of a function which is a sum of a varying number of sinusoids, I would like to "autogenerate" the arguments needed by nls() depending on that number. For example, when there are two sinusoids: > nls( y ~ mu + A1 * cos(2*pi*f1*x - P1) + A2

[R] Help with the internal functions

2009-08-10 Thread Kaiyu Shen
Hi, folks: I have used R for some time and have not explore deep inside the codes of the packages. Today, I try to modify some code in a package of arrayQuality (I do not think it matters which package it is). There is a function called maQualityPlots and I use fix(maQualityPlots) that I can view a

[R] question

2009-08-10 Thread Paulina Salazar
hi: I need to work with RMySQL I installs DBI and MySQL but R It gives the following message Error in utils::readRegistry("SOFTWARE\\MySQL AB", hive = "HLM", maxdepth = 2) : Registry key 'S' not found Error : .onLoad failed in 'loadNamespace' for 'RMySQL' Error: package/namespace load failed for

[R] R to MATLAB translation

2009-08-10 Thread apjaworski
Hi, Is there any package out there that might help me with translating R code into MATLAB? Using RSiteSearch I found a bunch of "MATLAB stuff" but it all seems to go in the opposite direction, i.e., emulating MATLAB functions in R. Thanks in advance, Andy __

[R] ggplot: colours to geom_segments

2009-08-10 Thread John Kane
Just as an exercise I am tying to add colours to a geom_segment command. I can get one colour but not a sequence of colours. Can anyone suggest how I can get the green lines in the plot below to be different colours? I thought I could use a palatte of colours but that did not seem to work.

Re: [R] strsplit a matrix

2009-08-10 Thread Jun Shen
Henrique, This is a very nice approach. I wonder what if I have data like 2-172-45 and want to break it down into three parts 2, 172 and 45. How do we use your method to achieve it? Thanks. Jun On Mon, Aug 10, 2009 at 12:34 PM, Henrique Dallazuanna wrote: > Try this: > > #1 > gsub(".*-", "", zz

Re: [R] strsplit a matrix

2009-08-10 Thread Henrique Dallazuanna
Try this: #1 gsub(".*-", "", zzz) #2 gsub("-.*", "", zzz) #3) gsub(".*-(.*)-.*", "\\1", zzz) On Mon, Aug 10, 2009 at 4:20 PM, Jun Shen wrote: > Henrique, > > This is a very nice approach. I wonder what if I have data like 2-172-45 > and want to break it down into three parts 2, 172 and 45. Ho

Re: [R] Saving plots to file

2009-08-10 Thread Zhiliang Ma
?postscript ?pdf On Mon, Aug 10, 2009 at 9:25 AM, Sean MacEachern wrote: > Appologies if this has been addressed before, but I can't seem to find it in > the help archives. > > I'm looking to do something like the following but it looks like save.plot > is deprecated. > > save.plot(plot(glm1$resid

Re: [R] howto get the number of columns and column names of multiply data frames

2009-08-10 Thread Frank Schäffer
Thanks for your replies. Both, Don and Stevens solutions worked well. Best regards Frank __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

[R] obtain linear regression parameters from qplot

2009-08-10 Thread Jonghoon Choi
Hi, My question is how to get linear regression parameters (e.g. slope, y-intercept, etc.) from the fittings in qplot. My code looks like this, Fig1 = qplot(data=subset(totalD, (Name=="increase1"), x=Time, y=Intensity, main="Total Data") Fig1 + stat_smooth(method="lm") I can get the linear regre

[R] logistic regression with repeated measures

2009-08-10 Thread Joel Bried
Hello , I am writing because I would need some advice on the following question. I am working on paternity in a monogamous bird species and I am performing analyses to check whether the probability for a male to be cuckolded (binary variable) depends on his body size, the body size of his femal

Re: [R] how use cat() function?

2009-08-10 Thread Jean V Adams
I'm not exactly sure how you want the file to look, but try this code and see if it works for you. # since I don't have the data file, I'll just set the values here No_GWPMax <- 8 NbpolicyClass1 <- 5 NbpolicyClass2 <- 4 NbpolicyClass3 <- 3 # output1 is the first row of headers Output1 <- paste("

Re: [R] how use cat() function?

2009-08-10 Thread John Kane
Output write.xls( x, file ="my.file") --- On Mon, 8/10/09, Inchallah Yarab wrote: > From: Inchallah Yarab > Subject: [R] how use cat() function? > To: r-help@r-project.org > Received: Monday, August 10, 2009, 12:06 PM > i  want to print in the console and > to have an excel file like this >

[R] survival:: plotting survfit with two predictors

2009-08-10 Thread Marshall Knoderbane
Hi R-Helpers, I am having difficulty plotting a coxph model with two predictors. My predictors are "morder" (a factor with five levels where the mean of each level is plotted as a separate line) and tmean (continuous). When I run a model with just morder it is fine and the plot is fine. W

Re: [R] Matrices

2009-08-10 Thread Gavin Simpson
On Mon, 2009-08-10 at 14:02 -0400, mmv.listservs wrote: > Your example works because you have only 5 really long labels. I tried > changing 5 to 474 because that is how many I have and the plot looks > illegible. Should I increase the margin or the height of the plotting > window? Thanks for your h

Re: [R] Matrices

2009-08-10 Thread mmv.listservs
Your example works because you have only 5 really long labels. I tried changing 5 to 474 because that is how many I have and the plot looks illegible. Should I increase the margin or the height of the plotting window? Thanks for your help again. ## dummy data set.seed(123) dummy <- data.frame(A =

Re: [R] summary(table)

2009-08-10 Thread Erik Iverson
We cannot reproduce your example since we don't have access to probF. It seems probF is not an object of class "table", but perhaps of class "data.frame". Also, summary is not "cutting off the other variables", it is pooling levels of a factor into the "Other" category. All the levels belong

Re: [R] Matrices

2009-08-10 Thread Gavin Simpson
On Mon, 2009-08-10 at 13:41 -0400, mmv.listservs wrote: > I should give an example Thanks for that - I just two seconds ago sent a reply to the list complaining because you didn't provide one. However, the code below doesn't work. > > for(p in 1:100) > { > str <- paste("Task", p, sep=" ") >

[R] how use cat() function?

2009-08-10 Thread Inchallah Yarab
i  want to print in the console and to have an excel file like this no_GWP    NbOfPolicyClass1[0-1000] NbOfPolicyClass2[1000-3000]    NbOfPolicyClass3[> 3000] No_GWPMax=8NbpolicyClass1=5   NbpolicyClass2=4    NbpolicyClass3 =3 

Re: [R] Matrices

2009-08-10 Thread Gavin Simpson
On Mon, 2009-08-10 at 13:33 -0400, mmv.listservs wrote: > Gavin and Stefan, > > Both the subset commands and the flag were exactly what I needed. On another > note, I'm dealing with variables that are categorical and have long names > like "Task XYZ", "Task ABC" "Task CCC" > > When I try to plot

[R] summary(table)

2009-08-10 Thread mmv.listservs
Hi, Why when I do a summary on a table it cuts off the other variables? It says Other :58 or Other: 120. how can I get the summary for all the variables under ServLoad.Task and Server.Load and Avg. CPU and Max.CPU? Thanks, summary(probF) Reboot.Id ServLoad.Task Server.Load

[R] ordinal response model with spatial autocorrelation

2009-08-10 Thread Thomas Mang
Hi, [note: 4th posting trial - apologize if the other ones would ever show up...] I have a (3-level) ordinal response data set which needs the integration of an spatial autocorrelation structure. What packages / functions are available to fit such a thing ? The heterogeneous, cluster-alike

Re: [R] Matrices

2009-08-10 Thread mmv.listservs
I should give an example for(p in 1:100) { str <- paste("Task", p, sep=" ") task_name[p] <- str } ## first set the random seed so we get the same results set.seed(123) ## now produce some dummy data dummy <- data.frame(A = sample(LETTERS[1:4], 100, replace = TRUE), B =

Re: [R] Simple Question: adding points to a boxplot

2009-08-10 Thread Farley, Robert
I think there's a miss-understanding of my datasets, and why I'm asking this question. I have one dataframe with ~18 observations ("actual" data) each of ~40 things. I independently made an estimate using a very complex model resulting in a value for each of those 40 things. I created a boxpl

Re: [R] Matrices

2009-08-10 Thread mmv.listservs
Gavin and Stefan, Both the subset commands and the flag were exactly what I needed. On another note, I'm dealing with variables that are categorical and have long names like "Task XYZ", "Task ABC" "Task CCC" When I try to plot against the probability it doesn't show me the Task name anymore. How

Re: [R] strsplit a matrix

2009-08-10 Thread Henrique Dallazuanna
Try this: #1 gsub(".*-", "", zzz) #2 gsub("-.*", "", zzz) On Mon, Aug 10, 2009 at 1:56 PM, James Perkins wrote: > Dear all, > > I am trying to split a matrix into 2 as efficiently as possible. > > It is a character matrix: > > 1 2 3 1 "2-271" "2-367" "1-79" > 2 "2-282" "2-378"

Re: [R] RES: Saving plots to file

2009-08-10 Thread Ronggui Huang
Or you can plot first, when you are satisfied with it, copy the plot to another device. for example, >X11() >plot(rnorm(10)) >dev.copy(png) ## copy the plot to an png file. Best 2009/8/11 Rodrigo Aluizio : > You can save plots as specified below. For details see ?png, ?postscrip, > ?tiff, ?jpeg,

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-10 Thread James W. MacDonald
Bryan Hanson wrote: Hello R Folks... Not a technical question, but I need some advice and perspective. I¹ve got a set of functions I¹m planning to put together into a package. The main hunk of data that gets used by different functions is currently an S3 list. I¹ve been reading about S4 ob

Re: [R] Saving plots to file

2009-08-10 Thread Gabor Grothendieck
On Windows versions of R there is savePlot. Don't know if that exists on Mac too. On Mon, Aug 10, 2009 at 12:25 PM, Sean MacEachern wrote: > Appologies if this has been addressed before, but I can't seem to find it in > the help archives. > > I'm looking to do something like the following but it l

Re: [R] Validity check when setting slot

2009-08-10 Thread Renaud Gaujoux
Hi Martin, Indeed the validObject works, but I was expecting it to be called automatically after a slot assignment. I understand the fact that during their construction, objects' slots are sometime not valid, and thought the check=FALSE was there for such cases. My validity method needs to ch

Re: [R] strsplit a matrix

2009-08-10 Thread Dimitris Rizopoulos
one way us the following: mat <- rbind( c("2-271", "2-367", "1-79"), c("2-282", "2-378", "1-90"), c("2-281", "2-377", "1-89") ) sp <- strsplit(c(mat), "-") mat1 <- sapply(sp, "[", 1) mat2 <- sapply(sp, "[", 2) dim(mat1) <- dim(mat2) <- dim(mat) mat1 mat2 I hope it helps. Best, Dim

Re: [R] Saving plots to file

2009-08-10 Thread Sean MacEachern
Thank you Cedric. That was a nice straight forward example that works great. Cheers, Sean On 8/10/09 11:45 AM, "Cedrick Johnson" wrote: > Try this: > > png(file="Desktop/hist1.png") > plot(glm1$residuals,gain,main = "Hist of residuals and gain") > dev.off() > > -c > > Sean MacEachern wro

[R] strsplit a matrix

2009-08-10 Thread James Perkins
Dear all, I am trying to split a matrix into 2 as efficiently as possible. It is a character matrix: 1 2 3 1 "2-271" "2-367" "1-79" 2 "2-282" "2-378" "1-90" 3 "2-281" "2-377" "1-89" I want to make 2 matrices from this, as succinctly and efficiently as possible. I've tried

Re: [R] Matrices

2009-08-10 Thread Gavin Simpson
On Mon, 2009-08-10 at 11:17 -0400, mmv.listservs wrote: > yy<-poisson2[poisson2$Reboot.Id=="Reboot > 2",poisson2$Task.Status=="F",,drop=FALSE] The above doesn't make any sense and can't be working or doing what you think it is doing. Lets dissect this command: yy <- poisson2[poisson2$Reboot.Id==

[R] RES: Saving plots to file

2009-08-10 Thread Rodrigo Aluizio
You can save plots as specified below. For details see ?png, ?postscrip, ?tiff, ?jpeg, ?bmp. postscript(file = ifelse(onefile, "Rplots.ps", "Rplot%03d.ps"), onefile, family, title, fonts, encoding, bg, fg, width, height, horizontal, pointsize, paper, pagecentre, pr

[R] Re : extraction of elements in a matrice???

2009-08-10 Thread Inchallah Yarab
Thank you Peter it works!!! À : r-help@r-project.org Envoyé le : Lundi, 10 Août 2009, 16h13mn 02s Objet : [R] extraction of elements in a matrice??? i have a matrice M and i want to extract only rows where GWP_Max is positif and smaller than 1000 but it is gi

Re: [R] (sans objet)

2009-08-10 Thread Ben Bolker
something like table(cut(M$GWP_Max,breaks=c(0,1000,3000,1))) Inchallah Yarab wrote: > > i have written this in R, > > >> data1 <- read.csv2("c:/Total1.csv",sep=",") >> data2 <- read.csv2("c:/GWPMax1.csv",sep=",") >> M <- merge(data1, data2, by.x = "Policy.Number", by.y = "Policy.Numbe

Re: [R] (sans objet)

2009-08-10 Thread Gavin Simpson
On Mon, 2009-08-10 at 15:09 +, Inchallah Yarab wrote: > i have written this in R, > > > > data1 <- read.csv2("c:/Total1.csv",sep=",") > > data2 <- read.csv2("c:/GWPMax1.csv",sep=",") > > M <- merge(data1, data2, by.x = "Policy.Number", by.y = "Policy.Number") > > nrow(data1) > [1] 20 > > nr

Re: [R] Saving plots to file

2009-08-10 Thread Cedrick Johnson
Try this: png(file="Desktop/hist1.png") plot(glm1$residuals,gain,main = "Hist of residuals and gain") dev.off() -c Sean MacEachern wrote: Appologies if this has been addressed before, but I can't seem to find it in the help archives. I'm looking to do something like the following but it look

[R] Saving plots to file

2009-08-10 Thread Sean MacEachern
Appologies if this has been addressed before, but I can't seem to find it in the help archives. I'm looking to do something like the following but it looks like save.plot is deprecated. save.plot(plot(glm1$residuals,gain,main = "Hist of residuals and gain"),file="Desktop/hist1.png") Thanks in a

Re: [R] Validity check when setting slot

2009-08-10 Thread Martin Maechler
> "RG" == Renaud Gaujoux > on Mon, 10 Aug 2009 17:19:12 +0200 (SAST) writes: RG> Hi, RG> I'm wondering if the following behaviour is normal: RG> setClass('A', representation(number='numeric'), RG> validity=function(object){ RG> if( obj...@number < -1 ) return("I

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-10 Thread Gabor Grothendieck
On Mon, Aug 10, 2009 at 11:03 AM, Bryan Hanson wrote: > itself doesn't take advantage of much, except the ability to define > subclasses at a later date (maybe that is sufficient reason though). S3 supports subclasses too. __ R-help@r-project.org mailin

Re: [R] sweave and R. Searching for a document that will get mestarted

2009-08-10 Thread Gabor Grothendieck
1. Install R, Adobe Reader (or other pdf reader) and also install MiKTeX. Finally, download this example Sweave input file: http://www.stat.uni-muenchen.de/~leisch/Sweave/example-2.Snw and do this from the Windows cmd console: Rcmd Sweave example-2.Snw pdflatex example-2.tex example-2.

Re: [R] Produce single line graph title composed of text and computed values.

2009-08-10 Thread Erik Iverson
See the ?paste function, instead of the ?c function. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of John Sorkin Sent: Monday, August 10, 2009 10:36 AM To: r-help@r-project.org Subject: [R] Produce single line graph title composed

Re: [R] Produce single line graph title composed of text and computed values.

2009-08-10 Thread Sarah Goslee
You need to use paste() instead of c(). Sarah On Mon, Aug 10, 2009 at 11:35 AM, John Sorkin wrote: > R 2.81 > Windows XP > > > I am trying to produce a title that combines: > text, a computed value, text,  a computed value > > The title contains everything I want, but each element of the title is

[R] Produce single line graph title composed of text and computed values.

2009-08-10 Thread John Sorkin
R 2.81 Windows XP I am trying to produce a title that combines: text, a computed value, text, a computed value The title contains everything I want, but each element of the title is on a separate line, i.e. my title is five lines long. Is there anyway I can force the entire title to be on th

[R] Validity check when setting slot

2009-08-10 Thread Renaud Gaujoux
Hi, I'm wondering if the following behaviour is normal: setClass('A', representation(number='numeric'), validity=function(object){ if( obj...@number < -1 ) return("Invalid number"); TRUE}) >[1] "A" a <- new('A') a >An object of class “A” >Slot "number": >numeric(0) a...@number <- 0 a...@number

Re: [R] Matrices

2009-08-10 Thread mmv.listservs
yy<-poisson2[poisson2$Reboot.Id=="Reboot 2",poisson2$Task.Status=="F",,drop=FALSE] doesn't work either? Any other ideas? On Mon, Aug 10, 2009 at 11:01 AM, mmv.listservs wrote: > How do you access all the column attributes associated with a column reboot > instance? > > The variables > > poisson

[R] Again: Help with a loop (coefficients with lmList) (now with a good reproducible example)

2009-08-10 Thread Cecilia Carmo
Hi R-helpers: #I start with the reproducible example: firm<-sort(rep(1:1000,10),decreasing=F) year<-rep(1998:2007,1000) industry<-rep(c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10),rep(6,10),rep(7,10),rep(8,10),rep(9,10), rep(10,10)),1000) X1<-rnorm(1) X2<-rnorm(1,mean=0.5,sd=0.1) Y<

[R] (sans objet)

2009-08-10 Thread Inchallah Yarab
i have written this in R, > data1 <- read.csv2("c:/Total1.csv",sep=",") > data2 <- read.csv2("c:/GWPMax1.csv",sep=",") > M <- merge(data1, data2, by.x = "Policy.Number", by.y = "Policy.Number") > nrow(data1) [1] 20 > nrow(M) [1] 12 > NbOfPolicyWithoutGWPMax <- nrow(data1)-nrow(M) > NbOfPolicyWit

[R] install package version compatible with on older version of R

2009-08-10 Thread Renaud Gaujoux
Hi, I'm trying to install Chipster (for microarray analysis: http://chipster.csc.fi/), which expressly relies on R 2.6.1 (for now). So I'd like to install automatically (i.e. using a 'install.packages' like function) the last version of a package compatible with the running R version. For exam

[R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-10 Thread Bryan Hanson
Hello R Folks... Not a technical question, but I need some advice and perspective. I¹ve got a set of functions I¹m planning to put together into a package. The main hunk of data that gets used by different functions is currently an S3 list. I¹ve been reading about S4 objects, and I see the (nu

[R] Matrices

2009-08-10 Thread mmv.listservs
How do you access all the column attributes associated with a column reboot instance? The variables poisson2 ~ a matrix with 10,000 rows and 8 column attributes. Things I tried: This command only returns a vector for one of the column attributes x1_prob <- poisson2$Probability[poisson2$Reboot.

  1   2   >