Re: [R] Dropping rows conditionally

2009-03-04 Thread Adrian Dusa
Hi Lazarus, It would be more simple with mdat as a matrix (before coercing to a data.frame). It might be a simpler way to compare a matrix with a vector but I don't find it for the moment; in any case, this works: mdatT <- matrix(mdat %in% c(1, 11, 20), ncol=3) > mdat[!apply(mdatT, 1, any), ]

Re: [R] Question about the use of large datasets in R

2009-03-04 Thread Thomas Lumley
On Wed, 4 Mar 2009, Vadlamani, Satish {FLNA} wrote: Hi: Sorry if this is a double post. I posted the same thing this morning and did not see it. I just started using R and am asking the following questions so that I can plan for the future when I may have to analyze volume data. 1) What are

Re: [R] Inference for R Spam

2009-03-04 Thread Wacek Kusnierczyk
Rolf Turner wrote: > > Sports scores are random variables. You don't know a priori what the > scores are > going to be, do you? (Well, if you do, you must be able to make a > *lot* of money > betting on games!) After the game is over they aren't random any > more; they're > just numbers. But th

[R] Dropping rows conditionally

2009-03-04 Thread Lazarus Mramba
Dear R-help team, I am getting addicted to using R but keep on getting many challenges on the way especially on data management (data cleaning). I have been wanting to drop all the rows if there values are `NA' or have specific values like 1 or 2 or 3. mdat <- matrix(1:21, nrow = 7, ncol=3,

Re: [R] new r user

2009-03-04 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Kris > Sent: Wednesday, March 04, 2009 8:28 PM > To: r-help@r-project.org > Subject: [R] new r user > > When adding a trend line to a scatterplot (e.g. abline > (90,4,col="red")

[R] new r user

2009-03-04 Thread Kris
When adding a trend line to a scatterplot (e.g. abline (90,4,col="red"), I believe the "90" is the intercept and "4" is the slope. How do I determine the intercept and slope for the abline command? Kristopher R. Deininger Management Strategy & Entrepreneurship PhD Student 2012 Robert H. Smith

Re: [R] new user

2009-03-04 Thread stephen sefick
try ?abline everything should be there for you stephen sefick On Wed, Mar 4, 2009 at 11:30 PM, kris deininger wrote: > > > > When adding a trend line to a scatterplot (e.g. abline > (90,4,col=”red”), I believe the “90” is the intercept and “4” is the > slope.  How do I determine the intercept a

Re: [R] Bug in by() with dates as levels?

2009-03-04 Thread hadley wickham
On Wed, Mar 4, 2009 at 5:22 PM, oren cheyette wrote: > Trying to use dates in their R-native form (e.g., POSIXct) rather than > turning them into character strings, I've encountered the following problem. > I create a data frame where one column is dates. Then I use "by()" to do a > calculation on

Re: [R] output formatting

2009-03-04 Thread Pele
Hi Kingsford - this is exactly what I am looking for... Many thanks!! Kingsford Jones wrote: > > I'm guessing you processed a data frame with the 'by' function. > Rather than restructuring the by output, try using a different > function on your data frame. For example > >> #install.packages(d

[R] new user

2009-03-04 Thread kris deininger
When adding a trend line to a scatterplot (e.g. abline (90,4,col=”red”), I believe the “90” is the intercept and “4” is the slope. How do I determine the intercept and slope for the abline command? _ eet. [[alternative

Re: [R] output formatting

2009-03-04 Thread Kingsford Jones
I'm guessing you processed a data frame with the 'by' function. Rather than restructuring the by output, try using a different function on your data frame. For example > #install.packages(doBy) > summaryBy(breaks ~ tension + wool, data=warpbreaks, FUN=sum) tension wool breaks.sum 1 LA

Re: [R] listing functions in base package

2009-03-04 Thread Kingsford Jones
On Wed, Mar 4, 2009 at 8:40 PM, Fuchs Ira wrote: > So functions in the base package are all written in C? No, a large proportion are written in R and the code can be seen in the console by typing the function name. C is generally used where speed is a concern. Kingsford > Thanks. > On Mar 4,

Re: [R] listing functions in base package

2009-03-04 Thread Fuchs Ira
So functions in the base package are all written in C? Thanks. On Mar 4, 2009, at 10:26 PM, Kingsford Jones wrote: > see > > https://stat.ethz.ch/pipermail/r-help/2008-January/151694.html > > hth, > Kingsford Jones > > On Wed, Mar 4, 2009 at 7:30 PM, Fuchs Ira wrote: > > How can I print the def

Re: [R] Selecting one row or multiple rows per ID

2009-03-04 Thread Vedula, Satyanarayana
Many thanks, Hadley! It was really helpful. Cheers, Swaroop -Original Message- From: hadley wickham [mailto:h.wick...@gmail.com] Sent: Wednesday, March 04, 2009 9:56 AM To: Vedula, Satyanarayana Cc: r-help@r-project.org Subject: Re: [R] Selecting one row or multiple rows per ID On

Re: [R] listing functions in base package

2009-03-04 Thread Kingsford Jones
see https://stat.ethz.ch/pipermail/r-help/2008-January/151694.html hth, Kingsford Jones On Wed, Mar 4, 2009 at 7:30 PM, Fuchs Ira wrote: > How can I print the definition of a function that is in the base package? > > for example, if I type: > > which.min > > I get > > function (x) > .Internal(w

[R] output formatting

2009-03-04 Thread Pele
Hi R users, I have an R object with the following attributes: > str(sales.bykey1) 'by' int [1:3, 1:2, 1:52] 268 79 118 359 87 147 453 130 81 483 ... - attr(*, "dimnames")=List of 3 ..$ GROUP: chr [1:3] "III" "II" "I" ..$ year : chr [1:2] "2006" "2007" ..$ week : chr [

Re: [R] Package for determining correlation for mixed "Level of Measurement"

2009-03-04 Thread Jason Rupert
Well, it seems like I may need to use a few different correlation coefficient tests: (1) For the Nominal scale to Interval Scale, I may need to be using the Point-biserial correlation coefficients (rpb).  It turns out that the ltm Package calculates that correlation coefficient.   Will be trying

[R] listing functions in base package

2009-03-04 Thread Fuchs Ira
How can I print the definition of a function that is in the base package? for example, if I type: which.min I get function (x) .Internal(which.min(x)) How can I see the definition of this function? Thanks. __ R-help@r-project.org mailing list h

Re: [R] Inference for R Spam

2009-03-04 Thread Rolf Turner
On 5/03/2009, at 3:06 PM, David Winsemius wrote: I mostly agree with you, Rolf (and Gunter). I would challenge your joint use of the term "scientists". My quibble arises not regarding biomedical practitioners (who may be irredeemable as a group) but rather regarding physicists. At least in tha

Re: [R] Regressão linear

2009-03-04 Thread Ben Bolker
Sueli Rodrigues esalq.usp.br> writes: > > Olá. Tenho um arquivo que a cada 6 linhas corresponde uma amostra da qual > preciso dos coeficientes da regressão linear. Como faço para que o > programa distinga a cada 6 linhas como uma amostra e não calcule como um > todo? > Estou usando a função: mode

Re: [R] Inference for R Spam

2009-03-04 Thread David Winsemius
I mostly agree with you, Rolf (and Gunter). I would challenge your joint use of the term "scientists". My quibble arises not regarding biomedical practitioners (who may be irredeemable as a group) but rather regarding physicists. At least in that domain, I believe those domain experts are

[R] Regressão linear

2009-03-04 Thread Sueli Rodrigues
Olá. Tenho um arquivo que a cada 6 linhas corresponde uma amostra da qual preciso dos coeficientes da regressão linear. Como faço para que o programa distinga a cada 6 linhas como uma amostra e não calcule como um todo? Estou usando a função: model=lm(y ~ x) Sueli Rodrigues Eng. Agrônoma - UNES

Re: [R] problems with exporting a chart

2009-03-04 Thread Elena Wilson
Dear Uwe, Thank you very much for your email. I think I have worked out that the problem was related to the coordinates of the legend that are manually specified in the leg_loc command. However, I'm not exactly sure what was wrong with exporting the picture of the plot... To avoid the proble

[R] text at the upper left corner outside of the plot region

2009-03-04 Thread batholdy
Hi, is there a way to place text at the upper left corner (or another corner) of the plot? I want to place it really at the upper left corner of the whole plot (the file I get), not at the upper left corner of the plot-region. I tried text() and mtext(), and corner.label() of the plotri

Re: [R] Bug in by() with dates as levels?

2009-03-04 Thread Jorge Ivan Velez
Dear Oren, Try this: > x <- data.frame(A= c("X", "Y", "X", "X", "Y", "Y", "Z" ), D = + as.POSIXct(c("2008-11-03","2008-11-03","2008-11-03", "2008-11-04", + "2009-01-13", "2009-01-13", "2009-01-13")), Z = 1:7) > > m<-with(x,tapply(Z, list(A,D), sum)) > m[rownames(m)==x$A[1],] 2008-11-03 2008-11-04

Re: [R] Inference for R Spam

2009-03-04 Thread Rolf Turner
On 5/03/2009, at 12:13 PM, Bert Gunter wrote: "The purpose of the subject or discipline ``statistics'' is in essence to answer the question ``could the phenomenon we observed have arisen simply by chance?'', or to quantify the *uncertainty* in any estimate that we make of a quantity." May I

[R] Bug in by() with dates as levels?

2009-03-04 Thread oren cheyette
Trying to use dates in their R-native form (e.g., POSIXct) rather than turning them into character strings, I've encountered the following problem. I create a data frame where one column is dates. Then I use "by()" to do a calculation on grouped subsets of the data. When I try to extract values fro

Re: [R] Inference for R Spam

2009-03-04 Thread Bert Gunter
"The purpose of the subject or discipline ``statistics'' is in essence to answer the question ``could the phenomenon we observed have arisen simply by chance?'', or to quantify the *uncertainty* in any estimate that we make of a quantity." May I take strong issue with this characterization? It i

[R] Question about the use of large datasets in R

2009-03-04 Thread Vadlamani, Satish {FLNA}
Hi: Sorry if this is a double post. I posted the same thing this morning and did not see it. I just started using R and am asking the following questions so that I can plan for the future when I may have to analyze volume data. 1) What are the limitations of R when it comes to handling large da

[R] Test mail

2009-03-04 Thread Vadlamani, Satish {FLNA}
Hi: This is a test mail. Thanks. Satish __ 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 provide commented, minimal, self-contained, reprodu

Re: [R] mapping lat and long with maps package

2009-03-04 Thread David Winsemius
Well, you're the one who offered code without designating what libraries were loaded or required. Here's my sessionInfo, ... what's yours? > sessionInfo() R version 2.8.1 Patched (2009-01-07 r47515) i386-apple-darwin9.6.0 locale: en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached

[R] Map

2009-03-04 Thread Dr. Alireza Zolfaghari
Hi list, I dont know why the top of map gets truncated: I appreciate if any one give me a solution. filename="C:\\temp\\test.pdf" pdf(file=filename, width=15, height=10) library(maps) require("mapproj") longlatLimit<-c(-106.65, -93.53 , 25.93 , 36.49) par(plt=c(0,1,0,1),cex=1,cex.main=1) #Set

Re: [R] mapping lat and long with maps package

2009-03-04 Thread Alina Sheyman
When I run this code i get the following error messages Error in mapgetg(database, gon, as.polygon, xlim, ylim) : NA/NaN/Inf in foreign function call (arg 6) In addition: Warning messages: 1: In min(x, na.rm = na.rm) : no non-missing arguments to min; returning Inf 2: In max(x, na.rm = na.rm)

Re: [R] mapping lat and long with maps package

2009-03-04 Thread David Winsemius
The example on the help page would seem to be completely on point if I understand your desire to be plotting text at particular long,lat coordinates: ?map text(long, lat, "text") # data(ozone) map("state", xlim = range(ozone$x), ylim = range(ozone$y)) text(ozone$x, ozone$y, ozone$median) bo

[R] mapping lat and long with maps package

2009-03-04 Thread Alina Sheyman
I am trying to overlay a data frame with lat and longitude(which refer to zip codes) on the map of US that I get by using map ("states"). Is there anyway to do this or do I have to resort to using maptools? thank you [[alternative HTML version deleted]] __

Re: [R] how to create many variables at one time?

2009-03-04 Thread David Winsemius
You can also change the column names to something else en mass: colnames(dat) <- paste("X",1:100,sep="") I next tried constructing the X names inside data.frame, but failed using the paste function. The help page for data.frame has a paragraph that begins "How the names of the data frame are

Re: [R] help with GAM

2009-03-04 Thread Daniel Malter
Type unique(density) How many different unique values does density take? The wiggliness of the smooth term consumes degrees of freedom. That is, the more wiggly your smooth term, the more DFs it consumes. If you get the error you got, you have to reduce the degrees of freedom alloted to the smooth

Re: [R] How to generate fake population (ie. not sample) data?

2009-03-04 Thread HBaize
Could that be extended to generate a population data set with known skew and kurtosis? If so, how? Thanks in advance for suggested solutions. Harold Daniel Nordlund-2 wrote: > > > > Something like this may help get you started. > > std.pop <- function(x,mu,stdev){ > ((x-mean(x))/sd(x

Re: [R] how to create many variables at one time?

2009-03-04 Thread jim holtman
Have you considered using a 'list'? much easier to manage than a lot of individual objects. mylist <- lapply(1:100, runif) On Wed, Mar 4, 2009 at 4:34 PM, Manli Yan wrote: >  Hi: >  I need to create many variables at one time,how to do this in R? >  for eg ,X1,X2...X100? > >  Thanks~ > >  

Re: [R] changing font size for y-axis factor labels

2009-03-04 Thread Kingsford Jones
Does cex.axis not work in that it reduces the size for both x and y axes? If that's the case try calling plot with axes=FALSE, and then add axes seperately with the axis function. Kingsford Jones On Wed, Mar 4, 2009 at 1:59 PM, Tiffany Vidal wrote: > I am trying to reduce the font size for y-ax

Re: [R] place text out of plot region

2009-03-04 Thread Eik Vettorazzi
Why use text()? There is a function called "mtext" for that task. hth. batho...@googlemail.com schrieb: Hi, is there a way to place text out of the plot region with text() ? thanks! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

Re: [R] how to create many variables at one time?

2009-03-04 Thread Jorge Ivan Velez
Dear Manli, Do you mean the names of the variables? If so, something like this should work: paste('X',1:100,sep="") HTH, Jorge On Wed, Mar 4, 2009 at 4:34 PM, Manli Yan wrote: > Hi: > I need to create many variables at one time,how to do this in R? > for eg ,X1,X2...X100? > > Thank

Re: [R] how to create many variables at one time?

2009-03-04 Thread Eik Vettorazzi
Hi Manli, you may consider structuring your data in some appropriate form like data.frame or list. Its often not the best way holding information separated in many variables. But if you *really* want to create 100 separate variables, something like for (i in 1:100) assign(paste("X",i,sep=""),

[R] place text out of plot region

2009-03-04 Thread batholdy
Hi, is there a way to place text out of the plot region with text() ? thanks! __ 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 provide

Re: [R] how to create many variables at one time?

2009-03-04 Thread Kingsford Jones
On Wed, Mar 4, 2009 at 2:34 PM, Manli Yan wrote: >  Hi: >  I need to create many variables at one time,how to do this in R? >  for eg ,X1,X2...X100? It depends what you want. If you want 100 random normal variables of length 10, stored in a data.frame with names V1, V2, ..., V100 try dat <-

Re: [R] FW: flow control

2009-03-04 Thread William Dunlap
The help page for ?"for" says that: The index seq in a for loop is evaluated at the start of the loop; changing it subsequently does not affect the loop. The variable var has the same type as seq, and is read-only: assigning to it does not alter seq. The help file is not right when se

Re: [R] Colormap that look good in gray scale

2009-03-04 Thread thibert
Thanks, Here is my partial solution, from what you suggested me: library(TeachingDemos) z<-colors() zz<-col2grey(z) #index sorted zzz<-sort(zz,index.return = TRUE)$ix x<-z # colors in order or their greyscale y<-z # greyscale sorted in gradient for (i in 1:length(z)){ x[i]<-z[zzz[i]] y[

[R] changing font size for y-axis factor labels

2009-03-04 Thread Tiffany Vidal
I am trying to reduce the font size for y-axis labels, not ylab, but the actual categorical names. I have tried cex, cex.axis, cex.lab, font, but none seem to do the trick. Any ideas? thank you. __ R-help@r-project.org mailing list https://stat.ethz.

[R] how to create many variables at one time?

2009-03-04 Thread Manli Yan
Hi: I need to create many variables at one time,how to do this in R? for eg ,X1,X2...X100? Thanks~ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] adding value labels on Interaction Plot

2009-03-04 Thread Dimitri Liakhovitski
I'll reply to my own post - to make sure no one wastes his/her time on that. I was able to solve the problem only after I modified the original function interaction.plot (see below). All I did I added one line before the final } - asking it to return the means on the numeric (dependent) variable. A

Re: [R] FW: flow control

2009-03-04 Thread Christos Hatzis
Hi Ken, The help page for ?"for" says that: The index seq in a for loop is evaluated at the start of the loop; changing it subsequently does not affect the loop. The variable var has the same type as seq, and is read-only: assigning to it does not alter seq. So you cannot do what you want to do

Re: [R] Eliminate Factors from Data Frame

2009-03-04 Thread David Winsemius
It's in the R-FAQ. I can't remember it's 7.20 or 7.35 but it's in that general area. -- David Winsemius On Mar 4, 2009, at 3:38 PM, Bob Roberts wrote: Hi, I formed a 49 by 3 data frame by reading in a text file using read.table(), and combining it with a matrix that I made by using un

[R] FW: flow control

2009-03-04 Thread Lo, Ken
Hi all, I need a little help with flow control in R. What I'd like to do is to advance a for loop by changing its counter. However, what seems obvious to me does not yield the proper results. An example of my problem is for (i in seq(1, some_number, some_increment)){ if (some

Re: [R] adding value labels on Interaction Plot

2009-03-04 Thread Dimitri Liakhovitski
Thank you, David, however, I am not sure this approach works. Let's try it again - I slightly modifed d to make it more clear: d=data.frame(xx=c(1,1,1,1,2,2,2,2,3,3,3,3),yy=c(3,3,4,4,3,3,4,4,3,3,4,4),zz=c(-1.1,-1.3,0,0.6,-0.5,1,3.3,-1.3,4.4,3.5,5.1,3.5)) d[[1]]<-as.factor(d[[1]]) d[[2]]<-as.factor

Re: [R] Grouped Boxplot

2009-03-04 Thread Richard M. Heiberger
## you may need to ## install.packages("HH") library(HH) tmp <- data.frame(y=rnorm(500), g=rep.int(c("A", "B", "C", "D"), 125), a=factor(rbinom(500, 1, .5))) bwplot(y ~ g | a, data=tmp) bwplot(y ~ a | g, data=tmp) tmp$ga <- with(tmp, interaction(a, g)) posi

[R] Eliminate Factors from Data Frame

2009-03-04 Thread Bob Roberts
Hi, I formed a 49 by 3 data frame by reading in a text file using read.table(), and combining it with a matrix that I made by using unlist() on a list of character strings. I would like to do some simple arithmetic operations on the elements in the data frame columns (e.g. column 3/column2) b

[R] (no subject)

2009-03-04 Thread DingJane
Hi, every body! I am a new comer for R, so my question would unavoidablely sounds stupid. Sorry! in my experiment, there are two type of soil ( soil F and soil D), each half of them were subjected to steam sterilize (result in FS and DS soil). A equal volume of soil from two of the four soil typ

Re: [R] modifying a built in function from the stats package (fixing arima)

2009-03-04 Thread Rolf Turner
On 4/03/2009, at 10:06 PM, Marc Vinyes wrote: Dear Carlos and Kjetil, Thanks for your answer. I do not think that is the way to go. If you believe that your algorithm is better than the existing one, talk to the author of the package and discuss the improvement. The whole community will

Re: [R] Inference for R Spam

2009-03-04 Thread Rolf Turner
On 5/03/2009, at 4:54 AM, Michael A. Miller wrote: "Rolf" == Rolf Turner writes: On 4/03/2009, at 11:50 AM, Michael A. Miller wrote: Sports scores are not statistics, they are measurements (counts) of the number of times each team scores. There is no sampling and vanishingly small possi

Re: [R] Colormap that look good in gray scale

2009-03-04 Thread Greg Snow
This does not fully answer your question, but there is a function col2grey (or col2gray) in the TeachingDemos package that will help you see what a given color plot will look like (approximately) when printed/photocopied in grayscale. For your example you would do something like: > plot(1:6,col

Re: [R] Grouped Boxplot

2009-03-04 Thread David Winsemius
Q1: See if this seems any better. I took the liberty of reconstruction your initial example in a longer dataframe: dta <- data.frame(val = sample(t,1000), g = gl(4, 250, labels=c("A", "B", "C", "D")) , G2 = gl(2,1, labels=c("XX", "YY"))) #arguments to data.frame are recycled so one does no

Re: [R] Diff btw percentile and quantile

2009-03-04 Thread Wacek Kusnierczyk
William Dunlap wrote: > I entered the same x into Excel 2003 and used the formulae > =percentile(A1:10,0), > =percentile(A1:A10,.125), ..., =percentile(A1:A10,1) and got the results >1, 1.125, 2.25, 3, 4, 6.875, 8, 8.875, 10 > This matches only R's type 7, the default. > hurray! in this

Re: [R] Table Transformation

2009-03-04 Thread hadley wickham
On Wed, Mar 4, 2009 at 11:58 AM, Christian Pilger wrote: > > Dear R-experts, > > recently, I started to discover the world of R. I came across a problem, > that I was unable to solve by myself (including searches in R-help, etc.) > > I have a flat table similar to > > key1    key2    value1 > > ab

[R] dividing ts objects of different frequencies

2009-03-04 Thread Stephen J. Barr
Hello, First, sorry for sending HTML emails earlier. This should now be in plain-text mode. I have two time series (ts) objects, 1 is yearly (population) and the other is quarterly (bankruptcy statistics). I would like to produce a quarterly time series object that consists of bankruptcy/populati

Re: [R] Table Transformation

2009-03-04 Thread Paul Johnson
On Wed, Mar 4, 2009 at 11:58 AM, Christian Pilger wrote: > > Dear R-experts, > > recently, I started to discover the world of R. I came across a problem, > that I was unable to solve by myself (including searches in R-help, etc.) > > I have a flat table similar to > > key1    key2    value1 > > ab

Re: [R] adding value labels on Interaction Plot

2009-03-04 Thread David Winsemius
See if this helps. After your code, submit this to R: with(d, text(xx[xx==3],zz[xx==3],paste("3, ",zz[xx==3]))) After that has convinced you that xx and zz are being used properly, you can try the more general approach: with(d, text(xx,zz,paste(xx, " , ", zz))) I would have used ZZ rather

Re: [R] best fit line

2009-03-04 Thread Jorge Ivan Velez
Hi Anuj, Take a look at ?nls. It might be useful in this case. HTH, Jorge On Wed, Mar 4, 2009 at 1:22 PM, anujgoel wrote: > > Dear R Community, > I am plotting this simple x-y plot (raw data & plot attached). > I cant fit a linear regression line to it. I have to figure out what is the > best

Re: [R] Diff btw percentile and quantile

2009-03-04 Thread William Dunlap
Excel 2003's help for percentile just says it interpolates between the quantiles in the data: Array is the array or range of data that defines relative standing. K is the percentile value in the range 0..1, inclusive. If array is empty or contains more than 8,191 data points,

[R] Grouped Boxplot

2009-03-04 Thread soeren . vogel
Pls forgive me heavy-handed data generation -- newby ;-) ### start ### # example data g <- rep.int(c("A", "B", "C", "D"), 125) t <- rnorm(5000) a <- sample(t, 500, replace=TRUE) b <- sample(t, 500, replace=TRUE) # what I actually want to have: boxplot(a | b ~ g) # but that does obviously not pr

Re: [R] best fit line

2009-03-04 Thread David Winsemius
On Mar 4, 2009, at 1:22 PM, anujgoel wrote: Dear R Community, I am plotting this simple x-y plot (raw data & plot attached). I cant fit a linear regression line to it. I have to figure out what is the best fit for this graph. That is virtually impossible to define rigorously. The "best fi

[R] arima additive seasonality

2009-03-04 Thread Martin Ivanov
Hello! I asked in this forum about what kind of seasonality the function arima() from stats implements. Now that I have been answered that it implements the Box-Jenkins multiplicative seasonality, I would like to ask whether there is in R possibility to model ARIMA with additive seasonality. I m

[R] dividing ts objects of different frequencies

2009-03-04 Thread Stephen J. Barr
Hello, I have two time series objects, 1 is yearly (population) and the other is quarterly (bankruptcy statistics). I would like to produce a quarterly time series object that consists of bankruptcy/population. Is there a pre-built function to intelligently divide these time series: br.ts = ts(da

Re: [R] best fit line

2009-03-04 Thread Uwe Ligges
anujgoel wrote: Dear R Community, I am plotting this simple x-y plot (raw data & plot attached). I cant fit a linear regression line to it. I have to figure out what is the best fit for this graph. Is there a way to tell which regression to use for this kind of data? Also, after selecting the

Re: [R] Colormap that look good in gray scale

2009-03-04 Thread Achim Zeileis
On Wed, 4 Mar 2009, thibert wrote: Hi, I am looking for a colormap (in color) that look like a gradient in gray scale. It is to allow people without color printer to print the color graph and have something meaningful in gray scale. It can be something like this plot(1:6,col=c(1,7,5,3,2,4),p

Re: [R] scatter plot question

2009-03-04 Thread Tim Cavileer
At 12:19 AM 3/4/2009, you wrote: plot(x,rho,pch=id) Or this. Tim > dat id x rho 1 A 1 0.1 2 B 20 0.5 3 C 2 0.9 > labels<-dat$id > labels [1] "A" "B" "C" > plot(dat$x,dat$rho,pch=labels) __ R-help@r-project.org mailing list https://stat.ethz

Re: [R] Table Transformation

2009-03-04 Thread Uwe Ligges
See ?reshape Uwe Ligges Christian Pilger wrote: Dear R-experts, recently, I started to discover the world of R. I came across a problem, that I was unable to solve by myself (including searches in R-help, etc.) I have a flat table similar to key1key2value1 abcd_1 BP 10 abcd_1

Re: [R] adding value labels on Interaction Plot

2009-03-04 Thread Paul Johnson
On Wed, Mar 4, 2009 at 10:52 AM, Dimitri Liakhovitski wrote: > Hello - and sorry for what might look like a simple graphics question. > > I am building an interaction plot for d: > > d=data.frame(xx=c(3,3,2,2,1,1),yy=c(4,3,4,3,4,3),zz=c(5.1,4.4,3.5,3.3,-1.1,-1.3)) > d[[1]]<-as.factor(d[[1]]) > d[[

[R] Colormap that look good in gray scale

2009-03-04 Thread thibert
Hi, I am looking for a colormap (in color) that look like a gradient in gray scale. It is to allow people without color printer to print the color graph and have something meaningful in gray scale. It can be something like this plot(1:6,col=c(1,7,5,3,2,4),pch=c(1,20,20,20,20,20)) but with an

[R] Table Transformation

2009-03-04 Thread Christian Pilger
Dear R-experts, recently, I started to discover the world of R. I came across a problem, that I was unable to solve by myself (including searches in R-help, etc.) I have a flat table similar to key1key2value1 abcd_1 BP 10 abcd_1 BSMP1A abcd_1 PD 25 abcd_2 BP 20 a

[R] best fit line

2009-03-04 Thread anujgoel
Dear R Community, I am plotting this simple x-y plot (raw data & plot attached). I cant fit a linear regression line to it. I have to figure out what is the best fit for this graph. Is there a way to tell which regression to use for this kind of data? Also, after selecting the best fit model, I n

Re: [R] change individual label colours in a cluster plot?

2009-03-04 Thread Sur Nathan
Hi Jim, How are you? I saw your posting. I am trying to do clustering for co authorship.What I have is undirected graph .I want to have clusters for 393 nodes. I am attaching the file along with this mail.If you move to the section Cluster I am looking to do something like that.Is it somethin

[R] help with GAM

2009-03-04 Thread Las dA
Hi I'm trying to do a GAM analysis and have the following codes entered into R (density is = sample number, alive are the successes) density<-as.real(density) y<-cbind(alive,density-alive) library(mgcv) m1<-gam(y~s(density),binomial) at which point I get the following error message Error in

Re: [R] Unrealistic dispersion parameter for quasibinomial

2009-03-04 Thread Prof Brian Ripley
For the record residuals(model) 1 2 3 4 5 5.55860143 -0.00073852 2.49255235 -1.41987341 -0.00042425 6 7 8 -0.94389158 2.72987046 -1.15760836 residuals(model, "pearson") 1 2 3

Re: [R] regular expression question

2009-03-04 Thread Wacek Kusnierczyk
Greg Snow wrote: > Here is another approach that still uses strspit if you want to stay with > that: > > >> tmp <- '(-0.791,-0.263].(-38,-1.24].(0.96,2.43]' >> strsplit(tmp, '\\.(?=\\()', perl=TRUE) >> > [[1]] > [1] "(-0.791,-0.263]" "(-38,-1.24]" "(0.96,2.43]" > > This uses the Per

[R] dividing time series of different frequencies

2009-03-04 Thread Stephen J. Barr
Hello, I have two time series objects, 1 is yearly (population) and the other is quarterly (bankruptcy statistics). I would like to produce a quarterly time series object that consists of bankruptcy/population. Is there a pre-built function to intelligently divide these time series. The series I

Re: [R] lattice: remove box around a wireframe

2009-03-04 Thread Thomas Roth (geb. Kaliwe)
:-) works! Sundar Dorai-Raj schrieb: (Sorry for the repeat. Forgot to copy R-help) Try, test = data.frame(expand.grid(c(1:10), c(1:10))) z = test[,1] + test[,2] test = cbind(test, z) names(test) = c("x", "y", "z") require(lattice) wireframe(z ~ x*y, data = test, par.settings = list(axis.line

Re: [R] regular expression question

2009-03-04 Thread Greg Snow
Here is another approach that still uses strspit if you want to stay with that: > tmp <- '(-0.791,-0.263].(-38,-1.24].(0.96,2.43]' > strsplit(tmp, '\\.(?=\\()', perl=TRUE) [[1]] [1] "(-0.791,-0.263]" "(-38,-1.24]" "(0.96,2.43]" This uses the Perl 'look-ahead' indicator to say only match on

Re: [R] Diff btw percentile and quantile

2009-03-04 Thread Ted Harding
On 04-Mar-09 16:56:14, Wacek Kusnierczyk wrote: > (Ted Harding) wrote: > >> So, with reference to your original question >> "Excel has percentile() function. R function quantile() does the >> same thing. Is there any significant difference btw percentile >> and quantile?" >> the answer is tha

Re: [R] behavior of squishplot in TeachingDemos

2009-03-04 Thread Greg Snow
Thank you for finding this. Yes in some cases the parameter settings need to be updated by a call to plot.new for the calculations to be correct (if you carried out your example 2 more times you would see that the 3rd plot is also incorrect since it is still using the dimensions of the 2nd plot

Re: [R] lattice: remove box around a wireframe

2009-03-04 Thread Sundar Dorai-Raj
(Sorry for the repeat. Forgot to copy R-help) Try, test = data.frame(expand.grid(c(1:10), c(1:10))) z = test[,1] + test[,2] test = cbind(test, z) names(test) = c("x", "y", "z") require(lattice) wireframe(z ~ x*y, data = test, par.settings = list(axis.line = list(col = "transparent")), par.box =

[R] readline in vi mode on OSX

2009-03-04 Thread Dave Murray-Rust
Hi All, This is a slightly arcane question, but I'm wondering if anyone else uses vi mode with R? On my platform, across several versions, there is some broken behaviour. When executing commands like 'df)' (to delete up to the next bracket) the cursor moves to the next ), but nothing is d

Re: [R] Diff btw percentile and quantile

2009-03-04 Thread Wacek Kusnierczyk
(Ted Harding) wrote: > So, with reference to your original question > "Excel has percentile() function. R function quantile() does the > same thing. Is there any significant difference btw percentile > and quantile?" > the answer is that they in effect give the same results, though > differ

[R] adding value labels on Interaction Plot

2009-03-04 Thread Dimitri Liakhovitski
Hello - and sorry for what might look like a simple graphics question. I am building an interaction plot for d: d=data.frame(xx=c(3,3,2,2,1,1),yy=c(4,3,4,3,4,3),zz=c(5.1,4.4,3.5,3.3,-1.1,-1.3)) d[[1]]<-as.factor(d[[1]]) d[[2]]<-as.factor(d[[2]]) print(d) interaction.plot(d$xx, d$yy, d$zz, type

[R] Error in -class : invalid argument to unary operator

2009-03-04 Thread srfc
Hi guys I have been using R for a few months now and have come across an error that I have been trying to fix for a week or so now.I am trying to build a classifer that will classify the wine dataset using Naive Bayes. My code is as follows library (e1071) wine<- read.csv("C:\\Rproject\\Wine\\

Re: [R] Diff btw percentile and quantile

2009-03-04 Thread Ted Harding
On 04-Mar-09 16:10:29, megh wrote: > Yes, I aware of those definitions. However I wanted to know the > difference btw the words "Percentile" and "quantile", if any. > Secondly your link navigates to some non-english site, which I could > not understand. "Percentile" and "quantile" are in effect t

[R] lattice: remove box around a wireframe

2009-03-04 Thread Thomas Roth (geb. Kaliwe)
#Hi, # #somebody knows how to remove the outer box around a wireframe and reduce the height # # test = data.frame(expand.grid(c(1:10), c(1:10))) z = test[,1] + test[,2] test = cbind(test, z) names(test) = c("x", "y", "z") require(lattice) wireframe(z ~ x*y, data = test, par.box = c(col = "tran

Re: [R] Diff btw percentile and quantile

2009-03-04 Thread megh
Yes, I aware of those definitions. However I wanted to know the difference btw the words "Percentile" and "quantile", if any. Secondly your link navigates to some non-english site, which I could not understand. Dieter Menne wrote: > > megh yahoo.com> writes: > > > >> To calculate Percenti

Re: [R] How to generate fake population (ie. not sample) data?

2009-03-04 Thread Daniel Nordlund
> -Original Message- > From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] > Sent: Wednesday, March 04, 2009 3:17 AM > To: Daniel Nordlund > Cc: r-help@r-project.org > Subject: Re: [R] How to generate fake population (ie. not > sample) data? > > On Wed, Mar 4, 2009 at 2:48 AM, Dani

Re: [R] Inefficiency of SAS Programming

2009-03-04 Thread Millo Giovanni
Dear Ajay, just to deny the implicit statement 'corporate user'='moron' surfacing here and there in this interesting thread :^). This might be a statistical regularity but should by no means be considered a theorem, as there are counter-examples available. You can find people willing to learn both

Re: [R] Inference for R Spam

2009-03-04 Thread Michael A. Miller
> "Rolf" == Rolf Turner writes: > On 4/03/2009, at 11:50 AM, Michael A. Miller wrote: >> Sports scores are not statistics, they are measurements >> (counts) of the number of times each team scores. There >> is no sampling and vanishingly small possibility of >> systemati

  1   2   >