Re: [R] (no subject)

2009-07-30 Thread Stein, Luba (AIM SE)
The error message is: "Error in library(lattice) : there is no package called 'lattice'" I have installed it twice because it did not work the first time, so I was not sure if the installation worked out. The strange thing is that the folder lattice is in the folder library. Luba > library(

Re: [R] package lattice can't be loeaded

2009-07-30 Thread Stein, Luba (AIM SE)
The error message is: "Error in library(lattice) : there is no package called 'lattice'" I have installed it twice because it did not work the first time, so I was not sure if it worked. And YES, the folder lattice is in the folder library. What's the error message? Why do you have to install t

Re: [R] adjusting grid on Xaxis ticks

2009-07-30 Thread wapita wapita
Thank you j, its perfect!! Wapita > Date: Fri, 24 Jul 2009 06:41:16 -0400 > Subject: Re: [R] adjusting grid on Xaxis ticks > From: jholt...@gmail.com > To: wap...@hotmail.com > CC: r-help-boun...@r-project.org; r-help@r-project.org > > is this what you want: > > plot(0, xlim=as.POSIXct(c('2009-

Re: [R] how use the subset?

2009-07-30 Thread Steve Lianoglou
Hi, On Jul 31, 2009, at 12:02 AM, Jie TANG wrote: hi ,everyone I want subtract some dataset by subset. From the help running help(subset), ths information is "*subset(airquality, Day == 1, select = -Temp)* " while I running my script written as "*g1data<-subset(errdata, fac>12) *"

Re: [R] Forecasting - Croston Method Error

2009-07-30 Thread Rob Hyndman
Pedro Souto gmail.com> writes: > > Hi, > I tried to use the Croston function from the forecasting package > 1.24 with > the code below, but I get in return this message "*Error in > decompose(ts(x[1L:wind], start = start(x), frequency = f), seasonal) :

[R] how use the subset?

2009-07-30 Thread Jie TANG
hi ,everyone I want subtract some dataset by subset. >From the help running help(subset), ths information is "*subset(airquality, Day == 1, select = -Temp)* " while I running my script written as "*g1data<-subset(errdata, fac>12) *" ,it is wrong with the error information "*subset.default(

[R] write matrix M including names(dimnames(M))

2009-07-30 Thread Steve Jaffe
I can do this by writing (and reading) the file according to some format of my own devising, but I'm wondering if there is a built-in way to write and then restore a matrix with not only the dimnames (which write.table/read.table can preserve) but also the names(dimnames)? Example: > M <- matrix(

Re: [R] truncating values into separate categories

2009-07-30 Thread Bill.Venables
Here is a suggestion: > Per <- c("NA", "1", "2", "3","4") > NP <- c(1, 1, 2, 1, 1, 2, 2, 1, 4, 1, 0, 5, + 3, 3, 1, 5, 3, 5, 1, 6, 1, 2, 2, 2, + 4, 4, 1, 2, 1, 3, 3, 1, 2, 2, 1, 2, 1, 2, + 2, 3, 1, 1, 4, 4, 1, 1, 1, 2, 2, 2) > Person_CAT <- cut(NP, breaks = c(0:4, Inf)-0.5, labe

Re: [R] concatenating multiple columns from files

2009-07-30 Thread Bill.Venables
Here is a suggestion: rawdata <- list.files("./data") mat <- list() for(i in rawdata) mat[[i]] <- read.table(file.path("./data", i)) mat <- data.frame(mat) Bill Venables http://www.cmis.csiro.au/bill.venables/ -Original Message- From: r-help-boun...@r-project.org [mailt

[R] truncating values into separate categories

2009-07-30 Thread PDXRugger
Hi all, Simple question which i thought i had the answer but it isnt so simple for some reason. I am sure someone can easily help. I would like to categorize the values in NP into 1 of the five values in "Per", with the last category("4") representing values >=4(hence 4:max(NP)). The problem

[R] concatenating multiple columns from files

2009-07-30 Thread ferreirafm
R-users, I want to concatenate columns from different files in a single object. I'm doing bad. My peace of code is as follow: rawdata <- list.files("./data") for (i in rawdata) { mat <- read.table(paste(i ,sep="")) } At the end of the loop I have just one column. What I'm doing wrong? Thank

Re: [R] Logistic regression and R

2009-07-30 Thread G. Jay Kerns
Dear Carlos, On Thu, Jul 30, 2009 at 6:11 PM, Carlos López wrote: > Hello everybody :-) > > I have some data that I want to model with a logistic regression, most of > the independent variables are numeric and the only dependent is categorical, > I was thinking that I could apply a logistic regres

Re: [R] Question regarding sqldf

2009-07-30 Thread Gabor Grothendieck
I just answered essentially the same question from another person offline within the last day. Anyways: "Date" class variables are stored as numbers, i.e. days since the Epoch, in R and when transferred to sqlite get transferred as numbers. Try this: > library(sqldf) > DF <- data.frame(a = Sys.

[R] r and ocx

2009-07-30 Thread Applejus
Hello dear community, I have written scripts in r that involve 3d plots (rgl library). I would like to know if there is a possibility of creating an OCX object that contains my code and plot? The reason is I need to embed my r script into another application that only accepts OCX This applicatio

[R] wireframe color

2009-07-30 Thread Marlin Keith Cox
Hello, hopefully simple question, but I cannot find the answer. I need to change the color from the standard default. Still want the scaled colors, but need different colors for different graphs. Code is: wireframe(z ~ y*x, mat.df, drape = TRUE, zlab = list("Water mass error

Re: [R] What is the best method to produce means by categorical factors?

2009-07-30 Thread John Kane
The most common would be aggregate. You can change mean for other functions ( e.g. sum or length, median, or one you write yourself) You probably would find Bob Munechen's book http://rforsasandspssusers.com/ very useful and there is a shorter pdf available on that page. Example: dd <- data.

Re: [R] Testing year effects in lm()

2009-07-30 Thread Achim Zeileis
On Thu, 30 Jul 2009, Mark Na wrote: Dear R-helpers, I have a linear model with a year effect (year is coded as a factor), i.e. the parameter estimates for each level of my year variable have significant P values (see some output below) and I am interested in testing: a) the overall effect of y

Re: [R] Looping through R objects with $ operator and tags

2009-07-30 Thread Vivek Ayer
I figured it out. I understand that R isn't really meant to do this. Essentially, I want to have an object per read csv file which contains columns. But I'm dealing with hundreds of files in a folder and I wanted to automate the importing into R and process stuff without entering the shell and usin

Re: [R] how to change the thickness of the lines of the boxplot outliers

2009-07-30 Thread Paul Murrell
Hi Waverley wrote: Thanks Paul. I reproduced my problem using the example of the ?boxplot which is also at http://stat.ethz.ch/R-manual/R-patched/library/graphics/html/boxplot.html The sample code is as following: boxplot(count ~ spray, data = InsectSprays, col = "lightgray", lwd=40) lwd =

[R] Testing year effect in lm() ***failed first time, sending again

2009-07-30 Thread Mark Na
Dear R-helpers, I have a linear model with a year effect (year is coded as a factor), i.e. the parameter estimates for each level of my year variable have significant P values (see some output below) and I am interested in testing: a) the overall effect of year; b) the significance of each year v

Re: [R] Summarising Data for Forrest Plots

2009-07-30 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
>Ah, I think I see what you want. Try this on each pair of exclusive sets: >Then under65row and over65row should be the first two rows of your result. >Can't test this at the moment, but I don't think it's too far wrong. > I knew this shouldn't need so much work ;-) Not cracked it yet - because

Re: [R] ask help about boxplot , different list variation into the tick of x-axis?

2009-07-30 Thread John Kane
Replying to my own post, it occurred to me that there is a simple solution using the reshape package. Here's an example using some made-up data. #= years <- 1997:2008 set.seed <- 1234 (mydata <- data.frame(matrix(rnorm(60, 25, 5

[R] Testing year effects in lm()

2009-07-30 Thread Mark Na
Dear R-helpers, I have a linear model with a year effect (year is coded as a factor), i.e. the parameter estimates for each level of my year variable have significant P values (see some output below) and I am interested in testing: a) the overall effect of year; b) the significance of each year v

Re: [R] ask help about boxplot , different list variation into the tick of x-axis?

2009-07-30 Thread John Kane
You are trying to apply a funtion to a data.frame that is intended to work on a vector that is indexed on another vector. Try pasting this into R to see what I mean boxplot(len ~ dose, data = ToothGrowth) ToothGrowth --- On Thu, 7/30/09, Jie TANG wrote: > From: Jie TANG > Subject: [R]

[R] how to change the thickness of the lines of the boxplot outliers

2009-07-30 Thread Waverley
Thanks Paul. I reproduced my problem using the example of the ?boxplot which is also at http://stat.ethz.ch/R-manual/R-patched/library/graphics/html/boxplot.html The sample code is as following: boxplot(count ~ spray, data = InsectSprays, col = "lightgray", lwd=40) lwd = 40 is kind of exaggerat

[R] Logistic regression and R

2009-07-30 Thread Carlos López
Hello everybody :-) I have some data that I want to model with a logistic regression, most of the independent variables are numeric and the only dependent is categorical, I was thinking that I could apply a logistic regression using glm but I wanted to deepen my knowledge of this so I tried to

[R] Defining different objects within a loop

2009-07-30 Thread jimdare
Dear R Users, I have a dataset that I have split by group. For each group I plot a figure using: for (i in splitdf){ plot<-xyplot() print(plot) savePlot(filename=paste(i$Group[1]),type="pdf") } This gives me X pdf files where X is the number of groups. Does anyone know a simple

Re: [R] Question regarding sqldf

2009-07-30 Thread milton ruser
How about update R/sqldf? > require(sqlf) Loading required package: sqlf Warning message: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called 'sqlf' > > testframe<-data.frame(sdate=rep(paste + ("day",1:5,sep=""),each=5),bext=runif(25

Re: [R] Superscripts and rounding

2009-07-30 Thread ehux
WORKS!! Thank you for all your help! plot ( decade[['date']], decade[['value']], type = 'l', col = 'lightsteelblue4', ylab = 'Discharge [cms]', main = sprintf('%s [%s]', stn[['metadata']][['name']], stn[['metadata']][['id']]), sub = sprintf('Seasonal station with natural

[R] ask help about boxplot , different list variation into the tick of x-axis?

2009-07-30 Thread Jie TANG
Hi ,everyone. I want to draw a boxplot figure, main script shown as below. when I run the command "boxplot(bjavee~yearname)",it is wrong with the error information " model.frame.default(formula = bjavee ~ yearname) : variation 'bjavee' list is wrong". I want to add the yearname as the x-axis t

Re: [R] Superscripts and rounding

2009-07-30 Thread ehux
This code WORKS but i can not get it to work when i add the rest of the sub-title. I have tried three different ways. # WORKS plot ( decade[['date']], decade[['value']], type = 'l', col = 'lightsteelblue4', ylab = 'Discharge [cms]', main = sprintf('%s [%s]', stn[['metadata']

Re: [R] Looping through R objects with $ operator and tags

2009-07-30 Thread Vivek Ayer
Got that work! Thanks. However, now I need to know how to dump tag values into an object, e.g., TotLogDist <- c(object1$LogDist,object2$LogDist,object3$LogDist ...) [for how many ever objects you provided] Is there a way to loop that? TotLogDist <- NULL for (i in c(1:10)) TotLogDist <- c(TotLog

[R] lmer() and "$ operator is invalid for atomic vectors"

2009-07-30 Thread Angela Radulescu
Hi all, I am a bit mystified by this error message that I get when I try to apply lmer() to a simple dataset with one between factor (age) and one within factor (item): "$ operator is invalid for atomic vectors" I'll just provide the code, because I don't see where the problem is: library(lme

Re: [R] Question regarding sqldf

2009-07-30 Thread Rizzo . Michael
Here is a test data frame: > testframe<-data.frame(sdate=rep(paste ("day",1:5,sep=""),each=5),bext=runif(25,1,100),otherstuff=runif (25,45,60),stuff=runif(25,3,25)) > testframe sdate bext otherstuff stuff 1 day1 37.863859 49.19816 10.036211 2 day1 58.557049 59.23145

[R] how to add the x-axis information

2009-07-30 Thread Jie TANG
Hi ,everyone. I want to draw a boxplot figure, main script shown as below. when I run the command "boxplot(bjavee~yearname)",it is wrong with the error information " model.frame.default(formula = bjavee ~ yearname) : variation 'bjavee' list is wrong". I want to add the yearname as the x-axis ti

[R] wireframe color change from default

2009-07-30 Thread Marlin Keith Cox
Hello, hopefully simple question, but I cannot find the answer. I need to change the color from the standard default. Still want the scaled colors, but need different colors for different graphs. Code is: wireframe(z ~ y*x, mat.df, drape = TRUE, zlab = list("Water mass error

Re: [R] weight median by count for multiple records

2009-07-30 Thread John Kane
This may do it but I have not verified the figures. library(cwhmisc) by(xx[,3:4],xx[,2],function(x,y) weighted.mean(x,y)) --- On Thu, 7/30/09, Kirsten Beyer wrote: > From: Kirsten Beyer > Subject: [R] weight median by count for multiple records > To: r-help@r-project.org > Received: Thursday

Re: [R] Superscripts and rounding

2009-07-30 Thread ehux
could it be that the values accessed in the database are not integers or numeric??? -- View this message in context: http://www.nabble.com/Superscripts-and-rounding-tp24682319p24747282.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Object equality for S4 objects

2009-07-30 Thread Stavros Macrakis
On Thu, Jul 30, 2009 at 4:03 PM, Martin Morgan wrote: > S4 objects are mutable in the sense that one can write replacement methods > for them Understood, but I don't think that's the usual meaning of 'mutable'. -s __ R-help@r-project.org m

Re: [R] for loop for file names

2009-07-30 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of waltzmiester > Sent: Thursday, July 30, 2009 1:29 PM > To: r-help@r-project.org > Subject: Re: [R] for loop for file names > > > Thanks very much for these two solutions, but the

Re: [R] for loop for file names

2009-07-30 Thread John Kane
I'm just guessing but what about letters <- letters[1:6] mynames <- paste("pred/Pred_pres_",letters,"_indpdt") for(i in 1:6) load(mynames[i]) --- On Thu, 7/30/09, waltzmiester wrote: > From: waltzmiester > Subject: Re: [R] for loop for file names > To: r-help@r-project.org > Received: Thursd

Re: [R] Superscripts and rounding

2009-07-30 Thread ehux
Good one!! Although i think it is stn - none the less neither works. Polwart Calum (County Durham and Darlington NHS Foundation Trust) wrote: > > Duh! did it again! the variables need str in front of them don't they!! > > sub = sprintf('Seasonal station with natural streamflow - Lat: %s Lon

Re: [R] Summarising Data for Forrest Plots

2009-07-30 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
>Ah, I think I see what you want. Try this on each pair of exclusive sets: > n_total<-dim(mydataset)[1] under65<-mydataset$age <= 65 n_under65<-sum(under65) under65row<-c(sum(mydataset$dose[under65] == "FD"), sum(mydataset$dose[under65] == "RD"), sum(mydataset$vitalstatus[under65] == "dead" &

Re: [R] Problem with RGtk2 & Rattle

2009-07-30 Thread Graham Williams
Hi Wayne - but what version of the other tools have you installed? Regards, Graham 2009/7/30 Wayne Murray > > HI Graham > > Thanks for responding so promptly - unfortunately downloading and running > this new version of Rattle did not alter the outcome - I am however running > on Windows XP >

Re: [R] how to change the thickness of the lines of the boxplot outliers

2009-07-30 Thread Paul Murrell
Hi Waverley wrote: Hi, I tried to use boxplot function. I am following the ?boxplot and can change the whisker box width using lwd parameter. However, when outline=TRUE, the thickness of the circle of the outliers is not proportionally changed when I change the line width of the whisker box.

Re: [R] Scatter Plot

2009-07-30 Thread John Kane
x <- 1:10 y <- 1:10 plot("", xlim=c(1,10),ylim=c(0,10) text(x,y, labels=x) --- On Thu, 7/30/09, amna khan wrote: > From: amna khan > Subject: [R] Scatter Plot > To: r-help@r-project.org > Received: Thursday, July 30, 2009, 12:14 PM > Dear Sir > > I want to write the numbers 1,2,3,on a sca

Re: [R] Superscripts and rounding

2009-07-30 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Duh! did it again! the variables need str in front of them don't they!! sub = sprintf('Seasonal station with natural streamflow - Lat: %s Lon: %s Gross Area %s km\UB2 - Effective Area %s km\UB2 ', round( str[['metadata']][['latitude']], digits=4 ), round( str[['metadata']][['longitude']], digits =

Re: [R] for loop for file names

2009-07-30 Thread waltzmiester
Thanks very much for these two solutions, but they are still printing "Pred_pres_[i]_indpdt" on the screen and not executing the function load Chris baptiste auguie-5 wrote: > > Try this, > > files = paste('pred/Pred_pres_', letters[1:6], '_indpdt',sep="") > > lapply(files, load) > > > HT

Re: [R] for loop for file names

2009-07-30 Thread Henrique Dallazuanna
Try this: sapply(sprintf("pred/Pred_pres_%s_indpt", x), load, envir = .GlobalEnv) You need set the envir argument to global environment inside the sapply. On Thu, Jul 30, 2009 at 5:06 PM, waltzmiester wrote: > > I am trying to load binary files in the following fashion > > load("pred/Pred_pres_

Re: [R] for loop for file names

2009-07-30 Thread baptiste auguie
Try this, files = paste('pred/Pred_pres_', letters[1:6], '_indpdt',sep="") lapply(files, load) HTH, baptiste 2009/7/30 waltzmiester : > > I am trying to load binary files in the following fashion > > load("pred/Pred_pres_a_indpdt") > load("pred/Pred_pres_b_indpdt") > load("pred/Pred_pres_c_ind

[R] constrained input for optimization algorithm

2009-07-30 Thread Zhi Xie
Hi all, It seems that optimization algorithm, optim, tries to find optimized parameters within defined lower and upper bounds. In my problem, all the parameters are integers. My question is that if there is any means that I can let "optim" only tries mutual exclusive integers. To be specific, I am

[R] how to change the thickness of the lines of the boxplot outliers

2009-07-30 Thread Waverley
Hi, I tried to use boxplot function. I am following the ?boxplot and can change the whisker box width using lwd parameter. However, when outline=TRUE, the thickness of the circle of the outliers is not proportionally changed when I change the line width of the whisker box. There must be another

Re: [R] for loop for file names

2009-07-30 Thread Jorge Ivan Velez
Dear Chris, Try this: x <- c("a","b","c","d","e","f") sapply(x, function(i){ i <- paste("pred/Pred_pres_",i,"_indpdt", sep ="") load(i) } ) HTH, Jorge On Thu, Jul 30, 2009 at 4:06 PM, waltzmiester wrote: > > I am trying to load binary files in t

[R] for loop for file names

2009-07-30 Thread waltzmiester
I am trying to load binary files in the following fashion load("pred/Pred_pres_a_indpdt") load("pred/Pred_pres_b_indpdt") load("pred/Pred_pres_c_indpdt") load("pred/Pred_pres_d_indpdt") load("pred/Pred_pres_e_indpdt") load("pred/Pred_pres_f_indpdt") but I would like to set up a for loop to repla

Re: [R] Object equality for S4 objects

2009-07-30 Thread Martin Morgan
Stavros Macrakis wrote: On Thu, Jul 30, 2009 at 12:01 PM, Martin Morgan wrote: S4 objects do not have the semantics of environments, but of lists (or of most other R objects), so it is as meaningful to ask why identical(s1, s2) returns TRUE as it is to ask why identical(list(x=1), list(x=1)) r

Re: [R] Scatter Plot

2009-07-30 Thread Felipe Carrillo
Tri this for both, points and text.. library(ggplot2) qplot(x=1:5,y=1:5) + geom_text(label=1:5) Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA --- On Thu, 7/30/09, amna khan wrote: > From: amna khan > Subject: [

Re: [R] edit.row.names taking row names from the edited dataframe

2009-07-30 Thread Ross Culloch
Hi Chuck, Thank you too for your help and quick reply - that has worked perfectly. I think as Erik pointed out i was going down the wrong road with my attempts to identify the root of the problem. Yet another handy command i'm now aware of! Thanks again, I really appreciate the help! -- View

Re: [R] edit.row.names taking row names from the edited dataframe

2009-07-30 Thread Ross Culloch
Hello Erik, Thanks very much, that works perfectly - thanks also for the link - it seems that i was going down the wrong road with regards to solving this problem! Thanks also for your quick reply! -- View this message in context: http://www.nabble.com/edit.row.names-taking-row-names-from-th

Re: [R] Retrieving original data frame after repetition

2009-07-30 Thread Marc Schwartz
On Jul 30, 2009, at 11:15 AM, Jose Iparraguirre D'Elia wrote: Dear R users, Consider the first two columns of a data frame like this: z[,1:2] x y 1 1 1 2 2 2 3 3 3 4 1 4 Imagine that y represents the times that the value x happens in a population. But z is not exactly a frequency tab

Re: [R] edit.row.names taking row names from the edited dataframe

2009-07-30 Thread Erik Iverson
I didn't test what I wrote, but I see that "id" should be "ID" in the first line of R code; the one with the %in% operator, sorry! -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Erik Iverson Sent: Thursday, July 30, 2009 1:56 PM T

Re: [R] Question regarding sqldf

2009-07-30 Thread milton ruser
Hi Rizzi, how about a reproducible example/data.frame? :-) milton On Thu, Jul 30, 2009 at 1:46 PM, wrote: > > Hello, > > I am having a problem using sqldf. I'm trying to choose a subset of > observations from a data set based on the date and maximum value of a > variable by date. > > Here is

Re: [R] edit.row.names taking row names from the edited dataframe

2009-07-30 Thread Chuck Cleland
On 7/30/2009 2:46 PM, Ross Culloch wrote: > Hi all, > > I am struggling to work out how to use the rownames from an edited dataframe > rather than the row names from the original dataframe. In my data set i'm > trying to extract several rows of data on particular individuals, i don't > doubt i'm u

Re: [R] Scatter Plot

2009-07-30 Thread baptiste auguie
Hi, Try this, plot(1:5,1:5, t='p', pch=paste(1:5)) baptiste 2009/7/30 amna khan : > Dear Sir > > I want to write the numbers 1,2,3,on a scatter plot instead of points, > like 1 corresponding to first point on plot, 2 corresponding second point > etc. > Help in this regard. > > Regards > >

Re: [R] edit.row.names taking row names from the edited dataframe

2009-07-30 Thread Erik Iverson
Hello, Try the following instead of your many separate assignments (I do not like to give objects the name "data", since that is the name of a built-in function). > ids <- subset(mumpup, id %in% c("A1", "B1", ... , "G1")) #in above line, fill in ... with other IDs you want > ids$ID <- factor

[R] edit.row.names taking row names from the edited dataframe

2009-07-30 Thread Ross Culloch
Hi all, I am struggling to work out how to use the rownames from an edited dataframe rather than the row names from the original dataframe. In my data set i'm trying to extract several rows of data on particular individuals, i don't doubt i'm using the long way round but what i have in the way of

[R] Constrained MLE of fixed mean Singh-Maddala distribution

2009-07-30 Thread Josh Parcel
INTRODUCTION TO THE PROBLEM I am trying to fit a distribution to a dataset. The distribution that I am currently considering is the (3-parameter) Singh-Maddala (Burr) distribution. The final model will fix the mean of the distribution to a given value and estimate the remaining parameters accor

[R] Help in Rserve

2009-07-30 Thread joaodaniel
Hello! I've been studying the Rserve for the last few days, and achieved to connect it to a Java plattaform. I also could run some simple commands in R, and plot some graphics. But I did this just using the examples files as a template. Now I'm looking for discover what does all those Java class

[R] Retrieving original data frame after repetition

2009-07-30 Thread Jose Iparraguirre D'Elia
Dear R users, Consider the first two columns of a data frame like this: > z[,1:2] x y 1 1 1 2 2 2 3 3 3 4 1 4 Imagine that y represents the times that the value x happens in a population. But z is not exactly a frequency table, because in z we have x=1 twice. So, the x=1 in the

[R] Scatter Plot

2009-07-30 Thread amna khan
Dear Sir I want to write the numbers 1,2,3,on a scatter plot instead of points, like 1 corresponding to first point on plot, 2 corresponding second point etc. Help in this regard. Regards -- AMINA SHAHZADI Department of Statistics GC University Lahore, Pakistan. [[alternative HTML

Re: [R] Object equality for S4 objects

2009-07-30 Thread Stavros Macrakis
On Thu, Jul 30, 2009 at 12:01 PM, Martin Morgan wrote: > S4 objects do not have the semantics of environments, but of lists (or of > most other R objects), so it is as meaningful to ask why identical(s1, s2) > returns TRUE as it is to ask why identical(list(x=1), list(x=1)) returns TRUE. Thanks

Re: [R] Selecting Bootstrap Method for Quantile Regression

2009-07-30 Thread Mark Difford
Hi Tom, >> For example, if I want to use the "xy-pair bootstrap" how do I indicate >> this in summary.rq? The general approach is documented under summary.rq (sub se option 5). Shorter route is boot.rq, where examples are given. ## ?boot.rq y <- rnorm(50) x <- matrix(rnorm(100),50) fit <- rq(y~

Re: [R] Continue to finish for loop even there is an error in one of rounds.

2009-07-30 Thread Scott Sherrill-Mix
You probably want to wrap the nls(...) in a 'try' or 'tryCatch' function. Scott Scott Sherrill-Mix Department of Microbiology University of Pennsylvania 402B Johnson Pavilion 3610 Hamilton Walk Philadelphia, PA 19104-6076 Phone: 215-573-3141 On Thu, Jul 30, 2009 at 1:14 PM, Liao, Hongsheng

Re: [R] weight median by count for multiple records

2009-07-30 Thread Dimitris Rizopoulos
one approach is: sp <- split(dat[-1], dat$SubjectID) t(sapply(sp, function (d) c(d$SubjectID[1], median(rep(d$Distance_miles, d$Tag) where 'dat' is the name of your data.frame. I hope this helps. Best, Dimitris Kirsten Beyer wrote: Hello everyone, I have a .csv file with the follow

[R] weight median by count for multiple records

2009-07-30 Thread Kirsten Beyer
Hello everyone, I have a .csv file with the following format: uniqueID SubjectID Distance_miles Tag 1 10015.5 3 2 10017 1 3 10016.5

[R] Question regarding sqldf

2009-07-30 Thread Rizzo . Michael
Hello, I am having a problem using sqldf. I'm trying to choose a subset of observations from a data set based on the date and maximum value of a variable by date. Here is the code I am using: test<-sqldf("select distinct * from bextuse group by sdate having bext=max(bext)",method="raw"); The

Re: [R] R User Group listings

2009-07-30 Thread David M Smith
I've also been maintaining a list at: http://blog.revolution-computing.com/local-r-groups.html The most recent addition is the user group in Japan. # David Smith On Thu, Jul 30, 2009 at 5:33 AM, Prof. John C Nash wrote: > > There are now several R geographic user groups, and a few have mailing

Re: [R] lattice shingle plot axis annotation

2009-07-30 Thread baptiste auguie
Hi, Chapter 8 of the lattice book has some examples (you can see the code and figures on r-forge). Perhaps you could try something like this, d = data.frame(x=1:10,y=1:10,f=sample(letters[1:2],10,repl=T)) axis.custom = function(side, ...){ if(side == "bottom") switch(pa

[R] Continue to finish for loop even there is an error in one of rounds.

2009-07-30 Thread Liao, Hongsheng
I am trying to fit a logistic model to my 10 year data (1999-2008) by year. Codes like below: Year <- c(1999: 2008) for(y in 1:length(year)) { file.input <- paste("C:\\", year[y], "\\data.csv", sep="") table <- read.csv(file=fileinput, header=TRUE, as.is=TRUE, na.strings=c("")) i

Re: [R] saving only part of a computation in integrate

2009-07-30 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Mary A. Marion > Sent: Thursday, July 30, 2009 12:56 PM > To: r-help@r-project.org > Subject: [R] saving only part of a computation in integrate > > Hello, > > I am using > Beta

Re: [R] saving only part of a computation in integrate

2009-07-30 Thread Erik Iverson
See ?str > str(Beta) List of 5 $ value : num 0.99 $ abs.error : num 4.22e-06 $ subdivisions: int 4 $ message : chr "OK" $ call: language integrate(f = dnorm, lower = -Inf, upper = 2.3552, mean = 0, sd = 1) - attr(*, "class")= chr "integrate" > Beta$value [1] 0.9907

[R] saving only part of a computation in integrate

2009-07-30 Thread Mary A. Marion
Hello, I am using Beta <-integrate(dnorm,mean=0,sd=1,-Inf,2.3552) > Beta 0.9907436 with absolute error < 4.2e-06 1-Beta results in an error How can I store into Beta only .9907436? Thank you. Sincerely, Mary A. Marion __ R-help@r-project.org mailing

Re: [R] Re lative paths in R?

2009-07-30 Thread Glen Sargeant
See also file.path() and create.dir(). You can use them with getwd() and setwd() to specify and/or create subdirectories, relative to your current working directory. Handy because they allow you to create paths and directories with names derived within functions. For example, I have used them to

Re: [R] Looping through R objects with $ operator and tags

2009-07-30 Thread baptiste auguie
essentially the same, object1 = object2 = object3 = data.frame(Distance = 1:10) foo = function(o){ within(get(o), LogDist <- log10(Distance)) } my.objects = paste("object", 1:3,sep="") lapply(my.objects, foo) It is however advisable to group the initial objects

[R] CRAN + geography = Cranography

2009-07-30 Thread Barry Rowlingson
In response to an earlier discussion about finding the fastest/best/nearest CRAN site, I geocoded (using my geonames package) the locations of the CRAN sites returned by getCRANmirrors. I've mapped them here: http://www.maths.lancs.ac.uk/~rowlings/R/Cranography/ The geocoding may have got it wron

Re: [R] (no subject)

2009-07-30 Thread jim holtman
Exactly why are you trying to load it into the editor? What happens when you execute 'library(lattice)' at the command line? Is there an error message associated with it? Here is what I get: > library(lattice) > It loads just fine. On Thu, Jul 30, 2009 at 11:08 AM, Stein, Luba (AIM SE) wrote:

Re: [R] Looping through R objects with $ operator and tags

2009-07-30 Thread jim holtman
I would first put the objects in a 'list' since it is easier to work with and then use 'lapply': > obj1 <- obj2 <- obj3 <- data.frame(Distance=1:10) > # create a list - earier to work with > list.obj <- list(obj1, obj2, obj3) > > list.obj <- lapply(list.obj, function(x){ + x$LogDist <- log(x$D

Re: [R] USGS stream flow data automatic download R

2009-07-30 Thread Felipe Carrillo
An Excel Web query will also do what you want. From an Excel Workbook create a web query and link it to the USGS website. You can schedule downloads or the query will download data up-to-date everytime the workbook is open. Felipe D. Carrillo Supervisory Fishery Biologist Department of the

[R] Looping through R objects with $ operator and tags

2009-07-30 Thread Vivek Ayer
Hi all, Suppose I want to set the values in a column to the log of the values of another column like so: object$LogDist <- log10(object$Distance) How do I loop through the objects if I have object1, object2, etc to perform this function? object1$LogDist <- log10(object1$Distance) object2$LogDis

Re: [R] Object equality for S4 objects

2009-07-30 Thread Martin Morgan
Hi Stavros -- Stavros Macrakis writes: > To test two environments for object equality (Lisp EQ), I can use 'identity': > >> e1 <- environment(local(function()x)) >> e2 <- environment(local(function()x)) >> identical(e1,e2) # compares object identity > [1] FALSE >> identical(

Re: [R] Plotting two overlapping curves

2009-07-30 Thread Dimitris Rizopoulos
one way is the following: x <- seq(-2, 2, len = 11) y1 <- 2*x^2 + 3*x + 1 y2 <- - 2*x^2 - 3*x + 1 plot(x, y1, type = "l", col = "red", ylim = range(y1, y2)) lines(x, y2, col = "blue") I hope it helps. Best, Dimitris njhuang86 wrote: Hi. Sorry if this question might have already been asked.

[R] Plotting two overlapping curves

2009-07-30 Thread njhuang86
Hi. Sorry if this question might have already been asked... I'm trying to plot two curves on the same X-Y coordinate. The par(mfrow) command allows me to plot the two curves on the same window however on different coordinate systems. Is there a way to force the two curves into the same coordinate

Re: [R] Superscripts and rounding

2009-07-30 Thread ehux
I'd need access to the whole data file. I tried exporting some data from the website for it but it got too complex for me! (oh right you need the HYDAT package - sorry about that) =) However, it seems to me you have two chunks of data: you got it!!! stn[flow] - which has daily flow data in

Re: [R] PDF Compression

2009-07-30 Thread Stephen Tucker
There was a previous post about this also: http://tolstoy.newcastle.edu.au/R/e2/help/07/05/17475.html I was able to use bitmap(,type="pdfwrite") on Ubuntu Linux but had trouble getting it to work on Windows. For now, it's kind of kludgey but I have in my .Rprofle (or .Rprofile.site on Windows)

[R] (no subject)

2009-07-30 Thread Stein, Luba (AIM SE)
I try to load the package lattice by library(lattice). Although I have installed it through CRAN by internet as well as from a local directory using the zip-file, it can't be loaded into the editor. Can anyone give advice, please. I am using R 2.9.1 on Widows XP. Thanks a lot, Luba

Re: [R] R User Group listings

2009-07-30 Thread Armin Goralczyk
On Thu, Jul 30, 2009 at 2:33 PM, Prof. John C Nash wrote: > There are now several R geographic user groups, and a few have mailing lists > on the R mailing list system. Thanks to Martin M, there's also a pointer to > a page I'm maintaining to list/describe the groups. The page is at > > http://macn

[R] package lattice can't be loeaded

2009-07-30 Thread Stein, Luba (AIM SE)
I try to load the package lattice by library(lattice). Although I have installed it through CRAN by internet as well as from a local directory using the zip-file, it can't be loaded into the editor. Can anyone give advice, please. I am using R 2.9.1 on Widows XP. Thanks a lot, Luba

[R] dynamic network analysis

2009-07-30 Thread cir p
Dear group, I am browsing the web to find suitable software for dynamic network analysis. I came across the sna-package under R, but this seems to do static analysis only. Is this right? Or is there a separate package for dynamic network analysis? Thanks

Re: [R] PDF Compression

2009-07-30 Thread Frank E Harrell Jr
Eduardo Leoni wrote: PDF created by R is in vector format. If you really want smaller files you can try creating PNGs instead. With a high enough resolution (e.g. dpi=600) there won't be much difference in the printed version of your document. -eduardo Eduardo, It is not a good idea in gen

[R] R 2.9.1: Error building target 'front'

2009-07-30 Thread Loris Bennett
Hi, I am getting the following error # (R-2.9.1/src/library/methods): gmake front /bin/sh: 0403-057 Syntax error at line 1 : `;' is not expected. gmake: *** [front] Error 2 However, I am not sure what script sh is trying to execute at this point. I am building on AIX 5.3.

Re: [R] PDF Compression

2009-07-30 Thread Eduardo Leoni
PDF created by R is in vector format. If you really want smaller files you can try creating PNGs instead. With a high enough resolution (e.g. dpi=600) there won't be much difference in the printed version of your document. -eduardo On Thu, Jul 30, 2009 at 7:55 AM, Benno Pütz wrote: > Thanks for

  1   2   >