[R] Reading a large directory of compressed zips into a data frame

2016-07-09 Thread Giles Bischoff
way when I tried using the dir() function, I could do something like d1 <- read.csv(dir()[1:332]) to read all the data and then find the mean of say "columnA" in that data table by using something like mean(d1$columnA). Though, so far this has not worked. Any ideas? Sincerely, Giles

[R] Difficulty subsetting data frames using logical operators

2016-07-01 Thread Giles Bischoff
So, I uploaded a data set via my directory using the command data <- data.frame(read.csv("hw1_data.csv")) and then tried to subset that data using logical operators. Specifically, I was trying to make it so that I got all the rows in which the values for "Ozone" (a column in the data set) were grea

[R] Problem with download.file ?

2015-03-27 Thread Giles Crane
uot;,"-100.02632",..: 8799 8706 8811 8715 8470 8639 9019 8608 8531 9065 ... $ STFIPS : Factor w/ 51 levels "01","02","04",..: 22 22 22 22 22 22 22 22 22 22 ... $ CD : Factor w/ 55 levels "00","01","02",..:

[R] int vector

2013-09-11 Thread Giles Crane
its sheet. dotchart() displays a 1 above the labels on the plot. Converting the int column to numeric using as.numeric() cures the problems. However, the behavior of the int class seems inconsistent. R Version 3.01 (2013-05-16) Thank you for your consideration. Cordially, Giles -- Giles L Crane

[R] max_prepared_stmt_count exceeded using RODBC + 64-bit win7

2012-12-13 Thread Giles
it down but if anyone can offer a shortcut I'd be delighted. Thanks Giles Heywood [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www

[R] xts indexed with Date class

2012-11-30 Thread Giles
Hi I see a changed behaviour in xts indexed on class Date in the latest versions, versus 2. It seems to be related to changes to/from daylight savings time, happens those weekends. Is it not intended that class Date be used like this, or is this new behaviour incorrect? Giles Example: >

[R] rollmax.zoo : column names NULL

2012-05-14 Thread Giles
e? Thanks Giles R2.13.1 + zoo 1.7-4 on Windows 7 > a <- as.zoo(matrix(1:20,4,5,dimnames=list(LETTERS[1:4],letters[1:5]))) > rollapply(data=a,FUN=mean,width=3) a b c d e 2 2 6 10 14 18 3 3 7 11 15 19 > rollmax(x=a,k=3) a b c d e 2 3 7 11 15 19 3 4 8 12 16 20 > str(colnames(rol

Re: [R] rollapply.zoo() with na.rm=TRUE

2011-08-15 Thread Giles
I use the development version. Giles Heywood #example system.time(rollmax(x= zoo(1:1,1:1),k=20,align="right")) R version 2.13.1 (2011-07-08) Platform: i386-pc-mingw32/i386 (32-bit) __ R-help@r-project.org mailing list https://stat.ethz.c

[R] rollapply.zoo() with na.rm=TRUE

2011-08-12 Thread Giles
he documentation, is also different from before. This is not specific to mean(), similar behaviour is shown for e.g. sum(). Have I misunderstood the documentation? Is there a way to reproduce the old behaviour with na.rm=TRUE? Thanks. Giles Version 1 -- R version 2.12.0 (2010-10-15) Platf

[R] AOV() may misslabel random effects.

2011-03-14 Thread Giles Crane
Greetings, The aov() function may mislabel the random effects as in the example below: Has anybody else noticed this? Cordially, Giles Crane, MPH, ASA, NJPHA gilescr...@verizon.net > m2 Call: aov(formula = y ~ ap + pe + Error(ju), data = d) Grand Mean: 77.50667 Stratum 1: ju Te

[R] Behavior of assignment within system.time()

2011-03-12 Thread Giles Crane
umbers 1 to 1 However, grouping the statement with curly brackets also gives the correct system time. system.time( { x=1:1} ) # times the statement correctly Having fun with R, Giles Crane __ R-help@r-project.org mailing list https://stat.ethz.

[R] print() required sometimes in interactive use of console

2011-01-26 Thread Giles Crane
) #prints a permutation of 1 to 8 for(i in 1:5) #does not sample(1:8,8) Cordially, Giles Crane __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Loading .Rdata within an R function

2010-07-09 Thread Giles Crane
top level environment. However, I would like to load the data into the function environment, so that the data goes away when the function terminates. Cordially, Giles Crane -- View this message in context: http://r.789695.n4.nabble.com/Loading-Rdata-within-an-R-function-tp2282751p2283051.html Sen

[R] Loading .Rdata within an R function

2010-07-08 Thread Giles Crane
mydata.Rdata. } I wish to load mydata.Rdata only within the function f1. Perhaps I have misunderstood the capabilities of load(), or the environment concepts. Thank you for any help you may give. Cordially, Giles Crane -- View this message in context: http://r.789695.n4.nabble.com/Loading-Rdat

Re: [R] Adjusted means and generalized chain block designs

2010-06-24 Thread Giles Crane
llins and Karin Mille, an index of Generalized Block Designs, and GCB library in draft form, includingD-efficiency, at the NIST UseR 2010 Conference in July. These designs are interesting combinatorially, and quite applicable to physical measurements which are made with high precision. Best wishes,

[R] How to insert gridlines in lattice density plot

2010-04-22 Thread Giles
Thank you Burt Gunter and David Winsemius, I confirmed David's comment. One must use type=c("p","g") in order to get both the grid and points. So, to use densityplot well, we must be quite aware of the options for panel.xyplo

[R] How to insert gridlines in lattice density plot

2010-04-22 Thread Giles
2 2 2 2 2 2 2 2 2 ... library(lattice) densityplot(~fallrates, groups = prepost, kernal="triangular", lwd=2, plot.points = TRUE, ref = TRUE, auto.key = list(columns = 2), main="Estimated fall rate density, pre and post intevention") Thank yo

[R] Adjusted means and generalized chain block designs

2010-02-15 Thread Giles
78, 1.720, 1.658) Can anyone shed light on how to obtain in R the correct treatment means, adjusted for both row and column effects (blocks) in these designs? Cordially, Giles Crane gilescr...@verizon.net __ R-help@r-project.org mailing list https://sta

Re: [R] renaming objects

2008-03-04 Thread Giles . Crane
G1, file = "DIAG1.Rdata") I am now testing this approach. Cordially, Giles Giles Crane, M.Phil., MPH Research Scientist & Statistician Tel 609 292-8012, -5666 Fax 609 292-9288 [EMAIL PROTECTED] __ This does not really answer your question but the following lets yo

[R] renaming objects

2008-03-03 Thread Giles . Crane
f renaming variables (columns) in dataframes, but I have found no methods for renaming objects. The functionassign() does not do this. Thank you for any help you can give. Cordially Giles Crane, M.Phil., MPH Research Scientist & Statistician New Jersey Department of Health & Senior Serv

[R] How to form a simple R package

2008-02-05 Thread Giles . Crane
Is there a function to form in one step (configure files and install) a simple R package of consisting of one script file of R functions? For example in Windows: form.package(name="mypkg", rcodefile ="c:\misc\mypkg.r" ) Thank you for any comments. Giles Giles Crane, M