Re: [R] GIS in R

2022-09-01 Thread Thomas Adams
Hi Nick,

First off, I would suggest going to:

https://cran.r-project.org/web/views/Spatial.html

also have a close look at
https://journal.r-project.org/archive/2017/RJ-2017-067/RJ-2017-067.pdf

And you might also consider the use of GRASS GIS, which interfaces with R
pretty seamlessly: https://grasswiki.osgeo.org/wiki/R_statistics/rgrass7

Best,
Tom

On Thu, Sep 1, 2022 at 6:50 AM Nick Wray  wrote:

> I hope that this is an allowable question - for my hydrological research I
> need to create and manipulate maps (ideally in raster form), and get
> conversant with GIS.  I have for example downloaded QGIS but am finding the
> sites on it opaque, and more widely I am finding it hard to find useful
> sources of information on GIS processing in R.
>
> Does anyone know of any accessible sites or useful texts on GIS processing
> in R?
>
> Thanks Nick Wray
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] forecast accuracy

2021-02-05 Thread Thomas Adams
Look at the 'verification' contributed package

Tom

On Fri, Feb 5, 2021 at 12:36 PM Faheem Jan via R-help 
wrote:

> I am working in the functional time series, I obtain the one year ahead
> forecast in the functional format, Know i want to forecast accuracy for
> example mean absolute percentage error in R, please help how i do this in R
>
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] National Weather Service Data

2020-07-03 Thread Thomas Adams
Hi Philip!

I'm a little familiar with rNOMADS... I tried following the example for
'ArchiveGribGrab' using a more recent date

#An example for the Global Forecast System
#Get data for January 1 2014
#Temperature at 2 m above ground
#3 hour prediction
# using GRIB
abbrev <- "gfsanl"
model.date <- 20200601
model.run <- 00
preds <- 3

I got this result...
URL 'https://nomads.ncdc.noaa.gov/data/gfsanl/202006/20200601/': status was
'Couldn't resolve host name'

Even this part of the URL was not found: https://nomads.ncdc.noaa.gov -- so
there is documentation problems.

I did get the first example, using contour to work fine. You probably
should contact Daniel C. Bowman  directly with
issues, because the problems you are seeing may be resolvable only by him...

Best,
Tom

On Thu, Jul 2, 2020 at 6:06 PM Philip  wrote:

> Is anyone out there familiar with rNOMADS?  It is a package to get into
> National Weather Service forecasting data with R?
>
> I'm not sure the Weather Service software named wgrib2 loaded correctly
> because some of the stuff won't run and I can't make much sense out of some
> of the output.
>
> Thanks.
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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, reproducible code.
>


-- 
Thomas E Adams, III
1724 Sage Lane
Blacksburg, VA 24060
tea...@gmail.com (personal)
t...@terrapredictions.org (work)

1 (513) 739-9512 (cell)

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] CRAN Task View: Optimization and Mathematical Programming

2019-02-06 Thread Thomas Adams
Did you Google "R stat water resources optimization" or "r stats
optimization"?

It seems that applying some of the references below with R packages in the
optimization task view probably gets you where you want to go.

https://cran.r-project.org/web/packages/reservoir/reservoir.pdf
https://www.researchgate.net/publication/317213418_Modern_Optimization_Methods_in_Water_Resources_Planning_Engineering_and_Management
https://link.springer.com/article/10.1007/s10666-018-9628-0
https://math.nyu.edu/faculty/tabak/publications/WaterResources.pdf

https://www.google.com/url?sa=t=j==s=web=6=2ahUKEwjHwLz34KfgAhVvg-AKHVy_DRcQFjAFegQICRAC=https%3A%2F%2Fwww.jstatsoft.org%2Farticle%2Fview%2Fv060i01%2Fv60i01.pdf=AOvVaw31QSrEIhxLDZrbHyMVcAds

https://www.jstatsoft.org/article/view/v060i02

http://abouthydrology.blogspot.com/2012/08/r-resources-for-hydrologists.html

https://www.sciencedirect.com/science/article/pii/S0309170896000619
https://acwi.gov/monitoring/conference/2016/2_wednesday_may4/F4/NMC2016SessionF4RybergEtAl_secure.pdf
https://www.epa.gov/sites/production/files/2015-06/documents/twri4a3-new.pdf

Tom


On Wed, Feb 6, 2019 at 11:36 AM Rich Shepard 
wrote:

> The task view lists many R packages for optimization and I would appreciate
> suggestions from those familiar with the available tools for packages that
> might be suitable for water management.
>
> Limited water resources need to be apportioned among various competing
> users
> (e.g,, agriculture, fish and wildlife, Tribes, potable human water
> supplies). I'm looking for R packages that can be applied to this type of
> constrained optimization problem.
>
> Pointers to other resources also welcome.
>
> Thanks in advance,
>
> Rich
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


[R] Problem with my function using as.POSIXct

2018-03-28 Thread Thomas Adams
Hello all:

I wrote a function:

my.bastimeToSynoptic <- function(x) {
f<-unlist(strsplit(as.character(x), " "))
hr<-unlist(strsplit(f[2], ":"))
if(as.numeric(hr[1])<6) {
synoptic<-"00"
}
else {
synoptic<-as.integer(as.numeric(hr[1])/6)*6
}
tdate<-paste(c(f[1]," ",as.character(synoptic),":00:00"),collapse="")
d<-as.POSIXct(tdate, tz="EST")
return(d)
}

This works as expected:

> my.bastimeToSynoptic("2010-12-01 14:05:00")
[1] "2010-12-01 12:00:00 EST"

This does not:
> my.bastimeToSynoptic("2010-12-01 05:05:00")
[1] "2010-12-01 EST"

I expect to get:
"2010-12-01 00:00:00 EST"

I've tried explicitly forcing the format with d<-as.POSIXct(tdate,
tz="EST", format = "%Y-%m-%d %H:%M:%S") and I have checked online, finding
examples showing what I'm doing with as.POSIXct should work. I'm at an
impasse.

I'm running R version 3.4.0 (2017-04-21) on Ubuntu 16.04 LTS

Thank you,
Tom


--

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] Help needed with aggregate or other solution

2017-10-26 Thread Thomas Adams
5:10:00",
> "2012-02-15 14:46:00", "2012-02-16 14:42:00", "2012-02-17 14:14:00",
> "2012-02-18 15:27:00", "2012-02-19 13:13:00", "2012-02-20 13:56:00",
> "2012-02-21 14:39:00", "2012-02-22 15:33:00", "2012-02-23 15:14:00",
> "2012-02-24 15:14:00", "2012-02-25 14:25:00", "2012-02-26 14:08:00",
> "2012-02-27 14:55:00", "2012-02-28 14:40:00", "2012-02-29 14:45:00",
> "2012-03-01 15:18:00", "2012-03-02 15:18:00", "2012-03-03 15:43:00",
> "2012-03-04 15:16:00", "2012-03-05 15:17:00", "2012-03-06 15:03:00",
> "2012-03-07 14:44:00", "2012-03-08 14:53:00", "2012-03-09 15:10:00",
> "2012-03-10 14:43:00", "2012-03-11 13:37:00", "2012-03-12 14:58:00",
> "2012-03-13 14:36:00", "2012-03-14 13:49:00", "2012-03-15 14:32:00",
> "2012-03-16 15:01:00", "2012-03-17 13:55:00", "2012-03-18 13:44:00",
> "2012-03-19 13:55:00", "2012-03-20 13:53:00", "2012-03-21 14:07:00",
> "2012-03-22 14:03:00", "2012-03-23 14:30:00", "2012-03-24 14:47:00",
> "2012-03-25 14:32:00", "2012-03-26 14:41:00", "2012-03-27 13:51:00",
> "2012-03-28 13:32:00", "2012-03-29 13:59:00", "2012-03-30 14:15:00",
> "2012-03-31 14:12:00", "2012-04-01 14:30:00", "2012-04-02 13:43:00",
> "2012-04-03 13:54:00", "2012-04-04 13:45:00", "2012-04-05 13:46:00",
> "2012-04-06 13:41:00", "2012-04-07 13:13:00", "2012-04-08 12:59:00",
> "2012-04-09 13:53:00", "2012-04-10 14:15:00", "2012-04-11 14:26:00",
> "2012-04-12 14:05:00", "2012-04-13 13:37:00", "2012-04-14 13:52:00",
> "2012-04-15 15:00:00", "2012-04-16 14:42:00", "2012-04-17 14:21:00",
> "2012-04-18 14:40:00", "2012-04-19 14:35:00", "2012-04-20 15:14:00",
> "2012-04-21 14:46:00", "2012-04-22 14:44:00", "2012-04-23 14:33:00",
> "2012-04-24 14:41:00", "2012-04-25 14:13:00", "2012-04-26 14:19:00",
> "2012-04-27 14:35:00", "2012-04-28 13:48:00", "2012-04-29 14:12:00",
> "2012-04-30 13:53:00", "2012-05-02 14:41:00", "2012-05-03 15:01:00",
> "2012-05-04 15:21:00", "2012-05-05 14:57:00", "2012-05-06 14:09:00",
> "2012-05-07 14:30:00", "2012-05-08 14:05:00", "2012-05-08 21:21:00",
> "2012-05-09 15:02:00", "2012-05-10 14:27:00", "2012-05-11 14:47:00",
> "2012-05-12 13:24:00", "2012-05-13 14:40:00", "2012-05-13 19:24:00",
> "2012-05-14 14:33:00", "2012-05-15 14:39:00", "2012-05-16 14:07:00",
> "2012-05-17 13:42:00", "2012-05-18 14:30:00", "2012-05-19 13:59:00",
> "2012-05-20 14:14:00", "2012-05-21 14:15:00", "2012-05-22 14:18:00",
> "2012-05-23 14:14:00", "2012-05-24 13:52:00"), class = "factor"),
> fcst = c(38.7, 38.9, 39.2, 39.8, 40.5, 41.5, 42.5, 43.1,
> 43.9, 44.5, 44.8, 45, 45, 45.1, 45.4, 45.8, 46.4, 47, 47.5,
> 47.9, 39.2, 40, 41.8, 42.2, 42.8, 44.4, 45.7, 46.2, 46.2,
> 46.2, 46.5, 47, 47.5, 47.9, 48.4, 49, 49.5, 49.9, 50.2, 50.4,
> 41.3, 42.5, 42.8, 42.8, 42.8, 42.9, 43, 43.3, 43.5, 43.8),
> usgs = c(38.5, 38.6, 38.6, 38.6, 39.1, 39.8, 41.2, 42.9,
> 43.4, 43.6, 43.4, 43.1, 43, 43.1, 43.5, 43.8, 44.1, 44.2,
> 44.4, 44.5, 39.1, 39.8, 41.2, 42.9, 43.4, 43.6, 43.4, 43.1,
> 43, 43.1, 43.5, 43.8, 44.1, 44.2, 44.4, 44.5, 44.5, 44.5,
> 44.6, 44.2, 41.2, 42.9, 43.4, 43.6, 43.4, 43.1, 43, 43.1,
> 43.5, 43.8)), .Names = c("date", "basistime", "fcst", "usgs"
> ), row.names = c(NA, 50L), class = "data.frame")
>
> Sys.setenv( "Etc/GMT+8" ) # or whatever is appropriate
> #> Error in Sys.setenv("Etc/GMT+8"): all arguments must be named
>
> dta2 <- dta
> # bad idea to work with dates as factors
> dta2$date <- as.POSIXct( as.character( dta2$date ) )
> dta2$basistime <- as.POSIXct( as.character( dta2$basistime ) )
>
> # base R solution
>
> dates <- unique( dta2$date )
> dta2list <- split( dta2, dta2$date )
> grplist <- lapply( dta2list
>  , function( DF ) {
>  DF[ which.max( DF$fcst

[R] Help needed with aggregate or other solution

2017-10-25 Thread Thomas Adams
Hello all!

I've been struggling with is for many hours today; I'm close to getting
what I want, but not close enough...

I have a dataframe consisting of two date-time columns followed by two
numeric columns. what I need is the max value (in the first numeric column)
based on the 2nd date-time column, which is essentially a factor. But, I
want the result to provide both date-time values corresponding to the max
value.

My data:

structure(list(date = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L,
8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L,
5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L,
19L, 20L, 21L, 22L, 23L, 24L, 7L, 8L, 9L, 10L, 11L, 12L, 13L,
14L, 15L, 16L), .Label = c("2012-01-25 18:00:00", "2012-01-26 00:00:00",
"2012-01-26 06:00:00", "2012-01-26 12:00:00", "2012-01-26 18:00:00",
"2012-01-27 00:00:00", "2012-01-27 06:00:00", "2012-01-27 12:00:00",
"2012-01-27 18:00:00", "2012-01-28 00:00:00", "2012-01-28 06:00:00",
"2012-01-28 12:00:00", "2012-01-28 18:00:00", "2012-01-29 00:00:00",
"2012-01-29 06:00:00", "2012-01-29 12:00:00", "2012-01-29 18:00:00",
"2012-01-30 00:00:00", "2012-01-30 06:00:00", "2012-01-30 12:00:00",
"2012-01-30 18:00:00", "2012-01-31 00:00:00", "2012-01-31 06:00:00",
"2012-01-31 12:00:00", "2012-01-31 13:00:00", "2012-01-31 18:00:00",
"2012-02-01 00:00:00", "2012-02-01 06:00:00", "2012-02-01 12:00:00",
"2012-02-01 18:00:00", "2012-02-02 00:00:00", "2012-02-02 06:00:00",
"2012-02-02 12:00:00", "2012-02-02 18:00:00", "2012-02-03 00:00:00",
"2012-02-03 06:00:00", "2012-02-03 12:00:00", "2012-02-03 18:00:00",
"2012-02-04 00:00:00", "2012-02-04 06:00:00", "2012-02-04 12:00:00",
"2012-02-04 18:00:00", "2012-02-05 00:00:00", "2012-02-05 06:00:00",
"2012-02-05 12:00:00", "2012-02-05 18:00:00", "2012-02-06 00:00:00",
"2012-02-06 06:00:00", "2012-02-06 12:00:00", "2012-02-06 18:00:00",
"2012-02-07 00:00:00", "2012-02-07 06:00:00", "2012-02-07 12:00:00",
"2012-02-07 18:00:00", "2012-02-08 00:00:00", "2012-02-08 06:00:00",
"2012-02-08 12:00:00", "2012-02-08 18:00:00", "2012-02-09 00:00:00",
"2012-02-09 06:00:00", "2012-02-09 12:00:00", "2012-02-09 18:00:00",
"2012-02-10 00:00:00", "2012-02-10 06:00:00", "2012-02-10 12:00:00",
"2012-02-10 18:00:00", "2012-02-11 00:00:00", "2012-02-11 06:00:00",
"2012-02-11 12:00:00", "2012-02-11 18:00:00", "2012-02-12 00:00:00",
"2012-02-12 06:00:00", "2012-02-12 12:00:00", "2012-02-12 18:00:00",
"2012-02-13 00:00:00", "2012-02-13 06:00:00", "2012-02-13 12:00:00",
"2012-02-13 18:00:00", "2012-02-14 00:00:00", "2012-02-14 06:00:00",
"2012-02-14 12:00:00", "2012-02-14 18:00:00", "2012-02-15 00:00:00",
"2012-02-15 06:00:00", "2012-02-15 12:00:00", "2012-02-15 18:00:00",
"2012-02-16 00:00:00", "2012-02-16 06:00:00", "2012-02-16 12:00:00",
"2012-02-16 18:00:00", "2012-02-17 00:00:00", "2012-02-17 06:00:00",
"2012-02-17 12:00:00", "2012-02-17 18:00:00", "2012-02-18 00:00:00",
"2012-02-18 06:00:00", "2012-02-18 12:00:00", "2012-02-18 18:00:00",
"2012-02-19 00:00:00", "2012-02-19 06:00:00", "2012-02-19 12:00:00",
"2012-02-19 18:00:00", "2012-02-20 00:00:00", "2012-02-20 06:00:00",
"2012-02-20 12:00:00", "2012-02-20 18:00:00", "2012-02-21 00:00:00",
"2012-02-21 06:00:00", "2012-02-21 12:00:00", "2012-02-21 18:00:00",
"2012-02-22 00:00:00", "2012-02-22 06:00:00", "2012-02-22 12:00:00",
"2012-02-22 18:00:00", "2012-02-23 00:00:00", "2012-02-23 06:00:00",
"2012-02-23 12:00:00", "2012-02-23 18:00:00", "2012-02-24 00:00:00",
"2012-02-24 06:00:00", "2012-02-24 12:00:00", "2012-02-24 18:00:00",
"2012-02-25 00:00:00", "2012-02-25 06:00:00", "2012-02-25 12:00:00",
"2012-02-25 18:00:00", "2012-02-26 00:00:00", "2012-02-26 06:00:00",
"2012-02-26 12:00:00", "2012-02-26 18:00:00", "2012-02-27 00:00:00",
"2012-02-27 06:00:00", "2012-02-27 12:00:00", "2012-02-27 18:00:00",
"2012-02-28 00:00:00", "2012-02-28 06:00:00", "2012-02-28 12:00:00",
"2012-02-28 18:00:00", "2012-02-29 00:00:00", "2012-02-29 06:00:00",
"2012-02-29 12:00:00", "2012-02-29 18:00:00", "2012-03-01 00:00:00",
"2012-03-01 06:00:00", "2012-03-01 12:00:00", "2012-03-01 18:00:00",
"2012-03-02 00:00:00", "2012-03-02 06:00:00", "2012-03-02 12:00:00",
"2012-03-02 18:00:00", "2012-03-03 00:00:00", "2012-03-03 06:00:00",
"2012-03-03 12:00:00", "2012-03-03 18:00:00", "2012-03-04 00:00:00",
"2012-03-04 06:00:00", "2012-03-04 12:00:00", "2012-03-04 18:00:00",
"2012-03-05 00:00:00", "2012-03-05 06:00:00", "2012-03-05 12:00:00",
"2012-03-05 18:00:00", "2012-03-06 00:00:00", "2012-03-06 06:00:00",
"2012-03-06 12:00:00", "2012-03-06 18:00:00", "2012-03-07 00:00:00",
"2012-03-07 06:00:00", "2012-03-07 12:00:00", "2012-03-07 18:00:00",
"2012-03-08 00:00:00", "2012-03-08 06:00:00", "2012-03-08 12:00:00",
"2012-03-08 18:00:00", "2012-03-09 00:00:00", "2012-03-09 06:00:00",
"2012-03-09 12:00:00", "2012-03-09 18:00:00", "2012-03-10 00:00:00",
"2012-03-10 06:00:00", "2012-03-10 12:00:00", "2012-03-10 18:00:00",
"2012-03-11 00:00:00", "2012-03-11 06:00:00", "2012-03-11 12:00:00",
"2012-03-11 18:00:00", 

Re: [R] about installing smwrGraphs package

2017-07-23 Thread Thomas Adams
Lily,

This:
https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html
will probably be useful to you.

Best,
Tom

On Sun, Jul 23, 2017 at 12:31 PM, Uwe Ligges <
lig...@statistik.tu-dortmund.de> wrote:

>
>
> On 23.07.2017 05:28, lily li wrote:
>
>> Hi R users,
>>
>> I'm trying to install the package, but got the error and don't know how to
>> fix it. Can anyone help me? Thanks very much.
>>
>> install.packages("smwrGraphs", repos=c("http://owi.usgs.gov/R",;
>>
>
> I guess "http://owi.usgs.gov/R; does not provide standard repositories
> for R?
>
> Best,
> Uwe Ligges
>
>
>
>
> http://cran.us.r-project.org;), dependencies = TRUE)
>>
>> Error in install.packages : Line starting ' ...' is malformed!
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posti
>> ng-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posti
> ng-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] Histogram plots in Lattice with spatialgrid dataframe data

2017-07-09 Thread Thomas Adams
Jeff,

Thank you! I know what I did was very inelegant and I understand about
providing a reproducible example; I just could not do it with my data -- I
guess I was too lazy to make up a toy one. I apologize about the email
formatting.

I would never have known to use 'stack', 'levels' 'gather' and 'mutate' --
still very much learning... so, I appreciate what you provided. Thank you
so much!

Tom


On Sun, Jul 9, 2017 at 10:16 PM, Jeff Newmiller <jdnew...@dcn.davis.ca.us>
wrote:

> Glad you found an answer, though it looks more self-educational than
> efficient (see suggestions below). In the future, follow the
> recommendations of the Posting Guide: use plain text, and provide a
> reproducible example. Some elaborations on what "reproducible" means are
> [1][2][3]. One issue here was that you did not include sample data to work
> with (I have assumed below that ann_bias has no other columns than the
> bias columns, which is not the usual case).
>
> There are a number of ways to achieve the reshaping of your ann_bias data
> frame that are less painful than your approach. For example, the base R
> "stack" function:
>
> bias2 <- stack( ann_bias )
> names( bias2 ) <- c( "bias", "year )
> levels( bias2$year ) <- sub( "bias", "", levels( bias2$year ) )
>
> Or... if you are willing to venture into the tidyverse...
>
> library(dplyr)
> library(tidyr)
> bias3  <- (   ann_bias
>  %>% gather( year, bias )
>  %>% mutate( year = factor( sub( "bias", "", year ) ) )
>  )
>
> [1] http://stackoverflow.com/questions/5963269/how-to-make-
> a-great-r-reproducible-example
>
> [2] http://adv-r.had.co.nz/Reproducibility.html
>
> [3] https://cran.r-project.org/web/packages/reprex/index.html
>
> --
> Sent from my phone. Please excuse my brevity.
>
> On July 9, 2017 12:32:32 PM PDT, Thomas Adams <tea...@gmail.com> wrote:
> >Hello all,
> >
> >After more digging I was able to find out how to do this. The answer
> >came
> >from an example here:
> >
> >https://stackoverflow.com/questions/3541713/how-to-plot-
> two-histograms-together-in-r
> >
> >
> >yr_1997<-data.frame(bias=ann_bias$bias1997)
> >yr_1998<-data.frame(bias=ann_bias$bias1998)
> >yr_1999<-data.frame(bias=ann_bias$bias1999)
> >yr_2000<-data.frame(bias=ann_bias$bias2000)
> >yr_2001<-data.frame(bias=ann_bias$bias2001)
> >yr_2002<-data.frame(bias=ann_bias$bias2002)
> >yr_2003<-data.frame(bias=ann_bias$bias2003)
> >yr_2004<-data.frame(bias=ann_bias$bias2004)
> >yr_2005<-data.frame(bias=ann_bias$bias2005)
> >yr_2006<-data.frame(bias=ann_bias$bias2006)
> >yr_2007<-data.frame(bias=ann_bias$bias2007)
> >yr_2008<-data.frame(bias=ann_bias$bias2008)
> >yr_2009<-data.frame(bias=ann_bias$bias2009)
> >yr_2010<-data.frame(bias=ann_bias$bias2010)
> >yr_2011<-data.frame(bias=ann_bias$bias2011)
> >yr_2012<-data.frame(bias=ann_bias$bias2012)
> >yr_2013<-data.frame(bias=ann_bias$bias2013)
> >yr_2014<-data.frame(bias=ann_bias$bias2014)
> >yr_2015<-data.frame(bias=ann_bias$bias2015)
> >yr_2016<-data.frame(bias=ann_bias$bias2016)
> >
> >
> >yr_1997$year<-'1997'
> >yr_1998$year<-'1998'
> >yr_1999$year<-'1999'
> >yr_2000$year<-'2000'
> >yr_2001$year<-'2001'
> >yr_2002$year<-'2002'
> >yr_2003$year<-'2003'
> >yr_2004$year<-'2004'
> >yr_2005$year<-'2005'
> >yr_2006$year<-'2006'
> >yr_2007$year<-'2007'
> >yr_2008$year<-'2008'
> >yr_2009$year<-'2009'
> >yr_2010$year<-'2010'
> >yr_2011$year<-'2011'
> >yr_2012$year<-'2012'
> >yr_2013$year<-'2013'
> >yr_2014$year<-'2014'
> >yr_2015$year<-'2015'
> >yr_2016$year<-'2016'
> >
> >
> >bias<-rbind(yr_1997,yr_1998,yr_1999,yr_2000,yr_2001,yr_
> 2002,yr_2003,yr_2004,yr_2005,yr_2006,yr_2007,yr_2008,yr_
> 2009,yr_2010,yr_2011,yr_2012,yr_2013,yr_2014,yr_2015,yr_2016)
> >histogram(~ bias | year, data=bias)
> >
> >Cheers!
> >Tom
> >
> >
> >On Sun, Jul 9, 2017 at 11:21 AM, Thomas Adams <tea...@gmail.com> wrote:
> >
> >> Hi all,
> >>
> >> I can not seem to get what I want using the Lattice package to
> >generate an
> >> array of histograms of
> >> spatialgrid dataframe data.
> >>
> >> I can use the sp package and spplot to generate an array of maps that
> >> display an array of spatialgrid dataframe data -- that's good. I
> >have:
> >>
>

Re: [R] Histogram plots in Lattice with spatialgrid dataframe data

2017-07-09 Thread Thomas Adams
Hello all,

After more digging I was able to find out how to do this. The answer came
from an example here:

https://stackoverflow.com/questions/3541713/how-to-plot-two-histograms-together-in-r


yr_1997<-data.frame(bias=ann_bias$bias1997)
yr_1998<-data.frame(bias=ann_bias$bias1998)
yr_1999<-data.frame(bias=ann_bias$bias1999)
yr_2000<-data.frame(bias=ann_bias$bias2000)
yr_2001<-data.frame(bias=ann_bias$bias2001)
yr_2002<-data.frame(bias=ann_bias$bias2002)
yr_2003<-data.frame(bias=ann_bias$bias2003)
yr_2004<-data.frame(bias=ann_bias$bias2004)
yr_2005<-data.frame(bias=ann_bias$bias2005)
yr_2006<-data.frame(bias=ann_bias$bias2006)
yr_2007<-data.frame(bias=ann_bias$bias2007)
yr_2008<-data.frame(bias=ann_bias$bias2008)
yr_2009<-data.frame(bias=ann_bias$bias2009)
yr_2010<-data.frame(bias=ann_bias$bias2010)
yr_2011<-data.frame(bias=ann_bias$bias2011)
yr_2012<-data.frame(bias=ann_bias$bias2012)
yr_2013<-data.frame(bias=ann_bias$bias2013)
yr_2014<-data.frame(bias=ann_bias$bias2014)
yr_2015<-data.frame(bias=ann_bias$bias2015)
yr_2016<-data.frame(bias=ann_bias$bias2016)


yr_1997$year<-'1997'
yr_1998$year<-'1998'
yr_1999$year<-'1999'
yr_2000$year<-'2000'
yr_2001$year<-'2001'
yr_2002$year<-'2002'
yr_2003$year<-'2003'
yr_2004$year<-'2004'
yr_2005$year<-'2005'
yr_2006$year<-'2006'
yr_2007$year<-'2007'
yr_2008$year<-'2008'
yr_2009$year<-'2009'
yr_2010$year<-'2010'
yr_2011$year<-'2011'
yr_2012$year<-'2012'
yr_2013$year<-'2013'
yr_2014$year<-'2014'
yr_2015$year<-'2015'
yr_2016$year<-'2016'


bias<-rbind(yr_1997,yr_1998,yr_1999,yr_2000,yr_2001,yr_2002,yr_2003,yr_2004,yr_2005,yr_2006,yr_2007,yr_2008,yr_2009,yr_2010,yr_2011,yr_2012,yr_2013,yr_2014,yr_2015,yr_2016)
histogram(~ bias | year, data=bias)

Cheers!
Tom


On Sun, Jul 9, 2017 at 11:21 AM, Thomas Adams <tea...@gmail.com> wrote:

> Hi all,
>
> I can not seem to get what I want using the Lattice package to generate an
> array of histograms of
> spatialgrid dataframe data.
>
> I can use the sp package and spplot to generate an array of maps that
> display an array of spatialgrid dataframe data -- that's good. I have:
>
> spplot(ann_bias,xlim=c(1423987.5,2614612.5),ylim=c(-
> 5862637.5,-4624387.5),at=brks,col.regions=colp(length(brks)-1),main="NOAA/NWS
> OHRFC Stage-3/MPE Precipitation Estimate Bias with respect to PRISM\n1997 -
> 2016")
>
> Which works... I can also do histogram(ann_bias$bias1997), which works
> too. I have also created a 'time-series' of boxplots successfully with
> these data as well...
>
> But if I try:
>
> year<-c('1997','1998','1999','2000','2001','2002','2003','
> 2004','2005','2006','2007','2008','2009','2010','2011','
> 2012','2013','2014','2015','2016')
> dat<-c(ann_bias$bias1997,ann_bias$bias1998,ann_bias$
> bias1999,ann_bias$bias2000,ann_bias$bias2001,ann_bias$
> bias2002,ann_bias$bias2003,ann_bias$bias2004,ann_bias$
> bias2005,ann_bias$bias2006,ann_bias$bias2007,ann_bias$
> bias2008,ann_bias$bias2009,ann_bias$bias2010,ann_bias$
> bias2011,ann_bias$bias2012,ann_bias$bias2013,ann_bias$
> bias2014,ann_bias$bias2015,ann_bias$bias2016)
>
> > data<-data.frame(year=c(year),bias=c(dat))
> > histogram(~ bias | year, data=data)
>
> I get a lattice plot of histograms, where the years vary, but all the
> histograms are identical, which I know they should not be. It seem that all
> the data from the combined spatialgrid dataframes are being used and
> repeated.
>
> Obviously, I'm not constructing the data correctly. Can someone tell me
> what I doing wrong. I've poured over this for a solid day, now...
>
> Regards,
> Tom
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


[R] Histogram plots in Lattice with spatialgrid dataframe data

2017-07-09 Thread Thomas Adams
Hi all,

I can not seem to get what I want using the Lattice package to generate an
array of histograms of
spatialgrid dataframe data.

I can use the sp package and spplot to generate an array of maps that
display an array of spatialgrid dataframe data -- that's good. I have:

spplot(ann_bias,xlim=c(1423987.5,2614612.5),ylim=c(-5862637.5,-4624387.5),at=brks,col.regions=colp(length(brks)-1),main="NOAA/NWS
OHRFC Stage-3/MPE Precipitation Estimate Bias with respect to PRISM\n1997 -
2016")

Which works... I can also do histogram(ann_bias$bias1997), which works too.
I have also created a 'time-series' of boxplots successfully with these
data as well...

But if I try:

year<-c('1997','1998','1999','2000','2001','2002','2003','2004','2005','2006','2007','2008','2009','2010','2011','2012','2013','2014','2015','2016')
dat<-c(ann_bias$bias1997,ann_bias$bias1998,ann_bias$bias1999,ann_bias$bias2000,ann_bias$bias2001,ann_bias$bias2002,ann_bias$bias2003,ann_bias$bias2004,ann_bias$bias2005,ann_bias$bias2006,ann_bias$bias2007,ann_bias$bias2008,ann_bias$bias2009,ann_bias$bias2010,ann_bias$bias2011,ann_bias$bias2012,ann_bias$bias2013,ann_bias$bias2014,ann_bias$bias2015,ann_bias$bias2016)

> data<-data.frame(year=c(year),bias=c(dat))
> histogram(~ bias | year, data=data)

I get a lattice plot of histograms, where the years vary, but all the
histograms are identical, which I know they should not be. It seem that all
the data from the combined spatialgrid dataframes are being used and
repeated.

Obviously, I'm not constructing the data correctly. Can someone tell me
what I doing wrong. I've poured over this for a solid day, now...

Regards,
Tom

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] Help with reshape/reshape2 needed

2017-07-05 Thread Thomas Adams
David,

That's just awesome! LOL -- no wonder I couldn't see how the reshape
functions could do this; you saved me MANY days!

Thank you so much!

Best,
Tom

On Wed, Jul 5, 2017 at 3:48 PM, David L Carlson <dcarl...@tamu.edu> wrote:

> This does not use reshape/reshape2, but it is pretty straightforward.
> Assuming X is your example data:
>
> > Y <- split(X[, 2], X[, 1])
> > vals <- sapply(Y, length)
> > pad <- max(vals) - vals
> > Y2 <- lapply(seq_along(Y), function(x) c(Y[[x]], rep(NA, pad[x])))
> > names(Y2) <- names(Y)
> > X2 <- do.call(cbind, Y2)
> > X2[, 1:6]
>   1957  1958  1959  1960   1961  1962
> [1,] 0.8625000 0.750 0.300 0.2875000 0.08256881 0.3267327
> [2,] 0.0733945 0.6435644 0.1287129 0.4903846 0.72115385NA
> [3,] 0.5096154NA 0.4519231NA NANA
>
> -
> David L Carlson
> Department of Anthropology
> Texas A University
> College Station, TX 77840-4352
>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Thomas
> Adams
> Sent: Wednesday, July 5, 2017 1:17 PM
> To: r-help@r-project.org
> Subject: [R] Help with reshape/reshape2 needed
>
> Hi all:
>
> I'm struggling with getting my data re-formatted using functions in
> reshape/reshape2 to get from:
>
> 1957 0.86250
> 1958 0.75000
> 1959 0.3
> 1960 0.28750
> 1963 0.67500
> 1964 0.93750
> 1965 0.02500
> 1966 0.38750
> 1969 0.08750
> 1970 0.27500
> 1973 0.5
> 1974 0.36250
> 1976 0.92500
> 1978 0.71250
> 1979 0.33750
> 1980 0.7
> 1981 0.42500
> 1982 0.21250
> 1983 0.31250
> 1986 0.23750
> 1958 0.643564356
> 1963 0.25000
> 1968 0.211538462
> 1976 0.317307692
> 1981 0.673076923
> 1985 0.730769231
> 1986 0.057692308
> 1957 0.073394495
> 1966 0.742574257
> 1961 0.082568807
> 1964 0.165137615
> 1965 0.137614679
> 1959 0.128712871
> 1968 0.587155963
> 1969 0.660550459
> 1970 0.477064220
> 1971 0.513761468
> 1973 0.449541284
> 1974 0.128440367
> 1968 0.415841584
> 1977 0.009174312
> 1979 0.339449541
> 1981 0.596330275
> 1982 0.348623853
> 1984 0.146788991
> 1986 0.651376147
> 1959 0.451923077
> 1965 0.75000
> 1962 0.326732673
> 1964 0.782178218
> 1970 0.336538462
> 1975 0.277227723
> 1978 0.712871287
> 1957 0.509615385
> 1960 0.490384615
> 1961 0.721153846
> 1966 0.298076923
> 1969 0.413461538
> 1971 0.5
> 1972 0.692307692
> 1974 0.653846154
> 1984 0.049504950
> 1978 0.442307692
> 1973 0.079207921
> 1983 0.355769231
> 1984 0.038461538
> 1979 0.237623762
> 1982 0.564356436
>
> to:
>
> 1957  1958   1959 1960 ...
> 1985   1986
> 0.509615385  0.75000  0.451923077  0.28750 ...
> 0.651376147
> 0.509615385
>
> and so on. It's likely the column lengths will be different, so I'm
> guessing padding with NAs will be needed. I have on the order of 1335 rows
> with years spanning 1957 to 2016.
>
> Thank you...
> Tom
>
> --
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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, reproducible code.
>



-- 
Thomas E Adams, III
1724 Sage Lane
Blacksburg, VA 24060
tea...@gmail.com (personal)
t...@terrapredictions.org (work)

1 (513) 739-9512 (cell)

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


[R] Help with reshape/reshape2 needed

2017-07-05 Thread Thomas Adams
Hi all:

I'm struggling with getting my data re-formatted using functions in
reshape/reshape2 to get from:

1957 0.86250
1958 0.75000
1959 0.3
1960 0.28750
1963 0.67500
1964 0.93750
1965 0.02500
1966 0.38750
1969 0.08750
1970 0.27500
1973 0.5
1974 0.36250
1976 0.92500
1978 0.71250
1979 0.33750
1980 0.7
1981 0.42500
1982 0.21250
1983 0.31250
1986 0.23750
1958 0.643564356
1963 0.25000
1968 0.211538462
1976 0.317307692
1981 0.673076923
1985 0.730769231
1986 0.057692308
1957 0.073394495
1966 0.742574257
1961 0.082568807
1964 0.165137615
1965 0.137614679
1959 0.128712871
1968 0.587155963
1969 0.660550459
1970 0.477064220
1971 0.513761468
1973 0.449541284
1974 0.128440367
1968 0.415841584
1977 0.009174312
1979 0.339449541
1981 0.596330275
1982 0.348623853
1984 0.146788991
1986 0.651376147
1959 0.451923077
1965 0.75000
1962 0.326732673
1964 0.782178218
1970 0.336538462
1975 0.277227723
1978 0.712871287
1957 0.509615385
1960 0.490384615
1961 0.721153846
1966 0.298076923
1969 0.413461538
1971 0.5
1972 0.692307692
1974 0.653846154
1984 0.049504950
1978 0.442307692
1973 0.079207921
1983 0.355769231
1984 0.038461538
1979 0.237623762
1982 0.564356436

to:

1957  1958   1959 1960 ...
1985   1986
0.509615385  0.75000  0.451923077  0.28750 ...
0.651376147
0.509615385

and so on. It's likely the column lengths will be different, so I'm
guessing padding with NAs will be needed. I have on the order of 1335 rows
with years spanning 1957 to 2016.

Thank you...
Tom

--

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] can we visualize water flows with 3d in R?

2016-10-13 Thread Thomas Adams
Duncan,

Oh, to be sure, with a fair amount of work, you're probably correct that
one could mash up something. Here are some examples:

http://www.illinoisfloods.org/documents/2013_IAFSM_Conference/Conference_Presentations/5C-1_HEC-GeoRAS_Part1.pdf
<--- lots of graphics

http://rivergis.com/

also...
http://www2.egr.uh.edu/~aleon3/courses/Transient_flows/Tutorials/Geo_RAS/georastutorial.pdf
-- pages 35->
https://www.crwr.utexas.edu/reports/pdf/1999/rpt99-1.pdf -- pages 70->
(figures 4-17, 4-18), p. 147

Best,
Tom

On Thu, Oct 13, 2016 at 9:20 AM, Duncan Murdoch <murdoch.dun...@gmail.com>
wrote:

> On 13/10/2016 8:35 AM, Thomas Adams wrote:
>
>> All,
>>
>> Very respectfully, there are no R packages that can do what Marna desires.
>>
>
> I would guess that's not literally true, in that there are several
> graphics packages that are very flexible.   You could well be right that
> there are none that are designed specifically for this purpose, so she's
> probably going to have to do some work to get what she wants.
>
> His/Her data, undoubtably, comes from a 1-D hydraulic model simulation --
>> where output is generated at channel cross-sections -- representing the
>> sloping water surface elevation of the centerline of flow in a stream or
>> river. With mapping software for such problems, the assumption is made that
>> the water surface intersects the topography (within or beyond the stream
>> channel) perpendicular to the direction of flow. Hydrodynamically, this is
>> generally not correct, but it's a reasonable approximation. To do this,
>> typically, the topography -- in the from of a raster digital elevation
>> model (DEM) -- is converted to a triangular irregular network (TIN) to
>> facilitate the creation of a smoother line of intersection between the
>> water surface and topography. Because, the water surface slopes in a
>> downstream direction, contour lines are crossed. Hydraulic modeling
>> software usually is accompanied by this mapping capability, such as with
>> HEC-RAS with RAS-Mapper, developed by the US Army Corps of Engineers, or
>> with HEC-GeoRAS, which requires ESRI ARC GIS; but, there is also a QGIS
>> plugin module that can do this, I believe. These software packages do
>> facilitate representing the flow in 3D.
>>
>
> Do you know any sample figures online that would show the type of graph
> that is usually used here?
>
> Duncan Murdoch
>
>>
>> Tom
>>
>>
>> On Wed, Oct 12, 2016 at 6:12 PM, David Winsemius <dwinsem...@comcast.net
>> <mailto:dwinsem...@comcast.net>> wrote:
>>
>>
>> > On Oct 12, 2016, at 4:28 AM, Duncan Murdoch
>> <murdoch.dun...@gmail.com <mailto:murdoch.dun...@gmail.com>> wrote:
>> >
>> > On 12/10/2016 4:49 AM, Marna Wagley wrote:
>> >> Hi R Users,
>> >> Is it possible to visualize river flow in 3D (latitude,
>> longitude with
>> >> respect to depth)?
>> >> The example of my data looks like. Any suggestions?
>> >>
>> >>> dat1
>> >>long lat depth flow
>> >> 1 1015.9 857  1.00 1.50
>> >> 2 1015.9 857  1.25 1.23
>> >> 3 1015.9 857  0.50 2.00
>> >> 4 1015.9 858  0.10 1.95
>> >> 5 1015.9 858  0.20 1.50
>> >> 6 1025.0 858  0.30 1.20
>> >> 7 1025.0 858  0.40 0.50
>> >> 8 1025.0 858  0.35 0.70
>> >> 9 1025.0 858  0.24 1.20
>> >>
>> >> Thanks for your help.
>> >
>> > It may be, but it's hard to give a nice looking graphic of that
>> small dataset.  You could try the rgl package and use plot3d to
>> show spheres with radius depending on the flow rate, for example
>> >
>> > plot3d(cbind(long, lat, depth), type="s", col="blue", radius=flow/5)
>>
>> A complementary option is to install the plot3D package which I
>> see also has a plot3Drgl "co-package". The advantage to this
>> option is the association with beautiful modeling packages that
>> Karline Soetaert, Peter M. J. Herman, and Thomas Petzoldt have
>> been offering to ecologists for the last decade. (Packages:
>> deSolve, marelac, seacarb, AquaEnv) A lot of her work has been on
>> flows within systems.
>>
>> I usually think of "flows" in rivers as being vector fields in an
>> incompressible fluid (water) with 6 components per point, but you
>> can also think of them as being scalar state variables. So I

Re: [R] can we visualize water flows with 3d in R?

2016-10-13 Thread Thomas Adams
All,

Very respectfully, there are no R packages that can do what Marna desires.
His/Her data, undoubtably, comes from a 1-D hydraulic model simulation --
where output is generated at channel cross-sections -- representing the
sloping water surface elevation of the centerline of flow in a stream or
river. With mapping software for such problems, the assumption is made that
the water surface intersects the topography (within or beyond the stream
channel) perpendicular to the direction of flow. Hydrodynamically, this is
generally not correct, but it's a reasonable approximation. To do this,
typically, the topography -- in the from of a raster digital elevation
model (DEM) -- is converted to a triangular irregular network (TIN) to
facilitate the creation of a smoother line of intersection between the
water surface and topography. Because, the water surface slopes in a
downstream direction, contour lines are crossed. Hydraulic modeling
software usually is accompanied by this mapping capability, such as with
HEC-RAS with RAS-Mapper, developed by the US Army Corps of Engineers, or
with HEC-GeoRAS, which requires ESRI ARC GIS; but, there is also a QGIS
plugin module that can do this, I believe. These software packages do
facilitate representing the flow in 3D.

Tom


On Wed, Oct 12, 2016 at 6:12 PM, David Winsemius 
wrote:

>
> > On Oct 12, 2016, at 4:28 AM, Duncan Murdoch 
> wrote:
> >
> > On 12/10/2016 4:49 AM, Marna Wagley wrote:
> >> Hi R Users,
> >> Is it possible to visualize river flow in  3D (latitude, longitude with
> >> respect to depth)?
> >> The example of my data looks like. Any suggestions?
> >>
> >>> dat1
> >>long lat depth flow
> >> 1 1015.9 857  1.00 1.50
> >> 2 1015.9 857  1.25 1.23
> >> 3 1015.9 857  0.50 2.00
> >> 4 1015.9 858  0.10 1.95
> >> 5 1015.9 858  0.20 1.50
> >> 6 1025.0 858  0.30 1.20
> >> 7 1025.0 858  0.40 0.50
> >> 8 1025.0 858  0.35 0.70
> >> 9 1025.0 858  0.24 1.20
> >>
> >> Thanks for your help.
> >
> > It may be, but it's hard to give a nice looking graphic of that small
> dataset.  You could try the rgl package and use plot3d to show spheres with
> radius depending on the flow rate, for example
> >
> > plot3d(cbind(long, lat, depth), type="s", col="blue", radius=flow/5)
>
> A complementary option is to install the plot3D package which I see also
> has a plot3Drgl "co-package". The advantage to this option is the
> association with beautiful modeling packages that Karline Soetaert, Peter
> M. J. Herman, and Thomas Petzoldt have been offering to ecologists for the
> last decade. (Packages: deSolve, marelac, seacarb, AquaEnv) A lot of her
> work has been on flows within systems.
>
> I usually think of "flows" in rivers as being vector fields in an
> incompressible fluid (water) with 6 components per point, but you can also
> think of them as being scalar state variables. So I suppose you could be
> modeling something other than mass flows.  (See Package::ReacTran for the R
> portal to that mathematical world.)
>
> Best;
> David Winsemius
>
>
> >
> > Duncan Murdoch
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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, reproducible code.
>
> David Winsemius
> Alameda, CA, USA
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] Struggling trying to plot points on boxplot

2016-06-02 Thread Thomas Adams
Bill,

Thank you!! With some tweaking, this approach was exactly what I needed.
Previously, I had been using bxp and had my code for it, but my data was
structured completely differently from what I have now. I figured something
like groupedX <- with(d, split(x, group)) existed, but how to find it??
This was the key for me and it's so powerful!

Thanks to all for the suggestions!

Tom

On Thu, Jun 2, 2016 at 10:52 AM, William Dunlap <wdun...@tibco.com> wrote:

> Does using zz<-bxp(boxplot(data,plot=FALSE)) do what you want?  E.g.,
>
> d <- transform(data.frame(t=1:15), x = sin(t)+log2(t), group =
> paste("Group", t%/%4))
> groupedX <- with(d, split(x, group))
> zz <- bxp(boxplot(groupedX, plot=FALSE)) # bxp returns the x positions of
> the boxes
> points(col="blue", pch=15, zz, vapply(splitX, FUN=mean, FUN.VALUE=0))
>
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Thu, Jun 2, 2016 at 8:36 AM, Thomas Adams <tea...@gmail.com> wrote:
>
>> Hello all:
>>
>> I've been beating my head on this for over a day and I have done a lot of
>> Google'ing with no luck.
>>
>> I have generated a 'time-series' of boxplots (227), covering more than a
>> 30-day period at 6-hour intervals, which summarize an ensemble forecast.
>> What I want to do is over-plot the observed values over a portion of the
>> forecast period to serve as a basis of comparison; so, there would be a
>> boxplot and a single point value plotted at each 6-hour interval.
>>
>> The boxplots are generated:
>>
>> zz<-boxplot(ens$value ~ ens$valid_time,xlab="Date/Time
>> (UTC)",ylab="Flow(cfs)",boxfill="cyan")
>>
>> which works fine, but the observed points will not display using:
>>
>> points(zz, obs$value,lty=3,lwd=1,col="red",pch=19)
>>
>> I've tried many variations of the latter, where either nothing happens and
>> no error is returned or I have also gotten that x and y have different
>> lengths. I suspect I am using the wrong 'x' type. I have observation
>> values
>> beginning with the first in the series of boxplots, which then end, with
>> the most recent ensemble forecast. So, I always expect the number of
>> observed values to be less than the number of boxplots. I have done this
>> previously, years ago, but can not find my notes and can not reconstruct
>> what I did.
>>
>> Help is appreciated.
>>
>> Regards,
>> Tom
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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, reproducible code.
>>
>
>


-- 
Thomas E Adams, III
2330 Jack Warner PKWY, #334
Tuscaloosa, AL 35401

1 (513) 739-9512 (cell)

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


[R] Struggling trying to plot points on boxplot

2016-06-02 Thread Thomas Adams
Hello all:

I've been beating my head on this for over a day and I have done a lot of
Google'ing with no luck.

I have generated a 'time-series' of boxplots (227), covering more than a
30-day period at 6-hour intervals, which summarize an ensemble forecast.
What I want to do is over-plot the observed values over a portion of the
forecast period to serve as a basis of comparison; so, there would be a
boxplot and a single point value plotted at each 6-hour interval.

The boxplots are generated:

zz<-boxplot(ens$value ~ ens$valid_time,xlab="Date/Time
(UTC)",ylab="Flow(cfs)",boxfill="cyan")

which works fine, but the observed points will not display using:

points(zz, obs$value,lty=3,lwd=1,col="red",pch=19)

I've tried many variations of the latter, where either nothing happens and
no error is returned or I have also gotten that x and y have different
lengths. I suspect I am using the wrong 'x' type. I have observation values
beginning with the first in the series of boxplots, which then end, with
the most recent ensemble forecast. So, I always expect the number of
observed values to be less than the number of boxplots. I have done this
previously, years ago, but can not find my notes and can not reconstruct
what I did.

Help is appreciated.

Regards,
Tom

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] Help needed to format data for boxplot time-series

2016-06-01 Thread Thomas Adams
Petr and David,

Thank you so much! Both approaches do precisely what I need. I knew there
had to be a very simple way to do this, but I am still very much a novice
and struggle with data management at times. Also, thank you for the
suggestion to use dput(yourdata) or dput(yourdata[1:20,]) -- I knew such a
thing existed and search for it, but just could not recall the 'dput'
command name.

Regards,
Tom

On Wed, Jun 1, 2016 at 7:23 AM, PIKAL Petr <petr.pi...@precheza.cz> wrote:

> Hi
>
> It is preferable to use output of
>
> dput(yourdata) or dput(yourdata[1:20,])
>
> so that we can use your data.
>
> From your description maybe
>
> boxplot(split(yourdata$value, yourdata$valid_time))
>
> can give you what you want.
>
> Regards
> Petr
>
> > -Original Message-
> > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Thomas
> > Adams
> > Sent: Wednesday, June 1, 2016 2:07 PM
> > To: r-help@r-project.org
> > Subject: [R] Help needed to format data for boxplot time-series
> >
> > All:
> >
> > I have used R in combination with GRASS GIS spatial data (using spgrass)
> > many times in the past to generate a 'time series' of boxplots, to show
> > variations over time. But I have a new problem, not involving spatial
> data, but
> > rather, true time-series data (snippet shown below). So, what I want to
> do is
> > to generate a 'time-series' of boxplots based on the column 'valid_time'
> for
> > the 'values' column data. What I can not figure out is how to either
> select or
> > format the data for the series of individual boxplots.
> > Somehow it seems I need to use reshape; do I group the data within a
> loop?
> > This does not seem efficient. The full set of data I have covers a 30
> day period
> > at 6-hourly time steps with 9320 rows
> >
> > Data
> >
> > lid|ens_num|basis_time|valid_time|value
> > MDBV1|ens01|2016-04-19 06:00:00|2016-04-21 00:00:00|1431.4787995285
> > MDBV1|ens01|2016-04-20 18:00:00|2016-04-21 00:00:00|740.777643846512
> > MDBV1|ens02|2016-04-20 18:00:00|2016-04-21 00:00:00|740.78561401
> > MDBV1|ens03|2016-04-20 18:00:00|2016-04-21 00:00:00|740.777441774178
> > MDBV1|ens04|2016-04-20 18:00:00|2016-04-21 00:00:00|740.777441774178
> > MDBV1|ens01|2016-04-19 06:00:00|2016-04-21 06:00:00|1430.25545361671
> > MDBV1|ens01|2016-04-20 18:00:00|2016-04-21 06:00:00|673.404235368919
> > MDBV1|ens02|2016-04-20 18:00:00|2016-04-21 06:00:00|673.404370083809
> > MDBV1|ens03|2016-04-20 18:00:00|2016-04-21 06:00:00|673.404235368919
> > MDBV1|ens04|2016-04-20 18:00:00|2016-04-21 06:00:00|673.404235368919
> > MDBV1|ens01|2016-04-19 06:00:00|2016-04-21 12:00:00|1429.0170196373
> > MDBV1|ens01|2016-04-20 18:00:00|2016-04-21 12:00:00|602.801441559601
> > MDBV1|ens02|2016-04-20 18:00:00|2016-04-21 12:00:00|602.801239487267
> > MDBV1|ens03|2016-04-20 18:00:00|2016-04-21 12:00:00|602.801441559601
> > MDBV1|ens04|2016-04-20 18:00:00|2016-04-21 12:00:00|602.801441559601
> > MDBV1|ens01|2016-04-19 06:00:00|2016-04-21 18:00:00|1427.75029553108
> > MDBV1|ens01|2016-04-20 18:00:00|2016-04-21 18:00:00|532.976794630909
> > MDBV1|ens02|2016-04-20 18:00:00|2016-04-21 18:00:00|532.976727273464
> > MDBV1|ens03|2016-04-20 18:00:00|2016-04-21 18:00:00|532.97639048624
> > MDBV1|ens04|2016-04-20 18:00:00|2016-04-21 18:00:00|532.976895667076
> > MDBV1|ens01|2016-04-19 06:00:00|2016-04-22 00:00:00|1426.44531239624
> > MDBV1|ens01|2016-04-20 18:00:00|2016-04-22 00:00:00|467.520648461056
> > MDBV1|ens02|2016-04-20 18:00:00|2016-04-22 00:00:00|467.520513746166
> > MDBV1|ens03|2016-04-20 18:00:00|2016-04-22 00:00:00|467.520379031277
> > MDBV1|ens04|2016-04-20 18:00:00|2016-04-22 00:00:00|467.520783175945
> > MDBV1|ens01|2016-04-19 06:00:00|2016-04-22 06:00:00|1425.14127226563
> > MDBV1|ens01|2016-04-20 18:00:00|2016-04-22 06:00:00|408.103669752502
> > MDBV1|ens02|2016-04-20 18:00:00|2016-04-22 06:00:00|408.105117937565
> > MDBV1|ens03|2016-04-20 18:00:00|2016-04-22 06:00:00|408.102255246162
> > MDBV1|ens04|2016-04-20 18:00:00|2016-04-22 06:00:00|408.193086760426
> > MDBV1|ens01|2016-04-19 06:00:00|2016-04-22 12:00:00|1423.73767783165
> > MDBV1|ens01|2016-04-20 18:00:00|2016-04-22 12:00:00|356.017269114971
> > MDBV1|ens02|2016-04-20 18:00:00|2016-04-22 12:00:00|356.245105671883
> > MDBV1|ens03|2016-04-20 18:00:00|2016-04-22 12:00:00|355.568634854126
> > MDBV1|ens04|2016-04-20 18:00:00|2016-04-22 12:00:00|357.646308916569
> > MDBV1|ens01|2016-04-19 06:00:00|2016-04-22 18:00:00|1422.30188653908
> > MDBV1|ens01|2016-04-20 18:00:00|2016-04-22 18:00:00|310.664962696362
> > MDBV1|ens02|201

[R] Help needed to format data for boxplot time-series

2016-06-01 Thread Thomas Adams
All:

I have used R in combination with GRASS GIS spatial data (using spgrass)
many times in the past to generate a 'time series' of boxplots, to show
variations over time. But I have a new problem, not involving spatial data,
but rather, true time-series data (snippet shown below). So, what I want to
do is to generate a 'time-series' of boxplots based on the column
'valid_time' for the 'values' column data. What I can not figure out is how
to either select or format the data for the series of individual boxplots.
Somehow it seems I need to use reshape; do I group the data within a loop?
This does not seem efficient. The full set of data I have covers a 30 day
period at 6-hourly time steps with 9320 rows

Data

lid|ens_num|basis_time|valid_time|value
MDBV1|ens01|2016-04-19 06:00:00|2016-04-21 00:00:00|1431.4787995285
MDBV1|ens01|2016-04-20 18:00:00|2016-04-21 00:00:00|740.777643846512
MDBV1|ens02|2016-04-20 18:00:00|2016-04-21 00:00:00|740.78561401
MDBV1|ens03|2016-04-20 18:00:00|2016-04-21 00:00:00|740.777441774178
MDBV1|ens04|2016-04-20 18:00:00|2016-04-21 00:00:00|740.777441774178
MDBV1|ens01|2016-04-19 06:00:00|2016-04-21 06:00:00|1430.25545361671
MDBV1|ens01|2016-04-20 18:00:00|2016-04-21 06:00:00|673.404235368919
MDBV1|ens02|2016-04-20 18:00:00|2016-04-21 06:00:00|673.404370083809
MDBV1|ens03|2016-04-20 18:00:00|2016-04-21 06:00:00|673.404235368919
MDBV1|ens04|2016-04-20 18:00:00|2016-04-21 06:00:00|673.404235368919
MDBV1|ens01|2016-04-19 06:00:00|2016-04-21 12:00:00|1429.0170196373
MDBV1|ens01|2016-04-20 18:00:00|2016-04-21 12:00:00|602.801441559601
MDBV1|ens02|2016-04-20 18:00:00|2016-04-21 12:00:00|602.801239487267
MDBV1|ens03|2016-04-20 18:00:00|2016-04-21 12:00:00|602.801441559601
MDBV1|ens04|2016-04-20 18:00:00|2016-04-21 12:00:00|602.801441559601
MDBV1|ens01|2016-04-19 06:00:00|2016-04-21 18:00:00|1427.75029553108
MDBV1|ens01|2016-04-20 18:00:00|2016-04-21 18:00:00|532.976794630909
MDBV1|ens02|2016-04-20 18:00:00|2016-04-21 18:00:00|532.976727273464
MDBV1|ens03|2016-04-20 18:00:00|2016-04-21 18:00:00|532.97639048624
MDBV1|ens04|2016-04-20 18:00:00|2016-04-21 18:00:00|532.976895667076
MDBV1|ens01|2016-04-19 06:00:00|2016-04-22 00:00:00|1426.44531239624
MDBV1|ens01|2016-04-20 18:00:00|2016-04-22 00:00:00|467.520648461056
MDBV1|ens02|2016-04-20 18:00:00|2016-04-22 00:00:00|467.520513746166
MDBV1|ens03|2016-04-20 18:00:00|2016-04-22 00:00:00|467.520379031277
MDBV1|ens04|2016-04-20 18:00:00|2016-04-22 00:00:00|467.520783175945
MDBV1|ens01|2016-04-19 06:00:00|2016-04-22 06:00:00|1425.14127226563
MDBV1|ens01|2016-04-20 18:00:00|2016-04-22 06:00:00|408.103669752502
MDBV1|ens02|2016-04-20 18:00:00|2016-04-22 06:00:00|408.105117937565
MDBV1|ens03|2016-04-20 18:00:00|2016-04-22 06:00:00|408.102255246162
MDBV1|ens04|2016-04-20 18:00:00|2016-04-22 06:00:00|408.193086760426
MDBV1|ens01|2016-04-19 06:00:00|2016-04-22 12:00:00|1423.73767783165
MDBV1|ens01|2016-04-20 18:00:00|2016-04-22 12:00:00|356.017269114971
MDBV1|ens02|2016-04-20 18:00:00|2016-04-22 12:00:00|356.245105671883
MDBV1|ens03|2016-04-20 18:00:00|2016-04-22 12:00:00|355.568634854126
MDBV1|ens04|2016-04-20 18:00:00|2016-04-22 12:00:00|357.646308916569
MDBV1|ens01|2016-04-19 06:00:00|2016-04-22 18:00:00|1422.30188653908
MDBV1|ens01|2016-04-20 18:00:00|2016-04-22 18:00:00|310.664962696362
MDBV1|ens02|2016-04-20 18:00:00|2016-04-22 18:00:00|310.956081572628
MDBV1|ens03|2016-04-20 18:00:00|2016-04-22 18:00:00|310.891788891602
MDBV1|ens04|2016-04-20 18:00:00|2016-04-22 18:00:00|311.764674018288
MDBV1|ens01|2016-04-19 06:00:00|2016-04-23 00:00:00|1420.79065490837
MDBV1|ens01|2016-04-20 18:00:00|2016-04-23 00:00:00|271.319441647482
MDBV1|ens02|2016-04-20 18:00:00|2016-04-23 00:00:00|271.90585556159
MDBV1|ens03|2016-04-20 18:00:00|2016-04-23 00:00:00|272.571818617964
MDBV1|ens04|2016-04-20 18:00:00|2016-04-23 00:00:00|272.197900602722
MDBV1|ens01|2016-04-19 06:00:00|2016-04-23 06:00:00|1419.24197253838
MDBV1|ens01|2016-04-20 18:00:00|2016-04-23 06:00:00|238.587209240341
MDBV1|ens02|2016-04-20 18:00:00|2016-04-23 06:00:00|238.386618769836
MDBV1|ens03|2016-04-20 18:00:00|2016-04-23 06:00:00|246.312821885538
MDBV1|ens04|2016-04-20 18:00:00|2016-04-23 06:00:00|237.956154179716
MDBV1|ens01|2016-04-19 06:00:00|2016-04-23 12:00:00|1417.63953892746
MDBV1|ens01|2016-04-20 18:00:00|2016-04-23 12:00:00|209.872343232489
MDBV1|ens02|2016-04-20 18:00:00|2016-04-23 12:00:00|209.899606158257
MDBV1|ens03|2016-04-20 18:00:00|2016-04-23 12:00:00|215.785316521025
MDBV1|ens04|2016-04-20 18:00:00|2016-04-23 12:00:00|208.711723941135
MDBV1|ens01|2016-04-19 06:00:00|2016-04-23 18:00:00|1415.99035924988
MDBV1|ens01|2016-04-20 18:00:00|2016-04-23 18:00:00|184.638914114666
MDBV1|ens02|2016-04-20 18:00:00|2016-04-23 18:00:00|184.57322371
MDBV1|ens03|2016-04-20 18:00:00|2016-04-23 18:00:00|189.508672138071
MDBV1|ens04|2016-04-20 18:00:00|2016-04-23 18:00:00|183.818062614059
MDBV1|ens01|2016-04-19 06:00:00|2016-04-24 00:00:00|1414.29375993118
MDBV1|ens01|2016-04-20 

Re: [R] question about probplot in e1071 package

2016-04-04 Thread Thomas Adams
Luisfo,

Thank you so much! That does what I need.

Best regards,
Tom

On Mon, Apr 4, 2016 at 10:51 AM, Luisfo Chiroque <luisf...@yahoo.es> wrote:

> Dear Thomas,
>
> Reading the probplot’s help page, it looks like it is using qqplot
> underneath.
> Thus, I think this is what you need.
> probplot(x, line=FALSE)
> #probplot(y, line=FALSE)
> qq.y <- qqnorm(y, plot=F)
> points(qq.y$y, qq.y$x)
>
> I hope this is useful for you.
>
> Best Regards,
>
> Luisfo Chiroque
>
> PhD Student
> IMDEA Networks Institute
>
> http://fourier.networks.imdea.org/people/~luis_nunez/
>
>
> El 4 abr 2016, a las 18:19, Thomas Adams <tea...@gmail.com> escribió:
>
> Hello!
>
> I am using probplot in the e1071 package and want to do something like the
> following, only with the the 2nd plot overlaying the first. I can't seem to
> make it work. Any suggestions?
>
> *library(e1071)
> **x <- rnorm(100, mean=5)*
>
> *y <- rnorm(100, mean=3)*
>
> *probplot(x, line=FALSE)
> *
>
> *probplot(y, line=FALSE)
> *
>
> *Regards,*
> *Tom*
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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, reproducible code.
>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.

[R] question about probplot in e1071 package

2016-04-04 Thread Thomas Adams
Hello!

I am using probplot in the e1071 package and want to do something like the
following, only with the the 2nd plot overlaying the first. I can't seem to
make it work. Any suggestions?

*library(e1071)
**x <- rnorm(100, mean=5)*

*y <- rnorm(100, mean=3)*

*probplot(x, line=FALSE)
*

*probplot(y, line=FALSE)
*

*Regards,*
*Tom*

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


[R] NULL dev.lis()

2015-11-08 Thread Thomas Adams
All,

I have previous built R from source many times, generally, without
problems. However on my new Ubuntu 15.04 Linux system with R 3.2.2 when I
run the command dev.list() I get:

> dev.list()
NULL

At the completion of running ./configure, I have

R is now configured for x86_64-pc-linux-gnu

  Source directory:  .
  Installation directory:/usr/local

  C compiler:gcc -std=gnu99  -g -O2
  Fortran 77 compiler:   gfortran  -g -O2

  C++ compiler:  g++  -g -O2
  C++ 11 compiler:   g++  -std=c++11 -g -O2
  Fortran 90/95 compiler:gfortran -g -O2
  Obj-C compiler:

  Interfaces supported:  X11
  External libraries:readline, zlib, lzma, PCRE, curl
  Additional capabilities:   PNG, JPEG, TIFF, NLS, cairo, ICU
  Options enabled:   shared BLAS, R profiling

  Capabilities skipped:
  Options not enabled:   memory profiling

  Recommended packages:  yes

This issue is causing me problems with spplot, which I have posted on
r-sig-geo. R and the display of all other graphics seems to be fine,
otherwise. My previous installations of R would yield:

> dev.list()
X11cairo
   2

And I had no problems with spplot. Any thoughts?

Regards,
Tom

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] 'strange' R graphics problem | Linux...

2015-10-14 Thread Thomas Adams
Evan,

I have Ubuntu 14.04 and 15.10 at home and have not had problems, but I
don't think I've been using R 3.2.2 — I'll try this evening.

Tom

On Wed, Oct 14, 2015 at 2:47 PM, Evan Cooch <evan.co...@gmail.com> wrote:

> Tom --
>
> On 10/14/2015 3:35 PM, Thomas Adams wrote:
>
> Evan,
>
> Not that this helps you, but I am using a very similar platform and I am
> having the identical problem. My test simply comes from the first
> help(plot) example. I tried doing some things to 'correct' the problem and
> ended up mucking-up my Gnome environment. In the process, I was able to get
> the example to display correctly, but as I said, I now have an unusable
> system. I'm not sure this is an R specific problem, but some
> incompatibility with the Centos Gnome environment.
>
>
> Thanks very much. I have a couple of Linux Mint 17.x systems as well --
> I'll see if they throw the same problem at me/us.
>
> Tom
>
> On Wed, Oct 14, 2015 at 8:36 AM, Evan Cooch <evan.co...@gmail.com> wrote:
>
>> So, am running 3.2.2 on a Centos 6.xx box. Code executes fine, but I'm
>> having a heck of a time with graphics. I don't think this is related to R
>> in the broad sense, but how it is interacting with graphics on the system.
>> here is a description of the problem.
>>
>> 1\ something simple:  test <- rnorm(100)
>>
>> 2\ try to generate a simple histogram  using hist(test)
>>
>> 3\ what happens is that a terminal window pops up (as I would expect for
>> the graphic), but rather than showing the histogram, its essentially a
>> screen-capture of the original terminal window in which I ran the script.
>> Said second terminal window is not responsive, at all -- can't even close
>> it short of opening another shell, and killing the process from the CLI.
>>
>> 4\ I get the exact same problem even if I try  a simple plot.new() --
>> generate a new terminal window, but with the same problem 'attributes' as
>> described above.
>>
>> For what it works, when I fire up gnuplot, terminal type set to X11 --
>> and basic gnuplot graphics (e.g., plot sin(x)) work perfectly. Other
>> graphics seem to work fine too. Just nothing I try to plot using R.
>>
>> Anyone have any ideas as to what to look for/try? Here is the output of
>> sessionInfo() -- nothing obvious that I can see.
>>
>> R version 3.2.2 (2015-08-14)
>> Platform: x86_64-redhat-linux-gnu (64-bit)
>> Running under: CentOS release 6.7 (Final)
>>
>> locale:
>>  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
>>  [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
>>  [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
>>  [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
>>  [9] LC_ADDRESS=C   LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats graphics  grDevices utils datasets  methods base
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> <http://www.R-project.org/posting-guide.html>
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
>
>
>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.

Re: [R] 'strange' R graphics problem | Linux...

2015-10-14 Thread Thomas Adams
Evan,

Not that this helps you, but I am using a very similar platform and I am
having the identical problem. My test simply comes from the first
help(plot) example. I tried doing some things to 'correct' the problem and
ended up mucking-up my Gnome environment. In the process, I was able to get
the example to display correctly, but as I said, I now have an unusable
system. I'm not sure this is an R specific problem, but some
incompatibility with the Centos Gnome environment.

Tom

On Wed, Oct 14, 2015 at 8:36 AM, Evan Cooch  wrote:

> So, am running 3.2.2 on a Centos 6.xx box. Code executes fine, but I'm
> having a heck of a time with graphics. I don't think this is related to R
> in the broad sense, but how it is interacting with graphics on the system.
> here is a description of the problem.
>
> 1\ something simple:  test <- rnorm(100)
>
> 2\ try to generate a simple histogram  using hist(test)
>
> 3\ what happens is that a terminal window pops up (as I would expect for
> the graphic), but rather than showing the histogram, its essentially a
> screen-capture of the original terminal window in which I ran the script.
> Said second terminal window is not responsive, at all -- can't even close
> it short of opening another shell, and killing the process from the CLI.
>
> 4\ I get the exact same problem even if I try  a simple plot.new() --
> generate a new terminal window, but with the same problem 'attributes' as
> described above.
>
> For what it works, when I fire up gnuplot, terminal type set to X11 -- and
> basic gnuplot graphics (e.g., plot sin(x)) work perfectly. Other graphics
> seem to work fine too. Just nothing I try to plot using R.
>
> Anyone have any ideas as to what to look for/try? Here is the output of
> sessionInfo() -- nothing obvious that I can see.
>
> R version 3.2.2 (2015-08-14)
> Platform: x86_64-redhat-linux-gnu (64-bit)
> Running under: CentOS release 6.7 (Final)
>
> locale:
>  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
>  [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
>  [9] LC_ADDRESS=C   LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods base
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] 'strange' R graphics problem | Linux...

2015-10-14 Thread Thomas Adams
Evan,

I have R 3.2.2 installed on my Ubuntu 15.04 machine -- no problems with the
graphics display. I have R 3.1.1 installed on my Ubuntu 14.04 machine,
that, as expected I have not had any problems with... I tried to install
3.2.2 and 3.2.1 from source and got a very strange compile error, which I
need to sort out -- recompiling 3.1.1 failed as well...

Best,
Tom

On Wed, Oct 14, 2015 at 6:35 PM, Evan Cooch <evan.co...@cornell.edu> wrote:

> A clue --
>
> Working from home, I created an ssh tunnel into my CentOS box, and brought
> up the desktop remotely using VNC. Fire up R in a terminal, and *voila*,
> graphics work fine.
>
> So, if I'm sitting at the CentOS machine, R graphics choke and die. If I
> use a remote desktop approach, graphics fine.
>
> Very strange...
>
> Forgot to add before, here are the 'capabilities' from my R install -- X11
> and cairo both 'there', so not sure what the problem is.
>
>jpeg pngtiff   tcltk X11aqua
>TRUETRUETRUETRUETRUE   FALSE
>http/ftp sockets  libxmlfifo  cledit   iconv
>TRUETRUETRUETRUETRUETRUE
> NLS profmem   cairo ICU long.double libcurl
>TRUE   FALSETRUETRUETRUE   FALSE
>
> On 10/14/2015 4:00 PM, Evan Cooch wrote:
>
>
>
> On 10/14/2015 3:51 PM, Thomas Adams wrote:
>
> Evan,
>
> I have Ubuntu 14.04 and 15.10 at home and have not had problems, but I
> don't think I've been using R 3.2.2 — I'll try this evening.
>
>
> Indeed - it could be an R-version issue, and not so much the distro. I
> might, for chuckles, roll back to 3.2.1, and see what happens.
>
>
> Tom
>
> On Wed, Oct 14, 2015 at 2:47 PM, Evan Cooch <evan.co...@gmail.com> wrote:
>
>> Tom --
>>
>> On 10/14/2015 3:35 PM, Thomas Adams wrote:
>>
>> Evan,
>>
>> Not that this helps you, but I am using a very similar platform and I am
>> having the identical problem. My test simply comes from the first
>> help(plot) example. I tried doing some things to 'correct' the problem and
>> ended up mucking-up my Gnome environment. In the process, I was able to get
>> the example to display correctly, but as I said, I now have an unusable
>> system. I'm not sure this is an R specific problem, but some
>> incompatibility with the Centos Gnome environment.
>>
>>
>> Thanks very much. I have a couple of Linux Mint 17.x systems as well --
>> I'll see if they throw the same problem at me/us.
>>
>> Tom
>>
>> On Wed, Oct 14, 2015 at 8:36 AM, Evan Cooch <evan.co...@gmail.com> wrote:
>>
>>> So, am running 3.2.2 on a Centos 6.xx box. Code executes fine, but I'm
>>> having a heck of a time with graphics. I don't think this is related to R
>>> in the broad sense, but how it is interacting with graphics on the system.
>>> here is a description of the problem.
>>>
>>> 1\ something simple:  test <- rnorm(100)
>>>
>>> 2\ try to generate a simple histogram  using hist(test)
>>>
>>> 3\ what happens is that a terminal window pops up (as I would expect for
>>> the graphic), but rather than showing the histogram, its essentially a
>>> screen-capture of the original terminal window in which I ran the script.
>>> Said second terminal window is not responsive, at all -- can't even close
>>> it short of opening another shell, and killing the process from the CLI.
>>>
>>> 4\ I get the exact same problem even if I try  a simple plot.new() --
>>> generate a new terminal window, but with the same problem 'attributes' as
>>> described above.
>>>
>>> For what it works, when I fire up gnuplot, terminal type set to X11 --
>>> and basic gnuplot graphics (e.g., plot sin(x)) work perfectly. Other
>>> graphics seem to work fine too. Just nothing I try to plot using R.
>>>
>>> Anyone have any ideas as to what to look for/try? Here is the output of
>>> sessionInfo() -- nothing obvious that I can see.
>>>
>>> R version 3.2.2 (2015-08-14)
>>> Platform: x86_64-redhat-linux-gnu (64-bit)
>>> Running under: CentOS release 6.7 (Final)
>>>
>>> locale:
>>>  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
>>>  [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
>>>  [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
>>>  [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
>>>  [9] LC_ADDRESS=C   LC_TELEPHONE=C
>>> [11] L

Re: [R] Best Mac for R

2015-02-26 Thread Thomas Adams
Dan,

FWIW, I have basically the system you describe, except a larger HD — I'm
quite happy, but I'm a biased Mac user, although I love my Ubuntu Linux
machine as well… One can bring any machine to its knees, so there is the
element of expectations. A MacBook Pro stacks up as well or better compared
to a similarly configured windows box. The thing is, IMO, there are at
least two very good virtual machines to run MS-Windows on if the need
arises (as well as Apple's 'Boot Camp') and, I believe, since the core Mac
OS is essentially UNIX/Linux you have all that capability natively as well.

Tom

On Thu, Feb 26, 2015 at 12:50 AM, Dan Murphy chiefmur...@gmail.com wrote:

 I am possibly in the market for a new laptop. Predominantly a Windows
 user, I owned a macbook pro 10 years ago and am considering going that
 route again. Does the standard advice still hold: Get the most
 powerful processor (i7), most ram (16GB), and largest internal storage
 (512GB), if affordable?
 thanks,
 dan

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.

Re: [R] plot circles where z values are circles radius

2015-01-23 Thread Thomas Adams
I think what you should look at are these web sites I found with a Google
search:

http://flowingdata.com/2010/11/23/how-to-make-bubble-charts/
http://www.r-bloggers.com/bubble-plots-ggplot2/
http://cran.r-project.org/web/packages/HSAUR/vignettes/Ch_logistic_regression_glm.pdf
http://cran.r-project.org/web/packages/mapplots/mapplots.pdf


Cheers!
Tom

On Fri, Jan 23, 2015 at 2:12 PM, Dr. Alireza Zolfaghari 
ali.zolfagh...@gmail.com wrote:

 Hi there,
 I am trying to plot z values using Circle symbol. Each x and y has a value
 which will be plotted using a circle where circle's radius is corrlated
 with the value of z.

 I wrote the code , but unable to change the size of circle no matter what I
 chose for Scale. Any help please?

 x=c(84390255386 ,84390255386, 78028317380 ,53594648044,422)
 y=c(949849442 ,941645043, 840135292, 74, 821632939)
 z=c(0.005641896, 0.005641896 ,0.005641896, 0.007978846,0.007978846)

 convertToRadius-function(x){return(sqrt(x/pi))}

 scale=0.3

 xlims =c(min(x),max(x))
 ylims =c(min(y),max(y))
 z=convertToRadius(z)*scale

 symbols(x,y, circles=z,  fg='red')

 thanks
 Alireza

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] how update to latest version of R on mac

2014-12-21 Thread Thomas Adams
Jane,

My sincere apologies; I don't know what I was seeing/thinking -- your
original post was correct. Namely, you should download and install:
http://ftp.sunet.se/pub/lang/CRAN/bin/macosx/R-3.1.2-snowleopard.pkg
(although, I am use to using the main mirror
http://cran.r-project.org/bin/macosx/R-3.1.2-snowleopard.pkg) -- but that
should not make a difference. The documentation does state...

*R 3.1.2* binary for Mac OS X 10.6 (Snow Leopard) *and higher*, signed
package. Contains R 3.1.2 framework, R.app GUI 1.65 in 64-bit for Intel
Macs. The above file is an Installer package which can be installed by
double-clicking. Depending on your browser, you may need to press the
control key and click on this link to download the file.

So, this should be the way to go. I'm glad you double checked!!

Tom

On Sun, Dec 21, 2014 at 2:21 AM, Jane Synnergren jane.synnerg...@his.se
wrote:

   Thanks Tom!
 One more quick question, regarding choosing mavericks.pkg or
 snowleopard.pkg.
 Will mavericks work for me though I have OS X Lion 10.7.5? I thought I had
 to choose snowleopard but are still an unexperienced mac user and have
 really no idea.

  Just want to dubble check before I run the installation.

  /Jane

 ---
 Jane Synnergren, PhD
 Systems Biology Research Center
 School of Bioscience
 University of Skövde
 Sweden

  Contact:
 email: jane.synnerg...@his.se
 mobile: +46 (0)708 806495
 webpage: his.se/synj

  Postal Address:  Visiting address:
  Box 408 Kanikegränd 3A
 541 28 Skövde Skövde

   From: Thomas Adams tea...@gmail.com
 Date: Sunday, December 21, 2014 2:06 AM
 To: Jane Synnergren jane.synnerg...@his.se
 Cc: R-help r-help@r-project.org
 Subject: Re: [R] how update to latest version of R on mac

Jane,

  It's possible, since you are using Mac OS X Lion (10.7.5), you need the R
 version for that, which can be found here:
 http://cran.r-project.org/bin/macosx/old/R-3.1.1-mavericks.pkg

  Cheers!
  Tom

 On Fri, Dec 19, 2014 at 2:56 PM, Jane Synnergren jane.synnerg...@his.se
 wrote:

 Hi,
 I get following error when trying to update the affy package to latest
 version.

 Error: cannot remove prior installation of package Œaffy¹

 I think it is because affy requires R 3.1.1 and I have 3.0.2

 I try to find a guide how I do to upgrade from 3.0.2 to latest version on
 mac, but cannot find any good description. Can anyone guide me?

 Do I just download R for mac (R-3.1.2-snowleopard.pkg) from
 http://ftp.sunet.se/pub/lang/CRAN/bin/macosx/R-3.1.2-snowleopard.pkg
 and
 dubbelclick?

 What will happen with all installed packages?
 I have OS X Lion 10.7.5
 Which version number is stable and reliable?

 I also need a guide of how to update to latest version of  bioconductor on
 mac.

 Descriptions for windows is available everywhere.

 /Jane



 ---
 
 Jane Synnergren, PhD
 Systems Biology Research Center
 School of Bioscience
 University of Skövde
 Sweden

 Contact:
 email: jane.synnerg...@his.se
 mobile: +46 (0)708 806495
 webpage: his.se/synj

 Postal Address: Visiting address:

 Box 408 Kanikegränd 3A
 541 28 Skövde   Skövde

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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, reproducible code.





[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] how update to latest version of R on mac

2014-12-20 Thread Thomas Adams
Jane,

It's possible, since you are using Mac OS X Lion (10.7.5), you need the R
version for that, which can be found here:
http://cran.r-project.org/bin/macosx/old/R-3.1.1-mavericks.pkg

Cheers!
Tom

On Fri, Dec 19, 2014 at 2:56 PM, Jane Synnergren jane.synnerg...@his.se
wrote:

 Hi,
 I get following error when trying to update the affy package to latest
 version.

 Error: cannot remove prior installation of package Œaffy¹

 I think it is because affy requires R 3.1.1 and I have 3.0.2

 I try to find a guide how I do to upgrade from 3.0.2 to latest version on
 mac, but cannot find any good description. Can anyone guide me?

 Do I just download R for mac (R-3.1.2-snowleopard.pkg) from
 http://ftp.sunet.se/pub/lang/CRAN/bin/macosx/R-3.1.2-snowleopard.pkg and
 dubbelclick?

 What will happen with all installed packages?
 I have OS X Lion 10.7.5
 Which version number is stable and reliable?

 I also need a guide of how to update to latest version of  bioconductor on
 mac.

 Descriptions for windows is available everywhere.

 /Jane


 ---
 
 Jane Synnergren, PhD
 Systems Biology Research Center
 School of Bioscience
 University of Skövde
 Sweden

 Contact:
 email: jane.synnerg...@his.se
 mobile: +46 (0)708 806495
 webpage: his.se/synj

 Postal Address: Visiting address:

 Box 408 Kanikegränd 3A
 541 28 Skövde   Skövde

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] We won an award, and didn't even notice...

2014-12-19 Thread Thomas Adams
Duncan,

Congratulations to you and all the founders and contributors — very much
deserved; thank you!!

Tom

On Fri, Dec 19, 2014 at 9:24 AM, Duncan Murdoch murdoch.dun...@gmail.com
wrote:

 This morning I was reading Jeff Leek's list of awesome things other people
 did in 2014 at http://simplystatistics.org/?p=3696 (thanks to the
 Revolution Analytics blog for the pointer).  One of the items in his list
 had a link to a list of awards for open source software in 2014:

 http://www.infoworld.com/article/2688074/big-data/big-
 data-164727-bossie-awards-2014-the-best-open-source-big-data-tools.html


 Turns out R won an award (on September 29!), and we didn't even notice.
 The RCloud project also won one.

 Duncan Murdoch

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


Re: [R] speed issue in simulating a stochastic process

2014-11-06 Thread Thomas Adams
Matteo,

I tried your example code using R 3.1.1 on an iMac (24-inch, Early 2009), 3.06
GHz Intel Core 2 Duo, 8 GB 1333 MHz DDR3, NVIDIA GeForce GT 130 512 MB
running Mac OS X 10.10 (Yosemite).

After entering your code, the elapsed time from the time I hit return to
when the graphics appeared was about 2 seconds — is this about what you are
seeing?

Regards,
Tom



On Thu, Nov 6, 2014 at 7:47 AM, Matteo Richiardi matteo.richia...@gmail.com
 wrote:

 I wish to simulate the following stochastic process, for i = 1...N
 individuals and t=1...T periods:

 y_{i,t} = y_0 + lambda Ey_{t-1} + epsilon_{i,t}

 where Ey_{t-1} is the average of y over the N individuals computed at time
 t-1.

 My solution (below) works but is incredibly slow. Is there a faster but
 still clear and readable alternative?

 Thanks a lot. Matteo

 rm(list=ls())
 library(plyr)
 y0 = 0
 lambda = 0.1
 N = 20
 T = 100
 m_e = 0
 sd_e = 1

 # construct the data frame and initialize y
 D = data.frame(
   id = rep(1:N,T),
   t = rep(1:T, each = N),
   y = rep(y0,N*T)
 )

 # update y
 for(t in 2:T){
   ybar.L1 = mean(D[D$t==t-1,y])
   for(i in 1:N){
 epsilon = rnorm(1,mean=m_e,sd=sd_e)
 D[D$id==i  D$t==t,]$y = lambda*y0+(1-lambda)*ybar.L1+epsilon
   }
 }

 ybar - ddply(D,~t,summarise,mean=mean(y))

 plot(ybar, col = blue, type = l)

 [[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-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] speed issue in simulating a stochastic process

2014-11-06 Thread Thomas Adams
Matteo,

Ah — OK, N=20, I did not catch that. You have nested for loops, which R is
known to be exceedingly slow at handling — if you can reorganize the code
to eliminate the loops, your performance will increase significantly.

Tom

On Thu, Nov 6, 2014 at 7:47 AM, Matteo Richiardi matteo.richia...@gmail.com
 wrote:

 I wish to simulate the following stochastic process, for i = 1...N
 individuals and t=1...T periods:

 y_{i,t} = y_0 + lambda Ey_{t-1} + epsilon_{i,t}

 where Ey_{t-1} is the average of y over the N individuals computed at time
 t-1.

 My solution (below) works but is incredibly slow. Is there a faster but
 still clear and readable alternative?

 Thanks a lot. Matteo

 rm(list=ls())
 library(plyr)
 y0 = 0
 lambda = 0.1
 N = 20
 T = 100
 m_e = 0
 sd_e = 1

 # construct the data frame and initialize y
 D = data.frame(
   id = rep(1:N,T),
   t = rep(1:T, each = N),
   y = rep(y0,N*T)
 )

 # update y
 for(t in 2:T){
   ybar.L1 = mean(D[D$t==t-1,y])
   for(i in 1:N){
 epsilon = rnorm(1,mean=m_e,sd=sd_e)
 D[D$id==i  D$t==t,]$y = lambda*y0+(1-lambda)*ybar.L1+epsilon
   }
 }

 ybar - ddply(D,~t,summarise,mean=mean(y))

 plot(ybar, col = blue, type = l)

 [[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-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] ubuntu 14.04

2014-09-24 Thread Thomas Adams
As do I...



On Wednesday, September 24, 2014, Jeff Newmiller jdnew...@dcn.davis.ca.us
wrote:

 Any incompatibility is a high standard, but I run it just fine on that
 platform.
 ---
 Jeff NewmillerThe .   .  Go Live...
 DCN:jdnew...@dcn.davis.ca.us javascript:;Basics: ##.#.
  ##.#.  Live Go...
   Live:   OO#.. Dead: OO#..  Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
 ---
 Sent from my phone. Please excuse my brevity.

 On September 24, 2014 11:58:04 AM PDT, carol white wht_...@yahoo.com
 javascript:; wrote:
 Hi,
 Can R be run on ubuntu 14.04 LTS without problem or is there any
 incompatibility?
 
 Thanks
 
 Carol
 
[[alternative HTML version deleted]]
 
 __
 R-help@r-project.org javascript:; 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, reproducible code.

 __
 R-help@r-project.org javascript:; 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, reproducible code.



-- 
Thomas E Adams, III
718 McBurney Drive
Lebanon, OH 45036

1 (513) 739-9512 (cell)

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Best way to merge 300+ .5MB dataframes?

2014-08-11 Thread Thomas Adams
Grant,

Assuming all your filenames are something like file1.txt,
file2.txt,file3.txt... And using the Mac OSX terminal app (after you cd to
the directory where your files are located...

This will strip off the 1st lines, that is, your header lines:

for file in *.txt;do
sed -i '1d'${file};
done

Then, do this:

cat *.txt  newfilename.txt

Doing both should only take a few seconds, depending on your file sizes.

Cheers!
Tom



On Mon, Aug 11, 2014 at 12:01 PM, Grant Rettke g...@wisdomandwonder.com
wrote:

 On Sun, Aug 10, 2014 at 6:50 PM, John McKown
 john.archie.mck...@gmail.com wrote:

  OK, I assume this results in a vector of file names in a variable,
  like you'd get from list.files();

 Yes.

  Why? Do you need them in separate data frames?

 I do not.

  The meat of the question. If you don't need the files in separate data
  frames, and the files do _NOT_ have headers, then I would just load
  them all into a single frame. I used Linux and so my solution may not
  work on Windows. Something like:

 Excellent point. All of the files do have the same header. I'm on OSX
 so there must be a nice
 one liner to concatenate all of the individual files, dropping the
 first line for all but the first.  Danke!

 __
 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, reproducible code.


[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] installing package gstat

2013-10-10 Thread Thomas Adams
Simona,

You need to install the dependencies:

install.packages(gstat,dependencies=T)

Tom


On Thu, Oct 10, 2013 at 11:58 AM, Simona Augyte simona.aug...@uconn.eduwrote:

 Hello,
 # I am able to
 install.packages(gstat)
 #but when I try to upload I get an error message
 library(gstat)
 #Error in loadNamespace(j - i[[1L]], c(lib.loc, .libPaths()), versionCheck
 = vI[[j]]) :
 #  there is no package called ‘intervals’
 #In addition: Warning message:
 #package ‘gstat’ was built under R version 3.0.2
 #Error: package or namespace load failed for ‘gstat’


 what do you recommend?

 --

 Simona Augyte, MS
 PhD student
 Ecology and Evolutionary Biology
 University of Connecticut
 cell 707-832-7007

 [[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-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] reshape2 issue continued

2013-06-05 Thread Thomas Adams
Bruce,

I'm not sure what's going on since I tried this on my Linux system running
R 3.0.0 and just did:

library(reshape2)
help(cast)

and the help for 'cast' came up. There was no indication to me that
'reshape' was needed and I can not see a dependency in CRAN for 'reshape'.
But I built R from source when installing R 3.0.0 and all the packages I
use had to be reinstalled...

Great research, BTW!

Tom


On Wed, Jun 5, 2013 at 11:42 AM, Neotropical bat risk assessments 
neotropical.b...@gmail.com wrote:

 Hi again all,
 Several replied ASAP that I also needed reshape loaded and not just
 reshape2.
 Hmmm tried that and I had some output but not the correct format.

 What I need is to run simulations of time overlap between species as per
 the simulation program data input constraints:

 The basis for the simulations is a species by _time-use matrix in which
 species are arranged in rows, and time intervals are arranged
 chronologically in columns.___ TimeOverlap only uses text tab-delimited
 files with no headings for columns or rows.Empirical data must be
 specified in proportional abundances (0 to 100) and totals for each
 species should be the same (100%).

 With the existing code the result was rows were correct for species but
 dates were used for columns rather than the times.

 The input file read has long format 4 columns - species; location; date;
 time.

 It dawns on me I may need to have a sub sample of the main data set by
 Location ID first then have the code run but for time values and not dates.

 I need to tweak this a bit more to see if I can figure that out as well.

 I will have many repetitions of this dat reformatting so it is important
 I get the code correct one time so I can run this on the gazillion or so
 data sets accumulated.

 Rather than use reshape can I use _recast_ in place of cast and stick
 with reshape2?

 Bruce

 [[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-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] the joy of spreadsheets (off-topic)

2013-04-27 Thread Thomas Adams
Pretty scary...


On Sat, Apr 27, 2013 at 12:28 PM, Albyn Jones jo...@reed.edu wrote:

 I once had a discussion with an economist who told me
 in almost these exact words:

 I don't care what the data say, the theory is so clear.

 albyn


 On 2013-04-26 9:30, William Dunlap wrote:

 The prior for the incompetence/malice question is usually best set pretty
 heavily in
 favour of incompetence ...


 The following comment on economic research is from a 2010 article in
 the Atlantic
 reviewing John Ioannidis' work.

 http://www.theatlantic.com/**magazine/print/2010/11/lies-**
 damned-lies-and-medical-**science/308269/http://www.theatlantic.com/magazine/print/2010/11/lies-damned-lies-and-medical-science/308269/

   Medical research is not especially plagued with wrongness.
Other meta-research experts have confirmed that similar issues
distort research in all fields of science, from physics to economics
(where the highly regarded economists J. Bradford DeLong and
Kevin Lang once showed how a remarkably consistent paucity of
strong evidence in published economics studies made it unlikely
that any of them were right).

 Bill Dunlap
 Spotfire, TIBCO Software
 wdunlap tibco.com


  -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-**
 project.org r-help-boun...@r-project.org] On Behalf
 Of S Ellison
 Sent: Friday, April 26, 2013 9:08 AM
 To: Thomas Adams; peter dalgaard
 Cc: r-help
 Subject: Re: [R] the joy of spreadsheets (off-topic)



  One might wonder if the Excel error was indeed THAT or
  perhaps a way to get the desired results, give the other
  issues in their analysis?

 The prior for the incompetence/malice question is usually best set
 pretty heavily in
 favour of incompetence ...

 S


 ***
 This email and any attachments are confidential. Any use...{{dropped:8}}

 __**
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/**
 posting-guide.html http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


 __**
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/**
 posting-guide.html http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


 __**
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/**
 posting-guide.html http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Thomas E Adams, III
718 McBurney Drive
Lebanon, OH 45036

1 (513) 739-9512 (cell)

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to export graph value in R

2013-04-26 Thread Thomas Adams
Anup,

You should have provided some additional information, such as that the
function 'hypsometric' is found in the hydroTSM contributed package.
Nevertheless, here's what I did (maybe not elegant, but it works) :

(1) at the R command prompt simply type hypsometric -- the source code for
the function 'hypsometric' will be written out
(2) copy this source code into a text file and save it as hypsometric2.R
(3) edit it as this or just copy this:

hypsometric2 - function (x, band = 1, main = Hypsometric Curve, xlab =
Relative Area above Elevation, (a/A),
ylab = Relative Elevation, (h/H), col = blue, ...)
{
if (class(x) != SpatialGridDataFrame)
stop(Invalid argument: 'class(x)' must be 'SpatialGridDataFrame')
band.error - FALSE
if (is.numeric(band) | is.integer(band)) {
if ((band  1) | (band  length(colnames(x@data
band.error - TRUE
}
else if (is.character(band))
if (!(band %in% colnames(x@data)))
band.error - TRUE
if (band.error)
stop(Invalid argument: 'band' does not exist in 'x' !)
mydem - x@data[band]
z.min - min(mydem, na.rm = TRUE)
z.max - max(mydem, na.rm = TRUE)
x.dim - x@grid@cellsize[1]
y.dim - x@grid@cellsize[2]
max.area - length(which(!is.na(mydem))) * x.dim * y.dim
res - plot.stepfun(ecdf(as.matrix(mydem)), lwd = 0, cex.points = 0)
z.mean.index - which(round(res$y, 3) == 0.5)[1]
z.mean - res$t[z.mean.index]
relative.area - (1 - res$y[-1])
relative.elev - (res$t[-c(1, length(res$t))] - z.min)/(z.max -
z.min)
plot(relative.area, relative.elev, xaxt = n, yaxt = n,
main = main, xlim = c(0, 1), ylim = c(0, 1), type = l,
ylab = ylab, xlab = xlab, col = col, ...)
Axis(side = 1, at = seq(0, 1, by = 0.05), labels = TRUE)
Axis(side = 2, at = seq(0, 1, by = 0.05), labels = TRUE)
f - splinefun(relative.area, relative.elev, method = monoH.FC)
hi - integrate(f = f, lower = 0, upper = 1)
legend(topright, c(paste(Min Elev. :, round(z.min, 2),
[m.a.s.l.], sep =  ), paste(Mean Elev.:, round(z.mean,
1), [m.a.s.l.], sep =  ), paste(Max Elev. :, round(z.max,
1), [m.a.s.l.], sep =  ), paste(Max Area  :,
round(max.area/1e+06,
1), [km2], sep =  ), , paste(Integral value :,
round(hi$value, 3), sep =  ), paste(Integral error :,
round(hi$abs.error, 3), sep =  )), bty = n, cex = 0.9,
col = c(black, black, black), lty = c(NULL, NULL,
NULL, NULL))

curve_data-data.frame(relative.area,relative.elev)
return(curve_data)
}

(4) rather than calling hypsometric(dem), for example, first do this:

source(hypsometric2.R)

(5) then call:

data-hypsometric2(dem)

(6) you can see the x.y pairs by typing:

data

 at the R prompt.

(7) verify that the data are what you expect, by typing this at the R
prompt:

plot(data)

which should give the same plot as hypsometric2(dem) and hypsometric(dem)
without the embellishments and labeling...

Tom

On Fri, Apr 26, 2013 at 8:52 AM, Anup khanal za...@hotmail.com wrote:

 Dear exports,I have created a hypsometric curve (area-elevation curve) for
 my watershed by using simple command hypsometric(X,main=Hypsometric
 Curve, xlab=Relative Area above Elevation, (a/A),
  ylab=Relative Elevation, (h/H), col=blue)It plots the hypsometric
 curve in RGraphics window, My question is how can I export values which
 is used to create this plot? I mean I want to know the value in y axis for
 certain x value.
 Thanks in advance !

 ..Anup KhanalNorwegian Institute of science and Technology
 (NTNU)Trondheim, NorwayMob:(+47) 45174313

 [[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-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] the joy of spreadsheets (off-topic)

2013-04-24 Thread Thomas Adams
One might wonder if the Excel error was indeed THAT or perhaps a way to
get the desired results, give the other issues in their analysis?


On Wed, Apr 24, 2013 at 11:58 AM, peter dalgaard pda...@gmail.com wrote:

 In case you haven't noticed, this is making the rounds in the media,
 including a handful of references to R. See e.g.


 http://news.slashdot.org/story/13/04/17/0215211/excel-error-contributes-to-problems-with-austerity-study

 I suppose we can't fortune()'ify anonymous quotes, but I kind of like this
 exchange:

 Bacon Bits: SPSS and R are very good at statistical analysis. Quantrix,
 MapleSoft, IBM Algorithmics, and other software is for financial data
 modeling. None of those is particularly appropriate for sharing data in a
 useful format with peers. Excel is.

 Hatta: R is extremely appropriate for sharing data in a useful format
 with peers. It's completely free for one. But more importantly, it saves
 every single step of your analysis. Send someone an Excel file, and who
 knows what they've done to the data. Send someone your R project directory
 and they can see exactly what you did.

 The problem with sending R files to your peers isn't that the R files
 aren't useful. It's that your peers aren't.




 On Apr 16, 2013, at 19:25 , Sarah Goslee wrote:

  Given that we occasionally run into problems with comparing Excel
  results to R results, and other spreadsheet-induced errors, I thought
  this might be of interest.
 
 
 http://www.nextnewdeal.net/rortybomb/researchers-finally-replicated-reinhart-rogoff-and-there-are-serious-problems
 
  The punchline:
 
  If this error turns out to be an actual mistake Reinhart-Rogoff made,
  well, all I can hope is that future historians note that one of the
  core empirical points providing the intellectual foundation for the
  global move to austerity in the early 2010s was based on someone
  accidentally not updating a row formula in Excel.
 
  Ouch.
 
  (Note: I know nothing about the site, the author of the article, or
  the study in question. I was pointed to it by someone else. But if
  true: highly problematic.)
 
  Sarah
 
  --
  Sarah Goslee
  http://www.functionaldiversity.org
 
  __
  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, reproducible code.

 --
 Peter Dalgaard, Professor
 Center for Statistics, Copenhagen Business School
 Solbjerg Plads 3, 2000 Frederiksberg, Denmark
 Phone: (+45)38153501
 Email: pd@cbs.dk  Priv: pda...@gmail.com

 __
 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, reproducible code.


[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Odd graphic device behavior

2013-03-29 Thread Thomas Adams
Thank you Peter, that sounds pretty reasonable.

Best,
Tom

On Friday, March 29, 2013, peter dalgaard wrote:


 On Mar 28, 2013, at 22:27 , Thomas Adams wrote:

  All,
 
  Well to my relief and embarrassment, I discovered my problem. About 5
 weeks
  ago, I shutdown my computer and moved it. When I reconnected everything I
  apparently plugged my HDMI monitor into the 'wrong' output port without
  realizing it. So, on a whim, just now, I made the switch to the other
 port
  and presto changeo -- problem solved!! The odd thing was, besides my R
  graphics device window problems, everything else was fine...
 
  Out of curiosity, can anyone explain this?

 My best guess is that the pixel resolution was taken from the disconnected
 primary display and set to some safe standard value like 640x480,
 miscalculating the dimensions of your display, so that it ended up with
 huge virtual inches.

 The reason everything else didn't notice could be that they work in pixel
 units rather than physical units.

 (There seems to be no really perfect solution to the problem of setting
 default dimensions: Pixel count gives stamp-sized graphs on hi-res
 displays, physical dimensions are meaningless on projectors and not really
 what you want on a tiny screen, and percent of display area is undue
 imperialism if you have a large monitor, intending to overlook many
 windows at once.)

 
  Thanks for all the help...
 
  Tom
 
  On Thu, Mar 28, 2013 at 4:06 PM, Thomas Adams 
  tea...@gmail.comjavascript:;
 wrote:
 
  Luca,
 
  Thank you for the suggestion; I do have an Nvidia graphics card and I am
  using the Nvida driver; still searching for a solution, quite odd...
 
  Tom
 
 
  On Thu, Mar 28, 2013 at 12:28 PM, Luca Nanetti 
  luca.nane...@gmail.comjavascript:;
 wrote:
 
  Thomas,
  any chance that you could have problems with your graphic driver? For
  instance, if you have an Nvidia graphic card, I would recommend
 switching
  from the 'nouveau' driver to the official Nvidia one.
 
  Kind regards,
  luca
 
 
 
 
 
 
[[alternative HTML version deleted]]
 
  __
  R-help@r-project.org javascript:; 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, reproducible code.

 --
 Peter Dalgaard, Professor,
 Center for Statistics, Copenhagen Business School
 Solbjerg Plads 3, 2000 Frederiksberg, Denmark
 Phone: (+45)38153501
 Email: pd@cbs.dk javascript:;  Priv: pda...@gmail.com javascript:;










-- 
Thomas E Adams, III
718 McBurney Drive
Lebanon, OH 45036

1 (513) 739-9512 (cell)

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Odd graphic device behavior

2013-03-28 Thread Thomas Adams
Luca,

Thank you for the suggestion; I do have an Nvidia graphics card and I am
using the Nvida driver; still searching for a solution, quite odd...

Tom

On Thu, Mar 28, 2013 at 12:28 PM, Luca Nanetti luca.nane...@gmail.comwrote:

 Thomas,
 any chance that you could have problems with your graphic driver? For
 instance, if you have an Nvidia graphic card, I would recommend switching
 from the 'nouveau' driver to the official Nvidia one.

 Kind regards,
 luca


[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Odd graphic device behavior

2013-03-28 Thread Thomas Adams
All,

Well to my relief and embarrassment, I discovered my problem. About 5 weeks
ago, I shutdown my computer and moved it. When I reconnected everything I
apparently plugged my HDMI monitor into the 'wrong' output port without
realizing it. So, on a whim, just now, I made the switch to the other port
and presto changeo -- problem solved!! The odd thing was, besides my R
graphics device window problems, everything else was fine...

Out of curiosity, can anyone explain this?

Thanks for all the help...

Tom

On Thu, Mar 28, 2013 at 4:06 PM, Thomas Adams tea...@gmail.com wrote:

 Luca,

 Thank you for the suggestion; I do have an Nvidia graphics card and I am
 using the Nvida driver; still searching for a solution, quite odd...

 Tom


 On Thu, Mar 28, 2013 at 12:28 PM, Luca Nanetti luca.nane...@gmail.comwrote:

 Thomas,
 any chance that you could have problems with your graphic driver? For
 instance, if you have an Nvidia graphic card, I would recommend switching
 from the 'nouveau' driver to the official Nvidia one.

 Kind regards,
 luca






[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Odd graphic device behavior

2013-03-27 Thread Thomas Adams
John,

Thanks for the suggestion, but no. I have even gone so far as to rebuild R
from source, re-booted my computer, and tried the 'experiment':

 require(stats)
 plot(cars)

immediately after starting R. Still the same result. I think it must be
related to some default Ubuntu Unity window manager default I can't sort
out.

Regards,
Tom


On Wed, Mar 27, 2013 at 10:14 AM, John Kane jrkrid...@inbox.com wrote:

 Any chance that you made an earlier call to par() resetting cex in your
 session?  I just had that happen.

 John Kane
 Kingston ON Canada


  -Original Message-
  From: tea...@gmail.com
  Sent: Tue, 26 Mar 2013 10:15:33 -0400
  To: r-help@r-project.org
  Subject: [R] Odd graphic device behavior
 
  I'm experiencing odd graphics device behavior running R 2.15.3 on Ubuntu.
  Regardless of what I try like:
 
  require(stats)
  plot(cars)
  lines(lowess(cars))
  plot(sin, -pi, 2*pi)
 
  for example, the graphics device fills the entire screen with the graphic
  and a very large font. When I shrink the graphics device window, the
  lettering remains large and the line thicknesses stay quite thick. It may
  have been some time since I have done any R work on my Ubuntu computer,
  but
  clearly this did not happen previously.
 
  Does anyone have any thoughts?
 
  Thank you,
  Tom
 
[[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-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.

 
 FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks  orcas on
 your desktop!
 Check it out at http://www.inbox.com/marineaquarium




[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Odd graphic device behavior

2013-03-27 Thread Thomas Adams
Peter,

Thank you.

When I run: X11(width=7, height=7), I get the same full-screen graphics
device window.
Running dev.list() gives me X11cairo
Running system(xdpyinfo) looks reasonable

I tried running options(device=x11) at the R prompt, but this did not
seem to change anything.

When I started R with R --vanilla and then did:

 require(stats)
  plot(cars)

I got:

Error in plot.new() : figure margins too large

... but the window was a reasonable size. However, after I resized the
graphics device window modestly and re-ran plot(cars), the plot was
generated in the resized window, but the lettering was large as before and
the lines were thick as they were previously.

Regards,
Tom


On Wed, Mar 27, 2013 at 1:43 PM, peter dalgaard pda...@gmail.com wrote:


 On Mar 27, 2013, at 18:11 , David Winsemius wrote:

 
  On Mar 27, 2013, at 9:07 AM, Thomas Adams wrote:
 
  John,
 
  Thanks for the suggestion, but no. I have even gone so far as to
 rebuild R
  from source, re-booted my computer, and tried the 'experiment':
 
 require(stats)
 plot(cars)
 
  immediately after starting R. Still the same result. I think it must be
  related to some default Ubuntu Unity window manager default I can't sort
  out.
 
  Have your deleted the default workspace and history files? When they get
 corrupted, odd things can happen.
 

 ...or try R --vanilla

 The immediate suspicion is that something is tampering with your graphics
 device options, so

 - figure out what device you are using (dev.list())
 - if it is X11, have a look at X11.options()
 - try running X11(width=7, height=7) to see if the automagic settings get
 it wrong.

 - try system(xdpyinfo); this may give a long list of gibberish, but look
  for dimensions and resolution and see if they look sane. E.g., I get

 screen #0:
   dimensions:2560x1418 pixels (677x375 millimeters)
   resolution:96x96 dots per inch




 
 
  Regards,
  Tom
 
 
  On Wed, Mar 27, 2013 at 10:14 AM, John Kane jrkrid...@inbox.com
 wrote:
 
  Any chance that you made an earlier call to par() resetting cex in your
  session?  I just had that happen.
 
  John Kane
  Kingston ON Canada
 
 
  -Original Message-
  From: tea...@gmail.com
  Sent: Tue, 26 Mar 2013 10:15:33 -0400
  To: r-help@r-project.org
  Subject: [R] Odd graphic device behavior
 
  I'm experiencing odd graphics device behavior running R 2.15.3 on
 Ubuntu.
  Regardless of what I try like:
 
  require(stats)
  plot(cars)
  lines(lowess(cars))
  plot(sin, -pi, 2*pi)
 
  for example, the graphics device fills the entire screen with the
 graphic
  and a very large font. When I shrink the graphics device window, the
  lettering remains large and the line thicknesses stay quite thick. It
 may
  have been some time since I have done any R work on my Ubuntu
 computer,
  but
  clearly this did not happen previously.
 
  Does anyone have any thoughts?
 
  Thank you,
  Tom
 
  [[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-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
  
  FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks  orcas on
  your desktop!
  Check it out at http://www.inbox.com/marineaquarium
 
 
 
 
   [[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-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
  David Winsemius
  Alameda, CA, USA
 
  __
  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, reproducible code.

 --
 Peter Dalgaard, Professor
 Center for Statistics, Copenhagen Business School
 Solbjerg Plads 3, 2000 Frederiksberg, Denmark
 Phone: (+45)38153501
 Email: pd@cbs.dk  Priv: pda...@gmail.com



[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Odd graphic device behavior

2013-03-26 Thread Thomas Adams
I'm experiencing odd graphics device behavior running R 2.15.3 on Ubuntu.
Regardless of what I try like:

require(stats)
plot(cars)
lines(lowess(cars))
plot(sin, -pi, 2*pi)

for example, the graphics device fills the entire screen with the graphic
and a very large font. When I shrink the graphics device window, the
lettering remains large and the line thicknesses stay quite thick. It may
have been some time since I have done any R work on my Ubuntu computer, but
clearly this did not happen previously.

Does anyone have any thoughts?

Thank you,
Tom

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Running other programs from R

2013-03-17 Thread Thomas Adams
Use the system() command. e.g.

system(Multilog)

On Sat, Mar 16, 2013 at 5:09 PM, Sedat Sen sedatse...@gmail.com wrote:

 Dear list,

 I want to run a statistical program (using its .exe file)  from R  by
 writing a script. I know there are some packages that call WinBUGS, Mplus
 etc. form R. I just want to call the .exe extension of this program and run
 several times writing a code in R. Thus, I want to have the output inside
 R.

 I just don't know where to start. Does anyone have any idea about that? Is
 there a universal package to call application files of other stat programs
 using their application files.

 p.s. The program I am talking about is an IRT program called Multilog.

 --
 *Sedat
 *

 [[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-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Thomas E Adams, III
718 McBurney Drive
Lebanon, OH 45036

1 (513) 739-9512 (cell)

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Using grImport to create a watermark

2012-12-28 Thread Thomas Adams - NOAA Federal
Hi…

I want to use grImport to create a watermark on a plot() using the methods
Paul Murrell describes here:
http://cran.r-project.org/web/packages/grImport/vignettes/import.pdf (page
28). I can essentially reproduce this manually at the R prompt, and
independently I can use grid.picture(…) successfully in a R script, but
when I attempt to do do this in my script:

•
•
•
postscript(outputFilename,paper=us)

grid.picture(noaalogo,distort=FALSE,width=0.5,x=0.50,y=0.50)
grid.rect(gp=gpar(fill=rgb(1,1,1,0.9)))


plot(dat,xaxt=n,type=b,ylim=c(y_range[1],y_range[2]),main=labelStr,xlab=Date,ylab=Elevation,
NAVD88 (Ft))
•
•
•
dev.off()

The picture noaalogo is drawn, but either the plot() is obscured or is
not drawn at all. In either case, the watermarking effect is not
happening in my script, but does work as expected, manually, at the R
prompt. I'm sure this is a graphics device related issue, but I have not
been able to find a solution through my searches.

Thank you,
Tom


-- 

Thomas E Adams

Development  Operations Hydrologist
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

http://www.erh.noaa.gov/er/ohrfc/

EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Using grImport to create a watermark

2012-12-28 Thread Thomas Adams - NOAA Federal
Prof Ripley,

I see that now; I can get the transparency to work, but even with using
pdf() my plot still does not draw if I first use:

grid.picture(noaalogo,distort=**FALSE,width=0.5,x=0.50,y=0.50)
grid.rect(gp=gpar(fill=rgb(1,**1,1,0.9)))

Regards,
Tom


On Fri, Dec 28, 2012 at 1:55 PM, Prof Brian Ripley rip...@stats.ox.ac.ukwrote:

 I suspect you need a device supporting translucency: PostScript does not
 and hence postscript() cannot.  Try the pdf() device (and convert the
 output if you need it).


 On 28/12/2012 17:23, Thomas Adams - NOAA Federal wrote:

 Hi…

 I want to use grImport to create a watermark on a plot() using the methods
 Paul Murrell describes here:
 http://cran.r-project.org/web/**packages/grImport/vignettes/**import.pdfhttp://cran.r-project.org/web/packages/grImport/vignettes/import.pdf(page
 28). I can essentially reproduce this manually at the R prompt, and


 On what OS and what device: see the posting guide 

  independently I can use grid.picture(…) successfully in a R script, but
 when I attempt to do do this in my script:

 •
 •
 •
 postscript(outputFilename,**paper=us)

 grid.picture(noaalogo,distort=**FALSE,width=0.5,x=0.50,y=0.50)
 grid.rect(gp=gpar(fill=rgb(1,**1,1,0.9)))


 plot(dat,xaxt=n,type=b,**ylim=c(y_range[1],y_range[2]),**
 main=labelStr,xlab=Date,**ylab=Elevation,
 NAVD88 (Ft))
 •
 •
 •
 dev.off()

 The picture noaalogo is drawn, but either the plot() is obscured or is
 not drawn at all. In either case, the watermarking effect is not
 happening in my script, but does work as expected, manually, at the R
 prompt. I'm sure this is a graphics device related issue, but I have not
 been able to find a solution through my searches.

 Thank you,
 Tom




 __**
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/**
 posting-guide.html http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



 --
 Brian D. Ripley,  rip...@stats.ox.ac.uk
 Professor of Applied Statistics,  
 http://www.stats.ox.ac.uk/~**ripley/http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595

 __**
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/**
 posting-guide.html http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 

Thomas E Adams

Development  Operations Hydrologist
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

http://www.erh.noaa.gov/er/ohrfc/

EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Auomatic Download of climate netcdf4 files from the Climate Explorer Website

2012-09-14 Thread Thomas Adams
I'm not sure about R code, but wget (http://www.gnu.org/software/wget/)
should work. Here are some examples:

http://www.editcorp.com/Personal/Lars_Appel/wget/v1/wget_7.html

Cheers!
Tom

On Thu, Sep 13, 2012 at 1:37 PM, ucakmde maris_...@hotmail.com wrote:

 Dear R-helpers,

 I am trying to download some netcdf4 files from the Climate Explorer
 Website:

 http://climexp.knmi.nl/start.cgi?id=someone@somewhere

 In fact, there are 78 distinct files. I have found a way to download a
 particular file and open it in R, but I have been informed that there
 exists
 some code to automatically download all the files. Do you have any clue
 regarding how to achieve that?

 Thank you in advance.



 --
 View this message in context:
 http://r.789695.n4.nabble.com/Auomatic-Download-of-climate-netcdf4-files-from-the-Climate-Explorer-Website-tp4643043.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 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, reproducible code.




-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] On Reproducible Code

2012-07-30 Thread Thomas Adams
Hadley,

Thank you for posting this. I think the danger is that novices (and I'm not
far removed from that category) can be intimidated by R, but more so by R
experts that make people AFRAID to ask questions. The danger is that these
intimidating R experts could turn people away from using R; at the very
least, novices could end up wasting valuable time trying to complete their
projects because they can't get the help they are searching for.

Nothing is gained by punishing people over their internet 'manners'…

Tom

On Fri, Jul 27, 2012 at 1:47 PM, Hadley Wickham had...@rice.edu wrote:

 That assumes:

 * Everyone reads the mailing list before making the first posting

 * Everyone reads every part of every email.

 I'd argue that both assumptions are false. People are particular well
 trained to skip over boilerplate text at the bottom of emails.

 I'd suggest an alternative approach is for experts to remember what
 it's like to be a novice, and cultivate an attitude of patience and
 tolerance.  That's about as likely to happen as a mass change in
 behaviour in new users.

 Hadley

 On Fri, Jul 27, 2012 at 9:48 AM, John Kane jrkrid...@inbox.com wrote:
  I'd vote for that!
  It would probably bug the blazes out of experienced users but the time
 savings in getting a newbie to actually supply enough information so that
 someone can, at least, try to answer the question would be well worth it.
 
  John Kane
  Kingston ON Canada
 
 
  -Original Message-
  From: gunter.ber...@gene.com
  Sent: Fri, 27 Jul 2012 07:49:28 -0700
  To: jrkrid...@inbox.com
  Subject: Re: [R] On Reproducible Code
 
  I agree and would like to see it placed at the **TOP** of every post.
 
  -- Bert
 
  On Fri, Jul 27, 2012 at 7:11 AM, John Kane jrkrid...@inbox.com wrote:
 
 
  -Original Message-
  From: j...@bitwrit.com.au
  Sent: Fri, 27 Jul 2012 19:21:36 +1000
  To: dcarl...@tamu.edu
  Subject: Re: [R] On Reproducible Code
 
  On 07/26/2012 01:50 AM, David L Carlson wrote:
  We often refer requesters to the Posting Guide and chide them for not
  reading it.
  ...
  I hesitate to sound too optimistic, but there might be some advantage
  in
  making the statement more prominent and adding a reproducible example
  using
  dput().
 
  The reponses to some requests for help do seem to get a volley of the
  reproducible code answers. Some, such as:
 
  I can't get the answer. PLEASE HELP!!!
 
  probably deserve it, but others appear to emerge from the overheated
  brain of the frustrated noob. With a wonderfully informative name like
  dput, it is rather challenging to guess that this function is the
 way
  to calm the affronted guru with an example of your problem. I am
  particularly amused by the phrase reproducible code, which sounds
  perilously close to the definition of a virus. Perhaps the neglected
  little message at the bottom of each email (which seems to reproduce
  itself) might be easier for the uninitiated to understand if it read:
 
  Please include the R code that is causing the problem _and_ enough
 data
  (see the dput function) for someone else to run the code and get the
  same problem.
 
  I can remember when I didn't know that there was a dput function.
 
  Jim
  I can remember spending a lot of time constructing a data set to post
  before someone mentioned ?dput.  Ah, yes, I still have a couple of
  generic ones archived.
 
  I think your wording above makes a lot of sense.
 
  
  GET FREE SMILEYS FOR YOUR IM  EMAIL - Learn more at
  http://www.inbox.com/smileys
  Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™
  and most webmails
 
  __
  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, reproducible code.
 
 
 
  --
 
  Bert Gunter
  Genentech Nonclinical Biostatistics
 
  Internal Contact Info:
  Phone: 467-7374
  Website:
 
 http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
 
  
  FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
 
  __
  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, reproducible code.



 --
 Assistant Professor / Dobelman Family Junior Chair
 Department of Statistics / Rice University
 http://had.co.nz/

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

Re: [R] On Reproducible Code

2012-07-30 Thread Thomas Adams
Peter,

You may have misunderstood me (I did not define correctly whose internet
manners I was referring to) — I was referring to the internet manners of
those seeking help, that, yes, they may not have adequately researched
things before asking a question, or may not have supplied a reproducible
example, etc., but they don't deserve to be treated disrespectfully — I
think we are agreeing on this…

Tom

On Mon, Jul 30, 2012 at 8:02 AM, peter dalgaard pda...@gmail.com wrote:


 On Jul 30, 2012, at 13:05 , Thomas Adams wrote:

 
  Nothing is gained by punishing people over their internet 'manners'∑
 
  Tom

 On the contrary, everything can be lost by allowing abusers to persevere!

 (And yes, there are people who no longer attempt to help, because of
 ungrateful and downright arrogant behavior they have experienced on the
 lists.)

 --
 Peter Dalgaard, Professor,
 Center for Statistics, Copenhagen Business School
 Solbjerg Plads 3, 2000 Frederiksberg, Denmark
 Phone: (+45)38153501
 Email: pd@cbs.dk  Priv: pda...@gmail.com











-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] is it possible to insert a figure into into another new figure by r script

2012-07-10 Thread Thomas Adams
Jie,

I think the R contributed package, grImport, by Paul Murrell does what you
want. See this:

http://www.jstatsoft.org/v30/i04/paper/

Tom

On Mon, Jul 9, 2012 at 11:14 PM, Mikhail Titov m...@gmx.us wrote:

 Jie Tang totang...@gmail.com writes:

  hi R-users
 Now I have a figure in emf or png or tiff format  that have been drawn
  by other tool and I want to insert this figure into
   my new figure by R script. I wonder if is possible ?

 This [1] might be relevant.

 [1] http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=168

 --
 Mikhail

 __
 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, reproducible code.




-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Plotting tidal speed and direction in R

2012-06-20 Thread Thomas Adams
Zoe,

If you use a Wind Rose diagram (e.g.,
http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=circular:wind rose), which
are available in several packages, you could plot tidal speed and
direction Wind Rose diagrams in a x-y plot to plot location. If you used
the lattice package, this could give you the 5-dimension (time) in each
panel. What I think you will need to pull this off is the R package
grImport — Google for examples of this, for instance, the paper by Paul
Murrell: http://www.stat.auckland.ac.nz/~paul/R/grImport/import.pdf — which
is very cool.

Tom



On Wed, Jun 20, 2012 at 10:14 AM, Greg Snow 538...@gmail.com wrote:

 You can use the 'my.symbols' and 'ms.arrows' functions in the
 TeachingDemos package to plot arrows at given locations with specified
 angles, lengths, and colors.

 On Sat, Jun 16, 2012 at 5:16 AM, zoeita zoe-allc...@live.co.uk wrote:
  Hi,
 
  I have had a look around the forums and I can't seem to find anything
 that
  works with my data.  I have lats, longs, time, tidal speed and direction
 and
  need to plot this in an xy plot to determine changes over time. contour
 and
  cloud have been recommended to me as a way to do this but I can't figure
 out
  how to get 5 dimensions into this.  I want lat and long as my x and y,
 time
  as my z, direction as w and speed as different colours.  I imagine it's a
  lot easier than I think it is - I am very new to R.  Could anyone please
  help with a starting point for this?
 
  Thanks,
 
  Zoe
 
  --
  View this message in context:
 http://r.789695.n4.nabble.com/Plotting-tidal-speed-and-direction-in-R-tp4633587.html
  Sent from the R help mailing list archive at Nabble.com.
 
  __
  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, reproducible code.



 --
 Gregory (Greg) L. Snow Ph.D.
 538...@gmail.com

 __
 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, reproducible code.




-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] On the Design of the R Language

2012-04-25 Thread Thomas Adams
Hmmm… an 'objective' assessment? Maybe. But it looks to me that some
commercial enterprise paid for this study as a means to argue against the
use of R in favor of a commercial package…

On Wed, Apr 25, 2012 at 1:48 PM, R. Michael Weylandt 
michael.weyla...@gmail.com michael.weyla...@gmail.com wrote:

 http://www.cs.purdue.edu/homes/jv/pubs/ecoop12.pdf

 A new paper out on R the language -- I'm not all the way through it but
 it's been an interesting read so far. Thought it might be of interest to
 the list.

 Michael Weylandt
[[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-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Organizations where IT has approved the use of R software

2012-04-12 Thread Thomas Adams
All:

R is used by the NOAA/U.S. National Weather Service to generate graphics
representing real-time hydrologic ensemble (probabilistic) forecasts. Go
to: http://www.erh.noaa.gov/mmefs/ to see.

It is also used in research and development for forecast verification and
analyses for the calibration of distributed hydrologic models.

Tom

On Thu, Apr 12, 2012 at 3:52 PM, David Smith
da...@revolutionanalytics.comwrote:

 It's hard to respond without making it seem like an advertisement for
 Revolution Analytics, but helping companies and government
 organizations standardize on R (specifically, Revolution R) for data
 analysis is something we specialize in. The (partial) list of our
 customers using Revolution R at

 http://www.revolutionanalytics.com/aboutus/our-customers.php

 may be useful fodder for your IT group, as may be this list of
 applications companies have done with R:


 http://www.revolutionanalytics.com/what-is-open-source-r/companies-using-r.php

 The section on the Revolutions blog that Michael Weylandt pointed to
 (http://blog.revolutionanalytics.com/applications/) may also be useful
 to you.

 If you'd like to contact me directly, I'd be happy to connect you with
 some folks here at Revolution Analytics that can provide direct help
 on getting R adopted at your organization.

 Hope this is useful to you,
 # David Smith

 On Thu, Apr 12, 2012 at 11:04, lynnland lynn.landria...@ontario.ca
 wrote:
 
  Hi Gang,
 
  I realize this post is not directly related to programing issues with R,
  however, it appears this may be the best place to ask my question.
 
  I am putting forward a request that R be considered approved software
 in
  my organization.  Never an easy task, this is made much more difficult
 given
  that it is open source software (sends the IT gang into little fits).
  So, I
  am compiling a list of organizations (Universities, goverment,
  industry,etc.) that are using R and whose IT department considers it
  approved software.
 
  If you belong to such an organization could you please let me know? If
 you
  know of organizations that this applies to, but are not directly
 affiliated
  with them I would still be interested but please just let me know which
 of
  these two cases your response fits into.
 
  Thanks in advance.
 
  Lynn

 --
 David M Smith da...@revolutionanalytics.com
 VP of Marketing, Revolution Analytics  http://blog.revolutionanalytics.com
 Tel: +1 (650) 646-9523 (Palo Alto, CA, USA)

 __
 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, reproducible code.




-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] time-series features skewness kurtosis periodicity trend seasonality

2012-04-03 Thread Thomas Adams
John,

If the paper is the one by Xiaozhe Wang, Kate A. Smith, Rob Hyndman, and
Damminda Alahakoon, the way I read it, it does not say they created an R
package (that may be on CRAN). They may have just used R in their analyses;
just a guess...

Tom

On Tue, Apr 3, 2012 at 12:34 PM, John Kohr illuminati...@hotmail.comwrote:


 Hello everyone,

 I found the paper A scalable method for time-series clustering and there
 are proposed several measures to characterize time-series like trend,
 seasonality, periodicity, serial correlation, skewness, kurtosis,
 self-similarity etc.

 They say they have implemented them on R, do you have any clue if there is
 a package calculating them? or any other packages that calculate some of
 them so that i can combine them?

 Thanks,
 John

[[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-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RSqlite UPDATE command problem

2012-03-27 Thread Thomas Adams
All:

I am using RSqlite and want to be able to update individual values in a
record, such as with this simple example:

library(RSQLite)
drv-dbDriver(SQLite)
con-dbConnect(drv,test.db)
my.data-data.frame(countries=c(US,UK,Canada,Australia,NewZealand),vals=c(52,36,74,10,98))
dbWriteTable(con,testtable,my.data)
q-dbReadTable(con,testtable)
q

   countries vals
1 US   52
2 UK   36
3 Canada   74
4  Australia   10
5 NewZealand   98

So, say, I want to change the value for NewZealand to '21' from '98'

I've tried something like this:

sql-UPDATE testtable SET vals=21 WHERE countries='NewZealand'
dbBeginTransaction(con)
dbGetPreparedQuery(con,sql) == I get an error here
dbCommit(con)

using a different example for an INSERT command using a data frame 'data',
this construct is accepted:

dbGetPreparedQuery(con,sql,bind.data=data)

What do I need to do differently to use the UPDATE command?

Regards,
Tom


-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RSqlite UPDATE command problem

2012-03-27 Thread Thomas Adams
Benilton,
*
*
*Thank you — you are quite right!!*
*
*
*Regards,*
*Tom
*
On Tue, Mar 27, 2012 at 9:35 AM, Benilton Carvalho 
beniltoncarva...@gmail.com wrote:

 You probably want:

 sql-UPDATE testtable SET vals=21 WHERE countries='NewZealand'
 dbGetQuery(con, sql)

 instead...

 b

 On 27 March 2012 14:18, Thomas Adams thomas.ad...@noaa.gov wrote:

 All:

 I am using RSqlite and want to be able to update individual values in a
 record, such as with this simple example:

 library(RSQLite)
 drv-dbDriver(SQLite)
 con-dbConnect(drv,test.db)

 my.data-data.frame(countries=c(US,UK,Canada,Australia,NewZealand),vals=c(52,36,74,10,98))
 dbWriteTable(con,testtable,my.data)
 q-dbReadTable(con,testtable)
 q

   countries vals
 1 US   52
 2 UK   36
 3 Canada   74
 4  Australia   10
 5 NewZealand   98

 So, say, I want to change the value for NewZealand to '21' from '98'

 I've tried something like this:

 sql-UPDATE testtable SET vals=21 WHERE countries='NewZealand'
 dbBeginTransaction(con)
 dbGetPreparedQuery(con,sql) == I get an error here
 dbCommit(con)

 using a different example for an INSERT command using a data frame 'data',
 this construct is accepted:

 dbGetPreparedQuery(con,sql,bind.data=data)

 What do I need to do differently to use the UPDATE command?

 Regards,
 Tom


 --

 Thomas E Adams
 National Weather Service
 Ohio River Forecast Center
 1901 South State Route 134
 Wilmington, OH 45177

 EMAIL:  thomas.ad...@noaa.gov
 VOICE:  937-383-0528
 FAX:937-383-0033

[[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-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.





-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Struggling with zoo and aggregate

2012-03-26 Thread Thomas Adams
Gabor,

That does it! I can't thank you enough…

Many thanks,
Tom

On Mon, Mar 26, 2012 at 7:22 AM, Gabor Grothendieck ggrothendi...@gmail.com
 wrote:

 On Sun, Mar 25, 2012 at 10:20 PM, Thomas Adams thomas.ad...@noaa.gov
 wrote:
  Gabor,
 
  Thank you for your help -- it did help me a lot. However, with my data:
 
 lead_time cycler_squared  fcst_date
  1  6 0 5.405095e-02 07/31/2010
  2 12 0 5.521620e-06 07/31/2010
  3 18 0 1.565910e-04 07/31/2010
  4 24 0 8.646822e-02 07/31/2010
  5 30 0 1.719604e-02 07/31/2010
  6 36 0 5.768113e-04 07/31/2010
  7 42 0 2.501269e-06 07/31/2010
  8 48 0 6.451727e-02 07/31/2010
  9  612 2.857931e-01 07/31/2010
  101212 1.138635e-01 07/31/2010
  111812 2.225503e-02 07/31/2010
  122412 1.182031e-03 07/31/2010
  133012 8.841142e-04 07/31/2010
  143612 1.082490e-01 07/31/2010
  154212 1.502887e-05 07/31/2010
  17 6 0 8.689588e-02 08/01/2010
  1812 0 5.884336e-04 08/01/2010
  1918 0 2.219316e-07 08/01/2010
  2024 0 3.960752e-02 08/01/2010
  2130 0 1.087413e-04 08/01/2010
  2342 0 3.583030e-07 08/01/2010
  2448 0 2.907109e-05 08/01/2010
  25 612 8.693451e-02 08/01/2010
  261212 3.208215e-02 08/01/2010
  271812 0.00e+00 08/01/2010
  28 6 0 2.962669e-02 08/02/2010
  29 612 2.363506e-05 08/02/2010
  301212 9.050178e-03 08/02/2010
 
  from:
 
  z - read.zoo(q,index = 4, FUN = as.yearmon, format =
 %m/%d/%Y,aggregate
  = mean)
 
  I get:
  z
   lead_timecycle  r_squared
  Jul 2010  25.6 5.60 0.05034771
  Aug 2010  18.46154 4.615385 0.02191903
 
  what I need is to NOT have the lead_time and cycle averaged, but only
 have
  the r_squared values averaged by lead_time and cycle. I can not seem to
  figure out the correct syntax to do this. I assume I use something like:
 
  q_agg-aggregate(q,by=list(q$lead_time,q$cycle),index = 4, FUN =
 as.yearmon,
  format = %m/%d/%Y)
 
  but I get errors or nonsense when I follow with...
 
  z - read.zoo(q_agg,index = 4, FUN = as.yearmon, format =
  %m/%d/%Y,aggregate = mean)
 
  or some variation of this.
 
  Regards,
  Tom
 
 
 
  On Sat, Mar 24, 2012 at 10:58 PM, Gabor Grothendieck
  ggrothendi...@gmail.com wrote:
 
  On Sat, Mar 24, 2012 at 10:44 PM, Thomas Adams thomas.ad...@noaa.gov
  wrote:
   All:
  
   I have a SQlite database where I have stored some verification data by
   date
time (cycle Z/UTC), lead_time as well as type, duration, etc. I
 would
   like to analyze  plot the data as monthly averages. I have looked at
 a
   bunch of examples which use some combination of zoo and aggregate,
 but I
   have not been able to successfully apply bits and pieces from the
   examples
   I have found. Any help is appreciated. BTW, I calculate mae (mean
   absolute
   error), mse (mean squared error), me (mean error), and other measures
   obtained by using the R verification package.
  
   The example below is limited to 20 records and shows lead_time,
   r_squared,
   (forecast) cycle, fcst_date (forecast date) -- the full data set is
 just
   over 2 years of daily data with 3 forecast cycles (00Z, 12Z, and 18Z)
   daily.
  
   From my query, below) how do I construct an appropriate data
 structure
   to
   analyze  plot the data as monthly averages?
  
   Regards,
   Tom
  
   q-dbGetQuery(con,select lead_time,r_squared,cycle,fcst_date from
   verify_table where duration=6 limit 20)
   q
 lead_timer_squared cycle  fcst_date
   1  6 5.405095e-0200 07/31/2010
   2 12 5.521620e-0600 07/31/2010
   3 18 1.565910e-0400 07/31/2010
   4 24 8.646822e-0200 07/31/2010
   5 30 1.719604e-0200 07/31/2010
   6 36 5.768113e-0400 07/31/2010
   7 42 2.501269e-0600 07/31/2010
   8 48 6.451727e-0200 07/31/2010
   9  6 2.857931e-0112 07/31/2010
   1012 1.138635e-0112 07/31/2010
   1118 2.225503e-0212 07/31/2010
   1224 1.182031e-0312 07/31/2010
   1330 8.841142e-0412 07/31/2010
   1436 1.082490e-0112 07/31/2010
   1542 1.502887e-0512 07/31/2010
   1648   NA12 07/31/2010
   17 6 8.689588e-0200 08/01/2010
   1812 5.884336e-0400 08/01/2010
   1918 2.219316e-0700 08/01/2010
   2024 3.960752e-0200 08/01/2010
  
 
  Try this:
 
  Lines - lead_timer_squared cycle  fcst_date
  1  6 5.405095e-0200 07/31/2010
  2 12 5.521620e-0600 07/31/2010
  3 18 1.565910e-0400 07/31/2010
  4 24 8.646822e-0200 07/31/2010
  5 30 1.719604e-0200 07/31/2010
  6 36 5.768113e-0400 07/31/2010
  7 42

Re: [R] Struggling with zoo and aggregate

2012-03-25 Thread Thomas Adams
Gabor,

Thank you for your help -- it did help me a lot. However, with my data:

   lead_time cycler_squared  fcst_date
1  6 0 5.405095e-02 07/31/2010
2 12 0 5.521620e-06 07/31/2010
3 18 0 1.565910e-04 07/31/2010
4 24 0 8.646822e-02 07/31/2010
5 30 0 1.719604e-02 07/31/2010
6 36 0 5.768113e-04 07/31/2010
7 42 0 2.501269e-06 07/31/2010
8 48 0 6.451727e-02 07/31/2010
9  612 2.857931e-01 07/31/2010
101212 1.138635e-01 07/31/2010
111812 2.225503e-02 07/31/2010
122412 1.182031e-03 07/31/2010
133012 8.841142e-04 07/31/2010
143612 1.082490e-01 07/31/2010
154212 1.502887e-05 07/31/2010
17 6 0 8.689588e-02 08/01/2010
1812 0 5.884336e-04 08/01/2010
1918 0 2.219316e-07 08/01/2010
2024 0 3.960752e-02 08/01/2010
2130 0 1.087413e-04 08/01/2010
2342 0 3.583030e-07 08/01/2010
2448 0 2.907109e-05 08/01/2010
25 612 8.693451e-02 08/01/2010
261212 3.208215e-02 08/01/2010
271812 0.00e+00 08/01/2010
28 6 0 2.962669e-02 08/02/2010
29 612 2.363506e-05 08/02/2010
301212 9.050178e-03 08/02/2010

from:

 z - read.zoo(q,index = 4, FUN = as.yearmon, format =
%m/%d/%Y,aggregate = mean)

I get:
 z
 lead_timecycle  r_squared
Jul 2010  25.6 5.60 0.05034771
Aug 2010  18.46154 4.615385 0.02191903

what I need is to NOT have the lead_time and cycle averaged, but only have
the r_squared values averaged by lead_time and cycle. I can not seem to
figure out the correct syntax to do this. I assume I use something like:

q_agg-aggregate(q,by=list(q$lead_time,q$cycle),index = 4, FUN =
as.yearmon, format = %m/%d/%Y)

but I get errors or nonsense when I follow with...

z - read.zoo(q_agg,index = 4, FUN = as.yearmon, format =
%m/%d/%Y,aggregate = mean)

or some variation of this.

Regards,
Tom


On Sat, Mar 24, 2012 at 10:58 PM, Gabor Grothendieck 
ggrothendi...@gmail.com wrote:

 On Sat, Mar 24, 2012 at 10:44 PM, Thomas Adams thomas.ad...@noaa.gov
 wrote:
  All:
 
  I have a SQlite database where I have stored some verification data by
 date
   time (cycle Z/UTC), lead_time as well as type, duration, etc. I would
  like to analyze  plot the data as monthly averages. I have looked at a
  bunch of examples which use some combination of zoo and aggregate, but I
  have not been able to successfully apply bits and pieces from the
 examples
  I have found. Any help is appreciated. BTW, I calculate mae (mean
 absolute
  error), mse (mean squared error), me (mean error), and other measures
  obtained by using the R verification package.
 
  The example below is limited to 20 records and shows lead_time,
 r_squared,
  (forecast) cycle, fcst_date (forecast date) -- the full data set is just
  over 2 years of daily data with 3 forecast cycles (00Z, 12Z, and 18Z)
 daily.
 
  From my query, below) how do I construct an appropriate data structure
 to
  analyze  plot the data as monthly averages?
 
  Regards,
  Tom
 
  q-dbGetQuery(con,select lead_time,r_squared,cycle,fcst_date from
  verify_table where duration=6 limit 20)
  q
lead_timer_squared cycle  fcst_date
  1  6 5.405095e-0200 07/31/2010
  2 12 5.521620e-0600 07/31/2010
  3 18 1.565910e-0400 07/31/2010
  4 24 8.646822e-0200 07/31/2010
  5 30 1.719604e-0200 07/31/2010
  6 36 5.768113e-0400 07/31/2010
  7 42 2.501269e-0600 07/31/2010
  8 48 6.451727e-0200 07/31/2010
  9  6 2.857931e-0112 07/31/2010
  1012 1.138635e-0112 07/31/2010
  1118 2.225503e-0212 07/31/2010
  1224 1.182031e-0312 07/31/2010
  1330 8.841142e-0412 07/31/2010
  1436 1.082490e-0112 07/31/2010
  1542 1.502887e-0512 07/31/2010
  1648   NA12 07/31/2010
  17 6 8.689588e-0200 08/01/2010
  1812 5.884336e-0400 08/01/2010
  1918 2.219316e-0700 08/01/2010
  2024 3.960752e-0200 08/01/2010
 

 Try this:

 Lines - lead_timer_squared cycle  fcst_date
 1  6 5.405095e-0200 07/31/2010
 2 12 5.521620e-0600 07/31/2010
 3 18 1.565910e-0400 07/31/2010
 4 24 8.646822e-0200 07/31/2010
 5 30 1.719604e-0200 07/31/2010
 6 36 5.768113e-0400 07/31/2010
 7 42 2.501269e-0600 07/31/2010
 8 48 6.451727e-0200 07/31/2010
 9  6 2.857931e-0112 07/31/2010
 1012 1.138635e-0112 07/31/2010
 1118 2.225503e-0212 07/31/2010
 1224 1.182031e-0312 07/31/2010
 1330 8.841142e-0412 07/31/2010
 1436 1.082490e-0112 07/31/2010

 library(zoo)
 q - read.table(text = Lines)

 z - read.zoo(q, index = 4, FUN

[R] Struggling with zoo and aggregate

2012-03-24 Thread Thomas Adams
All:

I have a SQlite database where I have stored some verification data by date
 time (cycle Z/UTC), lead_time as well as type, duration, etc. I would
like to analyze  plot the data as monthly averages. I have looked at a
bunch of examples which use some combination of zoo and aggregate, but I
have not been able to successfully apply bits and pieces from the examples
I have found. Any help is appreciated. BTW, I calculate mae (mean absolute
error), mse (mean squared error), me (mean error), and other measures
obtained by using the R verification package.

The example below is limited to 20 records and shows lead_time, r_squared,
(forecast) cycle, fcst_date (forecast date) -- the full data set is just
over 2 years of daily data with 3 forecast cycles (00Z, 12Z, and 18Z) daily.

From my query, below) how do I construct an appropriate data structure to
analyze  plot the data as monthly averages?

Regards,
Tom

 q-dbGetQuery(con,select lead_time,r_squared,cycle,fcst_date from
verify_table where duration=6 limit 20)
 q
   lead_timer_squared cycle  fcst_date
1  6 5.405095e-0200 07/31/2010
2 12 5.521620e-0600 07/31/2010
3 18 1.565910e-0400 07/31/2010
4 24 8.646822e-0200 07/31/2010
5 30 1.719604e-0200 07/31/2010
6 36 5.768113e-0400 07/31/2010
7 42 2.501269e-0600 07/31/2010
8 48 6.451727e-0200 07/31/2010
9  6 2.857931e-0112 07/31/2010
1012 1.138635e-0112 07/31/2010
1118 2.225503e-0212 07/31/2010
1224 1.182031e-0312 07/31/2010
1330 8.841142e-0412 07/31/2010
1436 1.082490e-0112 07/31/2010
1542 1.502887e-0512 07/31/2010
1648   NA12 07/31/2010
17 6 8.689588e-0200 08/01/2010
1812 5.884336e-0400 08/01/2010
1918 2.219316e-0700 08/01/2010
2024 3.960752e-0200 08/01/2010

-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a somewhat related cartoon

2012-03-07 Thread Thomas Adams
Sarah,

Thanks! Great stuff...

Tom

On Wed, Mar 7, 2012 at 10:07 AM, Sarah Goslee sarah.gos...@gmail.comwrote:

 Quoting from today's PhD Comics, available at:
 http://www.phdcomics.com/comics.php?f=1476

 What the methodology section says: Analysis was performed using a
 commercially available software package.

 What it really means: I put the numbers into this magic box and out
 came my thesis!


 --
 Sarah Goslee
 http://www.functionaldiversity.org

 __
 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, reproducible code.




-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177
EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] The Future of R | API to Public Databases

2012-01-13 Thread Thomas Adams
Sarah,

I agree; I think it would be the exception rather than the rule that one
would access these public data sources given the range of needs of R users,
who are generally analyzing their own data. Plus, IMO, it just is not very
difficult to reformat the data to a suitable format, if need be, to import
into R.

Tom

On Fri, Jan 13, 2012 at 4:58 PM, Sarah Goslee sarah.gos...@gmail.comwrote:

 R is Open Source. You're welcome to write tools, and submit your
 package to CRAN. I think some part of this has been done, based
 on questions to the list asking about those parts.

 Personally, I've been using S-Plus and then R for 18 years, and never
 required data from any of them. Which doesn't make it not important,
 but suggests that public databases aren't the be-all and end-all for
 R use.

 Sarah

 On Fri, Jan 13, 2012 at 4:14 PM, Benjamin Weber m...@bwe.im wrote:
  Dear R Users -
 
  R is a wonderful software package. CRAN provides a variety of tools to
  work on your data. But R is not apt to utilize all the public
  databases in an efficient manner.
  I observed the most tedious part with R is searching and downloading
  the data from public databases and putting it into the right format. I
  could not find a package on CRAN which offers exactly this fundamental
  capability.
  Imagine R is the unified interface to access (and analyze) all public
  data in the easiest way possible. That would create a real impact,
  would put R a big leap forward and would enable us to see the world
  with different eyes.
 
  There is a lack of a direct connection to the API of these databases,
  to name a few:
 
  - Eurostat
  - OECD
  - IMF
  - Worldbank
  - UN
  - FAO
  - data.gov
  - ...
 
  The ease of access to the data is the key of information processing with
 R.
 
  How can we handle the flow of information noise? R has to give an
  answer to that with an extensive API to public databases.
 
  I would love your comments and ideas as a contribution in a vital
 discussion.
 
  Benjamin
 

 --
 Sarah Goslee
 http://www.functionaldiversity.org

 __
 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, reproducible code.




-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177
EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Boxplot of multiple vectors with different lengths

2011-12-12 Thread Thomas Adams
Ryan,

I think you could do what you want by having the vector data written to
separate files; then create a file containing the individual file names. In
R, read the file containing the list of file names and loop through this
reading in the individual vector files. Maybe this is an inelegant, brute
force approach, but it has worked for me with essentially the same problem.

Tom

On Mon, Dec 12, 2011 at 4:24 PM, Ryan Utz utz.r...@gmail.com wrote:

 Hello,

 I'm attempting to write a code that automatically imports data from
 different files (with different lengths-just one variable) and makes tidy
 box plots for comparison. I can successfully import the data and create a
 list of the vectors I want to compare. But I cannot, for the life of me,
 figure out how to generate box plots using the list option. Suppose these
 are my data:

 a-c(1,1,1,1,2,3,2,1,2,3)
 b-c(2,2,2,3,4,4,4,3,3)
 c-c(4,3,3,2,3,4,5,3,3,3,4,4,5,6,3,2)

 And this is my list of the vectors I'm interested in:

  z-list(c(a,b,c))

 Well, this successfully generates the kind of boxplot I want:

 boxplot(a,b,c)

 But this does not:

 boxplot(z)

 Because I'm trying to write an automatic plot-generator as the amount of
 data I'm working with will typically vary, I need to write this to handle
 any number of data vectors.

 I've tried every imaginable means of tweaking the name of z, with zero
 success. And I've scoured the help pages for about 45 minutes (just to
 preempt any read the help responses). Please help!

 Thanks,
 Ryan

 --

 Ryan Utz, Ph.D.
 Aquatic Ecologist/STREON Scientist
 National Ecological Observatory Network

 Home/Cell: (724) 272-7769
 Work: (720) 836-2488

[[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-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177
EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Boxplot of multiple vectors with different lengths

2011-12-12 Thread Thomas Adams
Bert,

I may be mistaken, but I thought Ryan wrote write code that
automatically *imports
data* from different files (with different lengths-just one variable), so,
I was referring to doing something with the data before it gets into R. I
understand that one should not need to write out data and then re-read it
in some way. As I said, those more experienced with R will probably offer
better ideas.

Tom

On Mon, Dec 12, 2011 at 5:05 PM, Bert Gunter gunter.ber...@gene.com wrote:

 Sorry -- previous versiuon prematurely sent. Full version is:

  Yikes!  You should never have to do this sort of thing (writing stuff
  out to files, etc.)

  What is wanted, I believe, is ?do.call as in

  do.call(boxplot, z)

  where z is list(a,b,c)   as Sarah described.

  However, I think you might do even better in terms of controlling
  options, labels, etc. if you would get the data into standard flat
  file format (data frame) as

 Result Source
  1a
  3   b
 2 b
  5 c
 ... etc.

 (This is easy to do in R and via many packages.)
 and then use he formula interface in the lattice ?bwplot  function for th
 eplot.

 Cheers,
 Bert

 
  result
 
  On Mon, Dec 12, 2011 at 1:43 PM, Thomas Adams thomas.ad...@noaa.gov
 wrote:
  Ryan,
 
  I think you could do what you want by having the vector data written to
  separate files; then create a file containing the individual file
 names. In
  R, read the file containing the list of file names and loop through this
  reading in the individual vector files. Maybe this is an inelegant,
 brute
  force approach, but it has worked for me with essentially the same
 problem.
 
  Tom
 
  On Mon, Dec 12, 2011 at 4:24 PM, Ryan Utz utz.r...@gmail.com wrote:
 
  Hello,
 
  I'm attempting to write a code that automatically imports data from
  different files (with different lengths-just one variable) and makes
 tidy
  box plots for comparison. I can successfully import the data and
 create a
  list of the vectors I want to compare. But I cannot, for the life of
 me,
  figure out how to generate box plots using the list option. Suppose
 these
  are my data:
 
  a-c(1,1,1,1,2,3,2,1,2,3)
  b-c(2,2,2,3,4,4,4,3,3)
  c-c(4,3,3,2,3,4,5,3,3,3,4,4,5,6,3,2)
 
  And this is my list of the vectors I'm interested in:
 
   z-list(c(a,b,c))
 
  Well, this successfully generates the kind of boxplot I want:
 
  boxplot(a,b,c)
 
  But this does not:
 
  boxplot(z)
 
  Because I'm trying to write an automatic plot-generator as the amount
 of
  data I'm working with will typically vary, I need to write this to
 handle
  any number of data vectors.
 
  I've tried every imaginable means of tweaking the name of z, with
 zero
  success. And I've scoured the help pages for about 45 minutes (just to
  preempt any read the help responses). Please help!
 
  Thanks,
  Ryan
 
  --
 
  Ryan Utz, Ph.D.
  Aquatic Ecologist/STREON Scientist
  National Ecological Observatory Network
 
  Home/Cell: (724) 272-7769
  Work: (720) 836-2488
 
 [[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-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
 
 
 
  --
 
  Thomas E Adams
  National Weather Service
  Ohio River Forecast Center
  1901 South State Route 134
  Wilmington, OH 45177
  EMAIL:  thomas.ad...@noaa.gov
  VOICE:  937-383-0528
  FAX:937-383-0033
 
 [[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-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
 
 
  --
 
  Bert Gunter
  Genentech Nonclinical Biostatistics
 
  Internal Contact Info:
  Phone: 467-7374
  Website:
 
 http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm



 --

 Bert Gunter
 Genentech Nonclinical Biostatistics

 Internal Contact Info:
 Phone: 467-7374
 Website:

 http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm




-- 

Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177
EMAIL:  thomas.ad...@noaa.gov
VOICE:  937-383-0528
FAX:937-383-0033

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Question about ggplot2 and stat_smooth

2011-10-06 Thread Thomas Adams

 Dennis  Hadley,

This does exactly what I need — thank you so much!

Regards,
Tom


On 10/4/11 5:34 PM, Dennis Murphy wrote:

Hi Hadley:

When I tried your function on the example data, I got the following:

dd- data.frame(year = rep(2000:2008, each = 500), y = rnorm(4500))
g- function(df, qs = c(.05, .25, .50, .75, .95)) {
  data.frame(q = qs, quantile(d$y, qs))
}
ddply(dd, .(year), g)


ddply(dd, .(year), g)

yearq quantile.d.y..qs.
1  2000 0.05NA
2  2000 0.25NA
3  2000 0.50NA
...
43 2008 0.50NA
44 2008 0.75NA
45 2008 0.95NA
Warning messages:
1: In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
2: In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
repeated once per year

This, however, does work (with a likely fix to the variable name afterwards):

g- function(df, qs = c(.05, .25, .50, .75, .95)) {
  data.frame(q = qs, quantile(d[, 2], qs))
}


ddply(dd, .(year), g)

yearq quantile.d...2...qs.
1  2000 0.05  -1.36670724
2  2000 0.25  -0.97786897
3  2000 0.50  -0.05982217
4  2000 0.75   0.33576399
5  2000 0.95   1.30389105
...

Dennis

On Tue, Oct 4, 2011 at 12:10 PM, Hadley Wickhamhad...@rice.edu  wrote:

# Function to compute quantiles and return a data frame
g- function(d) {
   qq- as.data.frame(as.list(quantile(d$y, c(.05, .25, .50, .75, .95
   names(qq)- paste('Q', c(5, 25, 50, 75, 95), sep = '')
   qq   }

You could cut out the melt step by making this return a data frame:

g- function(df, qs = c(.05, .25, .50, .75, .95)) {
  data.frame(q = qs, quantile(d$y, qs))
}

Hadley

--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/




--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] Question about ggplot2 and stat_smooth

2011-10-04 Thread Thomas . Adams
Hadley,

Thanks for responding. No, not smoothed quantile regression. If you go here: 
http://www.erh.noaa.gov/mmefs/index.php and click on one of the colored 
squares, you can see we have 'boxplots'. What I want to express is the 
uncertainty as depicted in the example from my previous email where I can 
specify the limits calculated for the 'boxplots' using  5%, 25%,75%, 95% limits 
as we have with the 'boxplots'.

Tom

- Original Message -
From: Hadley Wickham had...@rice.edu
Date: Tuesday, October 4, 2011 10:23 am
Subject: Re: [R] Question about ggplot2 and stat_smooth
To: Thomas Adams thomas.ad...@noaa.gov
Cc: R-help forum r-help@r-project.org


 On Mon, Oct 3, 2011 at 12:24 PM, Thomas Adams thomas.ad...@noaa.gov 
 wrote:
   I'm interested in creating a graphic -like- this:
 
  c - ggplot(mtcars, aes(qsec, wt))
  c + geom_point() + stat_smooth(fill=blue, colour=darkblue, 
 size=2, alpha
  = 0.2)
 
  but I need to show 2 sets of bands (with different shading) using 
 5%, 25%,
  75%, 95% limits that I specify and where the heavy blue line is the 
 median.
  I don't understand how to do this with ggplot2.
 
 Exactly what sort of limits do you want?  It sounds like maybe you are
 looking for smoothed quantile regression.
 
 Hadley
 
 -- 
 Assistant Professor / Dobelman Family Junior Chair
 Department of Statistics / Rice University


__
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, reproducible code.


Re: [R] Question about ggplot2 and stat_smooth

2011-10-04 Thread Thomas Adams

 Hadley:

Below is an example of what I am trying to do, I just don't understand 
how to supply the limits to the blue and pink shaded regions and the 
values of the black line, which are meant to represent from bottom to 
top, the 5%, 25%, 50%, 75%, 95% limits that I get from quantile():


h + geom_ribbon(aes(ymin=level-2, ymax=level+2),fill='pink')+ 
geom_ribbon(aes(ymin=level-1, ymax=level+1),fill='light blue')+ 
geom_line(aes(y=level))


My apologies for not explaining what I was after better previously.

Regards,
Tom


On 10/4/11 1:01 PM, thomas.ad...@noaa.gov wrote:

Hadley,

Thanks for responding. No, not smoothed quantile regression. If you go here: 
http://www.erh.noaa.gov/mmefs/index.php and click on one of the colored 
squares, you can see we have 'boxplots'. What I want to express is the 
uncertainty as depicted in the example from my previous email where I can 
specify the limits calculated for the 'boxplots' using  5%, 25%,75%, 95% limits 
as we have with the 'boxplots'.

Tom

- Original Message -
From: Hadley Wickhamhad...@rice.edu
Date: Tuesday, October 4, 2011 10:23 am
Subject: Re: [R] Question about ggplot2 and stat_smooth
To: Thomas Adamsthomas.ad...@noaa.gov
Cc: R-help forumr-help@r-project.org



On Mon, Oct 3, 2011 at 12:24 PM, Thomas Adamsthomas.ad...@noaa.gov
wrote:

  I'm interested in creating a graphic -like- this:

c- ggplot(mtcars, aes(qsec, wt))
c + geom_point() + stat_smooth(fill=blue, colour=darkblue,

size=2, alpha

= 0.2)

but I need to show 2 sets of bands (with different shading) using

5%, 25%,

75%, 95% limits that I specify and where the heavy blue line is the

median.

I don't understand how to do this with ggplot2.

Exactly what sort of limits do you want?  It sounds like maybe you are
looking for smoothed quantile regression.

Hadley

--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University


__
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, reproducible code.



--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


[R] Question about ggplot2 and stat_smooth

2011-10-03 Thread Thomas Adams

 I'm interested in creating a graphic -like- this:

c - ggplot(mtcars, aes(qsec, wt))
c + geom_point() + stat_smooth(fill=blue, colour=darkblue, size=2, 
alpha = 0.2)


but I need to show 2 sets of bands (with different shading) using 5%, 
25%, 75%, 95% limits that I specify and where the heavy blue line is the 
median. I don't understand how to do this with ggplot2. What I am doing 
currently is to generate 'boxplots' (with 5%, 25%, 75%, 95% limits) at 
6-hourly time steps (so I have a series of boxplots, which you can see 
by clicking on a map point: 
http://www.erh.noaa.gov/mmefs/index_test.php?Lat=38.2Lon=-80.1Zoom=5Refresh=0RFCOverlay=0Model=NAEFS). 
Some who use our graphics would like to see something more like the 
ggplot2 with stat_smooth graphic.


Help is much appreciated.

Regards,
Tom

--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] Question about ggplot2 and stat_smooth

2011-10-03 Thread Thomas Adams



Andrés,

Thank you for your help, but that does not capture what I'm looking for. I need 
to be able to control the
shaded bound limits and they need to be coincident.

Tom

On 10/3/11 3:37 PM, Andrés Aragón wrote:

Hi,
Try some like this:

c- ggplot(mtcars, aes(qsec, mpg, colour=factor(cyl)))
c + stat_smooth(aes(group=cyl))+stat_smooth(aes(fill=factor(cyl)))+geom_point()


Andrés AM



2011/10/3, Thomas Adamsthomas.ad...@noaa.gov:

   I'm interested in creating a graphic -like- this:

c- ggplot(mtcars, aes(qsec, wt))
c + geom_point() + stat_smooth(fill=blue, colour=darkblue, size=2,
alpha = 0.2)

but I need to show 2 sets of bands (with different shading) using 5%,
25%, 75%, 95% limits that I specify and where the heavy blue line is the
median. I don't understand how to do this with ggplot2. What I am doing
currently is to generate 'boxplots' (with 5%, 25%, 75%, 95% limits) at
6-hourly time steps (so I have a series of boxplots, which you can see
by clicking on a map point:
http://www.erh.noaa.gov/mmefs/index_test.php?Lat=38.2Lon=-80.1Zoom=5Refresh=0RFCOverlay=0Model=NAEFS).
Some who use our graphics would like to see something more like the
ggplot2 with stat_smooth graphic.

Help is much appreciated.

Regards,
Tom

--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.




--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] Looking for Filliben (correlation test)

2011-06-30 Thread Thomas . Adams


- Original Message -
From: gaiarrido gaiarr...@usal.es
Date: Thursday, June 30, 2011 1:11 pm
Subject: Re: [R] Looking for Filliben (correlation test)
To: r-help@r-project.org
Mario,

I did a google search and found this: 
http://genepi.qimr.edu.au/staff/davidD/R/filliben.R

Cheers!
Tom

 Thanks very much, but...the OP, what's that?
 Sorry
 
 -
 Mario Garrido Escudero
 PhD student
 Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola
 Universidad de Salamanca
 --
 View this message in context: 
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 R-help@r-project.org mailing list
 
 PLEASE do read the posting guide 
 and provide commented, minimal, self-contained, reproducible code.

__
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, reproducible code.


Re: [R] Thiessen Method

2011-05-26 Thread Thomas Adams



Federico,

I understand what you are after — you want time-series estimates based on the 
Thiessen polygon estimates
taken from the station time-series data. My recommendation is that the process 
of doing this would be far
easier using something like GRASS GIS, possibly in conjunction with R (since 
they play together very well).

Unfortunately, lots of coding/scripting is needed — I can not see that there 
are a few R commands you can
make to pull this off.

The process would look something like:

(1) import all station data for time step 1 (all data could be imported at one 
time, but this complicates the process)
(2) make Thiessen polygons based on (1)
(3) write-out results from (2)
(4) repeat (1)-(3) for each time step
(5) concatenate individual Thiessen polygon time-series results sequentially

This kind of thing is pretty straight-forward and keeps computers happy!

Regards,
Tom



Federico,

That's an improvement, but a long way from the reproducible example
requested by the posting guide. I and others who might help are more
interested in the way the data and coordinates are organized and a
detailed explanation of what you expect the results to look like, etc,
than in a verbal description of the problem. From your description, I
can come up with many ways in which your data might be specified, and
results that you might want.

The posting guide provides valuable tips on how to provide a
well-formed question.

Did you try looking at the packages and functions I suggested in my
previous reply?

Sarah

On Thu, May 26, 2011 at 11:35 AM, federico.eccel
federico.ec...@gmail.com  wrote:

Dear Sarah,

I have a grid in which 8 raingauges are locted, in my case the dataset is
composed by 8 hourly timeseries, one for each raingauge. I would like to
obtain from these timeseries using the Thiessen method the values of the
precipitation in all the grid. In particular I would like to create the
thiessen polygons around the raingauges that have to be limited on my grid.

Thanks a lot

Federico




--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] recommendation on r scripting tutorial?

2011-04-02 Thread Thomas . Adams
Wensui,

use google and search for r stats scripts and find among others:

http://cran.r-project.org/doc/contrib/Lemon-kickstart/kr_scrpt.html

Tom

- Original Message -
From: Wensui Liu liuwen...@gmail.com
Date: Saturday, April 2, 2011 11:22 am
Subject: [R] recommendation on r scripting tutorial?
To: r-help r-help@r-project.org

 Good morning, dear listers
 
 I am wondering if you could recommend a good tutorial / book for r scripting.
 
 thank you so much in advance!
 
 WenSui Liu
 Credit Risk Manager, 53 Bancorp
 wensui@53.com
 513-295-4370
 
 __
 R-help@r-project.org mailing list
 
 PLEASE do read the posting guide 
 and provide commented, minimal, self-contained, reproducible code.

__
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, reproducible code.


[R] 2 questions about probplot in package e1071

2011-03-26 Thread Thomas Adams
 The contributed package e1071 does exactly what I want except that I 
need to have (1) the abscissa and ordinate axes swapped, with the 
probability scale on the bottom and the quantiles scale on the LHS. 
Using the following example:


library(e1071)
x - rnorm(100, mean=5)
probplot(x, line=FALSE)

and (2) I need to have lines connecting the plotted symbols, as you get 
with:


x-log(seq(1:20))
plot(x,type='b')

How can I do these two things; I've done a bunch of searching, but have 
not come across anything yet.


Regards,
Tom

--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] 2 questions about probplot in package e1071

2011-03-26 Thread Thomas Adams

 David,

Thanks! This is very helpful! I'm still very much a novice…

Tom

On 3/26/11 4:11 PM, David Winsemius wrote:


On Mar 26, 2011, at 4:06 PM, Thomas Adams wrote:

The contributed package e1071 does exactly what I want except that I 
need to have (1) the abscissa and ordinate axes swapped, with the 
probability scale on the bottom and the quantiles scale on the LHS. 
Using the following example:


library(e1071)
x - rnorm(100, mean=5)
probplot(x, line=FALSE)

and (2) I need to have lines connecting the plotted symbols, as you 
get with:


x-log(seq(1:20))
plot(x,type='b')

How can I do these two things; I've done a bunch of searching, but 
have not come across anything yet.


The code is all there. Just rework it. Type:

probplot

then...

probplot2 - function(

and paste in your re-worked code that swaps labels, the x and y 
vectors, and change axis(1) to axis 2 and axis(2, ...) to axis(1, ...) 
a few other swaps like abline(h=...) to abline(v=...)





--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


[R] Help needed with plot axis labeling

2011-03-24 Thread Thomas Adams
 I have looked at many examples and tried many different combinations 
of doing this, but with no luck. I have something like this:


plot(1:10, xaxt = n)
axis(1, xaxp=c(2, 9, 7))
axis(4)

but, what I need is to have different labels for axis-4 than those for 
axis-2 (the vertical axes) — that is, rather than 2,4,6,8,10 for both 
the left and right vertical axes, I need A,B,C,D,E on the right — but at 
the same tick locations as those on the left. I have tried using at=1:5, 
labels=c(…), but either nothing happens or I overwrite axis-4 at 
different tick locations; in any case, not what I need. How can I do this?


Regards,
Tom

--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] Timeseries Data Plotted as Monthly Boxplots

2011-02-16 Thread Thomas Adams
Katrina,

What I have done, if I understand what you are after, was to create a list for 
each month of data - in order. Then, create a boxplot - in order - by 
month/year. I do this for our ensemble streamflow forecasts. The key us to 
create the list of values by month.

Regards,
Tom

Sent from my iPhone

On Feb 16, 2011, at 3:31 PM, Katrina Bennett kebenn...@alaska.edu wrote:

 Hello, I'm trying to develop a box plot of time series data to look at the
 range in the data values over the entire period of record.
 
 My data initially starts out as a list of hourly data, and then I've been
 using this code to make this data into the final ts array.
 
 # Read in the station list
 stn.list - read.csv(/home/kbennett/fews/stnlist3, as.is=T, header=F)
 
 # Read in all three variables.
 vars - c(MAT, MAP, MAP06)
 
 for (stn in stn.list) {
  for (v in 1:length(vars) {
# Read in year month start and end dates table  name it
ym.table - read.csv(/home/kbennett/fews/, stn, var, .ym.txt, as.is=T,
 header=F)
names(ym.table) - c(yearstart, monthstart, yearend, monthend)
 
fn - paste(stn, ., vars[v], .FIN, sep=)
  if(file.exists(fn)) {
clim.dat - read.csv(fn, header=F)
names(clim.dat) - c(cdata)
year.start - ym.table$yearstart
year.end - ym.table$yearend
 
mo.start - ym.table$monthstart
mo.end - ym.table$monthend
 
regts.start = ISOdatetime(year.start, mo.start, 1, hour=0, min=0,
 sec=0, tz=GMT)
regts.end = ISOdatetime(year.end, mo.end, 1, hour=18, min=0, sec=0,
 tz=GMT)
 
zts - zooreg(clim.dat$cdata, start = regts.start, end = regts.end,
 frequency = 4, deltat = 21600)
 
#Create a daily average from the timeseries
zta - aggregate(zts, as.POSIXct(cut(time(zts), 24 hours,
 include=T)), mean)
 
#Select hourly data from the timeseries based on a specific time
zt.hr - aggregate(zts, as.Date, head, 4)
zt.hr.ym - aggregate(zt.hr, as.yearmon, head, 4)
zt.hr.1 - zt.hr.ym[,1]
zt.hr.2 - zt.hr.ym[,2]
zt.hr.3 - zt.hr.ym[,3]
zt.hr.4 - zt.hr.ym[,4]
 
zt.hr.1a - aggregate(zt.hr.1, as.yearmon)
min.y - min(zt.hr)
max.y - max(zt.hr)
 
frequency(zt.hr.1) - 12
zt.1.mo -  as.ts(zt.hr.1)
 
#Monthly boxplots of daily averages, for the months
boxplot(zt.1.mo ~ month,   ##THIS IS WHAT DOESN'T
 WORK HERE
 boxwex=0.25, at=(1:12)-0.2,
 outline = F,
 col = gray,
 xlab = Month,
 ylab = expression(paste(( ,T^o,C )) ),
 ylim = c(min.y-5,max.y+5),
 yaxs = i,
 xaxt = n,
 main = vars)
axis(1, at=c(1:12), labels=month.abb, cex.axis = 0.65)
legend(topright, c(Hour 00), fill = c(gray))
}
 
 
 
#write the results to a csv file
write.csv(cdat, paste(stn, _, vars[v], .csv, sep=),
 row.names=T, col.names=T)
 
}
 }
 
 
 The final array looks like this:
 
JanFebMarAprMayJunJulAugSep
 OctNovDec
 1948 28.719  4.977 39.037  9.746  8.348 36.672 47.660 54.076 38.062 34.486
 11.938 39.666
 1949 11.698 -6.675 16.844  0.950 10.349 38.752 39.785 40.544 57.603 35.476
 2.308 -7.960
 1950  0.340 45.206  6.385 17.132 19.074 38.465 48.711 54.686 48.743 33.978
 23.090 10.007
 1951 12.398 31.304 47.182  4.539 23.223 45.668 50.516 53.239 59.402 28.081
 16.427 14.839
 1952 -7.693 30.561 33.478 14.799 12.750 35.359 43.180 57.840 44.593 43.768
 8.574 14.587
 1953 -9.875 38.726 26.393 12.881 19.228 48.833 49.903 56.224 48.829 23.783
 19.308 14.292
 1954 35.943 16.706 16.021  7.806 23.593 40.418 45.310 53.113 49.203 29.480
 17.228 33.068
 1955 23.363 15.706 14.100 17.271 19.258 36.969 47.301 51.826 40.446 35.201
 16.463 11.132
 1956 45.868 -8.504 48.167 10.746 25.024 36.247 47.741 52.160 41.781 29.115
 25.414 21.954
 
 
 
 My main problem is that I can't access the rows (i.e. months) to subset the
 data by.
 
 Could someone point out how I am able to get at the months in this array and
 subset them for plotting using the boxplot function?
 
 
 Thank you,
 
 Katrina
 
 -- 
 Katrina E. Bennett
 PhD Student
 University of Alaska Fairbanks
 International Arctic Research Center
 930 Koyukuk Drive, PO Box 757340
 Fairbanks, Alaska 99775-7340
 907-474-1939 office
 907-385-7657 cell
 kebenn...@alaska.edu
 
 
 Personal Address:
 UAF, PO Box 752525
 Fairbanks, Alaska 99775-2525
 bennett.katr...@gmail.com
 
[[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-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 

Re: [R] Layout of mulitpage conditioned lattice plots

2010-12-19 Thread Thomas Adams

 Dennis,

Thank you; this helps me, too!

Tom

On 12/19/10 11:45 AM, Dennis Murphy wrote:

Hi Dieter:

If I read your intention correctly, you need a third element in layout = .
Here's a little example:

df- data.frame(month = rep(month.abb, each = 20),
   time = rep(1:20, 12),
   y = rnorm(240))
xyplot(y ~ time | month, data = df, layout = c(2, 2, 3))

This produces 3 pages of 2 x 2 plots.

Hope this is what you had in mind..

Dennis

On Sun, Dec 19, 2010 at 8:23 AM, Dieter Menne
dieter.me...@menne-biomed.dewrote:


Dear latticists,

I would like to spread a lattice conditioned plot over multiple pages,
keeping the same layout as if I had only one page as shown in the code
below.

My workaround is to divide the dataframe into subset that fit on one page,
but the code is ugly.

Is there a build-in way to achieve this?

Dieter



library(lattice)
nsubj = 13 # This number is variable
dt = expand.grid(time=1:20,comp=LETTERS[1:3],subj=letters[1:nsubj])
dt$val = rnorm(nrow(dt))

#pdf(file=multpageOk.pdf)
# How it should look:
xyplot(val~time|subj+comp, data=dt,type=l,layout=c(10,3),
  subset=as.integer(subj)= 10)
#dev.off()

# What to do if it stretches over multiple pages, but I want the same
# layout as above?
pdf(file=multpage.pdf)
xyplot(val~time|subj+comp, data=dt,type=l,layout=c(10,3))
dev.off()

--
View this message in context:
http://r.789695.n4.nabble.com/Layout-of-mulitpage-conditioned-lattice-plots-tp3094581p3094581.html
Sent from the R help mailing list archive at Nabble.com.

__
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, reproducible code.


[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] Why software fails in scientific research

2010-07-01 Thread Thomas Adams

OK…

My Grandfather, who was a farmer, was outstanding in his field…

Cheers…

Murray M Cooper, PhD wrote:

For what its worth!

A good friend who also happens to be an ecologist
told me An ecologist is a statistician who likes to be
outside.

Murray M Cooper, Phd
Richland Statistics

- Original Message - From: Gavin Simpson 
gavin.simp...@ucl.ac.uk

To: Bert Gunter gunter.ber...@gene.com
Cc: r-help@r-project.org
Sent: Thursday, July 01, 2010 11:57 AM
Subject: Re: [R] Why software fails in scientific research



On Wed, 2010-06-30 at 11:17 -0700, Bert Gunter wrote:

Just one small additional note below ...

Bert Gunter
Genentech Nonclinical Biostatistics


But a lot of academics are not going to waste their time 
documenting code


properly, so others can reap the benefits of it. They would rather 
get on

with
the next project, to get the next paper. 


-- Indeed. My personal experience over 3 decades in industrial 
(private)

research is that data analysis is viewed as relatively
unimportant/straightforward/pedestrian and is left to technicians (or
postdocs) -- often with what is done being largely dictated by the
conventions of a particular journal or discipline. The lab heads and
research directors are responsible for the grand research strategies,
managing resources, etc. and don't want to waste much time on 
something that
routine. So worrying about reproducibility of data analysis code 
(if there
is any, given the use of GUI software like Excel) falls beneath 
their radar.


Clearly there are disciplines (e.g. ecology?) where this may NOT be the
case.


If ecology is anything to go by (and I am an ecologist, sort of, just
about), there is a large body of the community doing things because i)
that is how they've always been done, or ii) because that's what
reviewers/editors expect etc. with a much smaller group of researchers
pushing at the boundaries (of their field) to use techniques
statisticians and the like have been using for a very long time.

Reproducible research is still very much in the (very, very) small
minority of the work I come across reviewing papers etc. But I am
encouraged by the number of people I know who are starting to use tools
like R to conduct their research.


-- Bert


G

--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Dr. Gavin Simpson [t] +44 (0)20 7679 0522
ECRC, UCL Geography, [f] +44 (0)20 7679 0565
Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/
UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

__
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, reproducible code.



__
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, reproducible code.



--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] two questions for R beginners

2010-02-26 Thread Thomas Adams

Paul,

I think your point you need [to] spend at least a few hours a week on 
it is key. Since I am not doing statistics daily, more in fits  starts 
as my latest project -may- require, my approach has been more task 
oriented. A less-than-ideal approach. So, I think your suggestion is 
on-the-mark.


Tom


Paul Hiemstra wrote:

Ivan Calandra wrote:

You are definitely right...
What to do with bad beginner's questions is not a simple issue.

If a beginner's mailing list is created, who will answer to such 
questions? And moreover, the beginners won't take advantage of the 
other questions (I've personally learned a lot trying to understand 
the questions and answers to other's problems). And also, as you 
said, the problems might persist.
The beginner's mailing list might be good in one aspect though: the 
experts who subscribe to it would be willing to help the beginners 
to get started with R, knowing that the questions might not be 
clearly stated.


As you pointed out, the mailing list is not the best for basic stuff 
(the question is of course what is basic?). Not everybody knows 
some colleagues who work with R (I'm personally the 1st one to use R 
in my lab).
I think, somehow and I have no idea how, documentation and guidance 
to search for help should be more accessible as soon as you start 
with R. Maybe a _*clear*_ section on the R homepage or in the 
introduction to R manual like where to find help, including all 
of the most common and useful resources available (from ? and 
RSiteSearch() to R Wiki and Crantastic).
  

Hi Ivan (and list),

I think the main problem is not as much that there isn't structure in 
the way R provides documentation / tutorials, but that people have a 
hard time finding the structure. There are task views for certain 
specific fields, but I think a lot of beginners do not know that they 
exist. There are separate mailing lists for specific fields, but I 
often see geographical (my field of expertise) oriented questions on 
R-help that would fit much better on R-sig-geo.


So I think a O my God, I've downloaded R and what now tutorial might 
be a good idea to put very close to the download button of R on CRAN. 
This tutorial would focus not on how to do things in R, but would 
provide guidance to the most obvious sources of information such as 
Task views, specific mailing lists, ways to search list archives, 
information for beginners how to write a good e-mail etc. I think for 
a lot of beginners it is not as much the answer to a specific question 
that they need, but more guidance how to look for answers themselves.


But at the end of the day, R is still not very easy to learn when 
coming from GUI oriented stats programs. In addition, to become 
reasonably fluent in R, you need spend at least a few hours a week on 
it. SO I think we can ease the pain for beginners, but not take away 
that it takes quite some time to become fluent in R.


cheers,
Paul

I hope that this whole discussion might help to make the R world better.
Thank you Patrick for initiating it!
Regards,
Ivan

Le 2/26/2010 15:09, Paul Hiemstra a écrit :
 

Ivan Calandra wrote:
   

Since you want input from beginners, here are some thoughts

I had and still have two big problems with R:
- this vectorization thing. I've read many manuals (including R 
inferno), but I'm still not completely clear about it. In simple 
examples, it's fine. But when it gets a bit more complex, then...
Related to it, the *apply functions are still a bit difficult to 
understand. When I have to use them, I just try one and see what 
happens. I don't understand them well enough to know which one I need.
- the second problem is where to find the functions/packages I 
need. There are many options, and that's actually the problem. R 
Wiki, Rseek, RSiteSearch, Crantastic, etc... When you start with R, 
you discover that the capabilities of R are almost unlimited and 
you don't really know where to start, where to find what you need.


As noted in earlier posts, the mailing list is really great, but 
some people are really hard with beginners. It was noted in a 
discussion a few days ago, but it looks like some don't realize how 
difficult it is at the beginning to formulate a good question, 
clear, with self-contained example and so on. Moreover, not 
everybody speaks English natively. I don't mean that you must help, 
even when the question is really vague and not clear and whatever. 
I'm just saying that if you don't want to help (whatever the 
reason), you don't have to say it badly. But in any cases, the 
mailing list is still really helpful. As someone noted (sorry I 
erased the email so I don't remember who), it might be a good idea 
to split it.
  

Hi everyone,

My 2ct about the mailing list :). I understand that beginners have a 
hard time formulating a good question. But the problem is that we 
can't answer the question when it is unclear. So either I:


- Don't bother answering
- Try do discuss with the author of 

[R] help needed using t.test with factors

2010-02-04 Thread Thomas Adams

I am trying to use t.test on the following data:

datetypeINTERVALnCASESMTFSDFMTOSDO
nFSTMFnOBSMOMBBIASCVBIASEVMEMAE
RMSECRCF
2001-06-15avnGE1.0043850.2460.3001.502
0.55613671.37343851.5021.4710.2850.164
-1.2561.2661.3990.056
2001-06-15avn0.00LT0.018522250.0180.0660.000
0.0017084060.0018522250.0000.0001.663
71.6640.0180.0180.0680.176
2001-06-15avn0.01LT0.10776430.0970.1510.039
0.0251761290.040776430.0390.0402.3312.486
0.0580.0860.1620.096
2001-06-15avn0.10LT0.25293880.1450.1860.162
0.043741640.160293880.1620.1602.4930.897
-0.0170.1290.1890.056
2001-06-15avn0.25LT0.50175920.1770.2080.353
0.070251890.336175920.3530.3431.3650.503
-0.1750.2380.2790.033
2001-06-15avn0.50LT1.00105030.2080.2450.693
0.13864810.666105030.6930.6830.5930.300
-0.4850.5170.5600.017
2001-06-15avnGE1.0043850.2460.3001.502
0.55613671.37343851.5021.4710.2850.164
-1.2561.2661.3990.056
2001-06-15etaGE1.0043850.2420.3081.502
0.5565771.33843851.5021.4830.1170.161
-1.2611.2721.3980.111
2001-06-15eta0.00LT0.018522250.0130.0550.000
0.0017994240.0008522250.0000.0001.368
50.1930.0130.0130.0570.175
2001-06-15eta0.01LT0.10776430.0790.1390.039
0.0251139870.043776430.0390.0411.6172.013
0.0400.0790.1440.083
2001-06-15eta0.10LT0.25293880.1160.1690.162
0.043474610.160293880.1620.1611.5960.719
-0.0450.1390.1780.055
2001-06-15eta0.25LT0.50175920.1470.1970.353
0.070232840.345175920.3530.3481.2960.417
-0.2050.2580.2910.040
2001-06-15eta0.50LT1.00105030.1800.2300.693
0.13870030.643105030.6930.6730.6190.260
-0.5130.5320.5760.041
2001-06-15etaGE1.0043850.2420.3081.502
0.5565771.33843851.5021.4830.1170.161
-1.2611.2721.3980.111
2001-06-15hpcGE1.0043850.3390.3451.502
0.55613261.26543851.5021.4470.2550.225
-1.1631.1721.3140.144
2001-06-15hpc0.00LT0.018522250.0140.0570.000
0.0017771470.0008522250.0000.0000.823
54.8240.0140.0140.0590.195
2001-06-15hpc0.01LT0.10776430.0920.1480.039
0.0251233420.048776430.0390.0451.9672.346
0.0530.0850.1560.109
2001-06-15hpc0.10LT0.25293880.1470.1900.162
0.043561070.161293880.1620.1611.8960.908
-0.0150.1370.1920.077
2001-06-15hpc0.25LT0.50175920.1950.2190.353
0.070256770.344175920.3530.3481.4240.552
-0.1580.2370.2760.057
2001-06-15hpc0.50LT1.00105030.2510.2650.693
0.13881370.659105030.6930.6780.7370.362
-0.4420.4800.5290.066
2001-06-15hpcGE1.0043850.3390.3451.502
0.55613261.26543851.5021.4470.2550.225
-1.1631.1721.3140.144
2001-06-15ngmGE1.0043850.1570.1991.502
0.5562971.11943851.5021.4780.0500.105
-1.3451.3451.474-0.062
2001-06-15ngm0.00LT0.018522250.0170.0630.000
0.0017719010.0008522250.0000.0000.703
65.4570.0170.0170.0650.132
2001-06-15ngm0.01LT0.10776430.0700.1270.039
0.0251337790.041776430.0390.0401.8031.784
0.0310.0730.1310.073
2001-06-15ngm0.10LT0.25293880.1000.1520.162
0.043548500.161293880.1620.1611.8590.620
-0.0610.1370.1680.050
2001-06-15ngm0.25LT0.50175920.1300.1770.353
0.070245260.344175920.3530.3481.3600.369
-0.2220.2630.2910.047
2001-06-15ngm0.50LT1.00105030.1520.1960.693
0.13863830.643105030.6930.6740.5640.219
-0.5410.5510.5910.025

Re: [R] help needed using t.test with factors

2010-02-04 Thread Thomas Adams

Dennis,

Thank you for the suggestion, but I get this error:

 t.test(MAE ~ type,data=data)
Error in t.test.formula(MAE ~ type, data = data) :
 grouping factor must have exactly 2 levels

Tom



Dennis Murphy wrote:

Hi:

On Thu, Feb 4, 2010 at 11:07 AM, Thomas Adams thomas.ad...@noaa.gov 
mailto:thomas.ad...@noaa.gov wrote:


I am trying to use t.test on the following data:

datetypeINTERVALnCASESMTFSDFMTOSDO  
 nFSTMFnOBSMOMBBIASCVBIASEVMEMAE  
 RMSECRCF
2001-06-15avnGE1.0043850.2460.3001.502  
 0.55613671.37343851.5021.4710.285  
 0.164-1.2561.2661.3990.056
2001-06-15avn0.00LT0.018522250.0180.066  
 0.0000.0017084060.0018522250.0000.000  
 1.66371.6640.0180.0180.0680.176
2001-06-15avn0.01LT0.10776430.0970.151  
 0.0390.0251761290.040776430.0390.040  
 2.3312.4860.0580.0860.1620.096
2001-06-15avn0.10LT0.25293880.1450.186  
 0.1620.043741640.160293880.1620.160  
 2.4930.897-0.0170.1290.1890.056
2001-06-15avn0.25LT0.50175920.1770.208  
 0.3530.070251890.336175920.3530.343  
 1.3650.503-0.1750.2380.2790.033
2001-06-15avn0.50LT1.00105030.2080.245  
 0.6930.13864810.666105030.6930.683  
 0.5930.300-0.4850.5170.5600.017
2001-06-15avnGE1.0043850.2460.3001.502  
 0.55613671.37343851.5021.4710.285  
 0.164-1.2561.2661.3990.056
2001-06-15etaGE1.0043850.2420.3081.502  
 0.5565771.33843851.5021.4830.1170.161

   -1.2611.2721.3980.111
2001-06-15eta0.00LT0.018522250.0130.055  
 0.0000.0017994240.0008522250.0000.000  
 1.36850.1930.0130.0130.0570.175
2001-06-15eta0.01LT0.10776430.0790.139  
 0.0390.0251139870.043776430.0390.041  
 1.6172.0130.0400.0790.1440.083
2001-06-15eta0.10LT0.25293880.1160.169  
 0.1620.043474610.160293880.1620.161  
 1.5960.719-0.0450.1390.1780.055
2001-06-15eta0.25LT0.50175920.1470.197  
 0.3530.070232840.345175920.3530.348  
 1.2960.417-0.2050.2580.2910.040
2001-06-15eta0.50LT1.00105030.1800.230  
 0.6930.13870030.643105030.6930.673  
 0.6190.260-0.5130.5320.5760.041
2001-06-15etaGE1.0043850.2420.3081.502  
 0.5565771.33843851.5021.4830.1170.161

   -1.2611.2721.3980.111
2001-06-15hpcGE1.0043850.3390.3451.502  
 0.55613261.26543851.5021.4470.255  
 0.225-1.1631.1721.3140.144
2001-06-15hpc0.00LT0.018522250.0140.057  
 0.0000.0017771470.0008522250.0000.000  
 0.82354.8240.0140.0140.0590.195
2001-06-15hpc0.01LT0.10776430.0920.148  
 0.0390.0251233420.048776430.0390.045  
 1.9672.3460.0530.0850.1560.109
2001-06-15hpc0.10LT0.25293880.1470.190  
 0.1620.043561070.161293880.1620.161  
 1.8960.908-0.0150.1370.1920.077
2001-06-15hpc0.25LT0.50175920.1950.219  
 0.3530.070256770.344175920.3530.348  
 1.4240.552-0.1580.2370.2760.057
2001-06-15hpc0.50LT1.00105030.2510.265  
 0.6930.13881370.659105030.6930.678  
 0.7370.362-0.4420.4800.5290.066
2001-06-15hpcGE1.0043850.3390.3451.502  
 0.55613261.26543851.5021.4470.255  
 0.225-1.1631.1721.3140.144
2001-06-15ngmGE1.0043850.1570.1991.502  
 0.5562971.11943851.5021.4780.0500.105

   -1.3451.3451.474-0.062
2001-06-15ngm0.00LT0.018522250.0170.063  
 0.0000.0017719010.0008522250.0000.000  
 0.70365.4570.0170.0170.0650.132
2001-06-15ngm0.01LT0.10776430.0700.127  
 0.0390.0251337790.041776430.0390.040  
 1.803

Re: [R] help needed using t.test with factors

2010-02-04 Thread Thomas Adams

Peter,

Thanks for pointing that out; the 'sleep' data looks like this:

 sleep
  extra group
10.7 1
2   -1.6 1
3   -0.2 1
4   -1.2 1
5   -0.1 1
63.4 1
73.7 1
80.8 1
90.0 1
10   2.0 1
11   1.9 2
12   0.8 2
13   1.1 2
14   0.1 2
15  -0.1 2
16   4.4 2
17   5.5 2
18   1.6 2
19   4.6 2
20   3.4 2

which, unless I am missing something, consists of 2 factors. My dataset 
consists of 7 and I get the following error using my data:


 t.test(MAE ~ type,data=data)
Error in t.test.formula(MAE ~ type, data = data) :
 grouping factor must have exactly 2 levels

Cheers!


Peter Ehlers wrote:

Somehow, in looking for those many examples, you missed the
'sleep' data example on the help page for t.test.

(BTW, I wouldn't consider your sample data to be minimal
or even close to minimal.)

 -Peter Ehlers

Thomas Adams wrote:

I am trying to use t.test on the following data:

datetypeINTERVALnCASESMTFSDFMTOSDO
nFSTMFnOBSMOMBBIASCVBIASEVMEMAE
RMSECRCF
2001-06-15avnGE1.0043850.2460.3001.502
0.55613671.37343851.5021.4710.2850.164
-1.2561.2661.3990.056
2001-06-15avn0.00LT0.018522250.0180.066
0.0000.0017084060.0018522250.0000.000
1.66371.6640.0180.0180.0680.176
2001-06-15avn0.01LT0.10776430.0970.151
0.0390.0251761290.040776430.0390.040
2.3312.4860.0580.0860.1620.096
2001-06-15avn0.10LT0.25293880.1450.186
0.1620.043741640.160293880.1620.160
2.4930.897-0.0170.1290.1890.056
2001-06-15avn0.25LT0.50175920.1770.208
0.3530.070251890.336175920.3530.343
1.3650.503-0.1750.2380.2790.033
2001-06-15avn0.50LT1.00105030.2080.245
0.6930.13864810.666105030.6930.683
0.5930.300-0.4850.5170.5600.017
2001-06-15avnGE1.0043850.2460.3001.502
0.55613671.37343851.5021.4710.2850.164
-1.2561.2661.3990.056
2001-06-15etaGE1.0043850.2420.3081.502
0.5565771.33843851.5021.4830.1170.161
-1.2611.2721.3980.111
2001-06-15eta0.00LT0.018522250.0130.055
0.0000.0017994240.0008522250.0000.000
1.36850.1930.0130.0130.0570.175
2001-06-15eta0.01LT0.10776430.0790.139
0.0390.0251139870.043776430.0390.041
1.6172.0130.0400.0790.1440.083
2001-06-15eta0.10LT0.25293880.1160.169
0.1620.043474610.160293880.1620.161
1.5960.719-0.0450.1390.1780.055
2001-06-15eta0.25LT0.50175920.1470.197
0.3530.070232840.345175920.3530.348
1.2960.417-0.2050.2580.2910.040
2001-06-15eta0.50LT1.00105030.1800.230
0.6930.13870030.643105030.6930.673
0.6190.260-0.5130.5320.5760.041
2001-06-15etaGE1.0043850.2420.3081.502
0.5565771.33843851.5021.4830.1170.161
-1.2611.2721.3980.111
2001-06-15hpcGE1.0043850.3390.3451.502
0.55613261.26543851.5021.4470.2550.225
-1.1631.1721.3140.144
2001-06-15hpc0.00LT0.018522250.0140.057
0.0000.0017771470.0008522250.0000.000
0.82354.8240.0140.0140.0590.195
2001-06-15hpc0.01LT0.10776430.0920.148
0.0390.0251233420.048776430.0390.045
1.9672.3460.0530.0850.1560.109
2001-06-15hpc0.10LT0.25293880.1470.190
0.1620.043561070.161293880.1620.161
1.8960.908-0.0150.1370.1920.077
2001-06-15hpc0.25LT0.50175920.1950.219
0.3530.070256770.344175920.3530.348
1.4240.552-0.1580.2370.2760.057
2001-06-15hpc0.50LT1.00105030.2510.265
0.6930.13881370.659105030.6930.678
0.7370.362-0.4420.4800.5290.066
2001-06-15hpcGE1.0043850.3390.3451.502
0.55613261.26543851.5021.4470.2550.225
-1.1631.1721.3140.144
2001-06-15ngmGE1.0043850.1570.1991.502
0.5562971.11943851.5021.4780.0500.105
-1.3451.345

Re: [R] help needed using t.test with factors

2010-02-04 Thread Thomas Adams

Peter,

Thank you very much! That did the trick…

Regards,
Tom


Peter Ehlers wrote:

Tom,

t.test(MAE ~ type, data=data, subset=type %in% c('hpc','rfc'))

-Peter Ehlers

Thomas Adams wrote:

Dennis,

Thank you for the suggestion, but I get this error:

 t.test(MAE ~ type,data=data)
Error in t.test.formula(MAE ~ type, data = data) :
grouping factor must have exactly 2 levels

Tom



Dennis Murphy wrote:

Hi:

On Thu, Feb 4, 2010 at 11:07 AM, Thomas Adams thomas.ad...@noaa.gov 
mailto:thomas.ad...@noaa.gov wrote:


I am trying to use t.test on the following data:

date type INTERVAL nCASES MTF SDF MTO SDO nFST MF nOBS MO MB BIASCV 
BIASEV ME MAE RMSE CRCF
2001-06-15 avn GE1.00 4385 0.246 0.300 1.502 0.556 1367 1.373 4385 
1.502 1.471 0.285 0.164 -1.256 1.266 1.399 0.056
2001-06-15 avn 0.00LT0.01 852225 0.018 0.066 0.000 0.001 708406 
0.001 852225 0.000 0.000 1.663 71.664 0.018 0.018 0.068 0.176
2001-06-15 avn 0.01LT0.10 77643 0.097 0.151 0.039 0.025 176129 0.040 
77643 0.039 0.040 2.331 2.486 0.058 0.086 0.162 0.096
2001-06-15 avn 0.10LT0.25 29388 0.145 0.186 0.162 0.043 74164 0.160 
29388 0.162 0.160 2.493 0.897 -0.017 0.129 0.189 0.056
2001-06-15 avn 0.25LT0.50 17592 0.177 0.208 0.353 0.070 25189 0.336 
17592 0.353 0.343 1.365 0.503 -0.175 0.238 0.279 0.033
2001-06-15 avn 0.50LT1.00 10503 0.208 0.245 0.693 0.138 6481 0.666 
10503 0.693 0.683 0.593 0.300 -0.485 0.517 0.560 0.017
2001-06-15 avn GE1.00 4385 0.246 0.300 1.502 0.556 1367 1.373 4385 
1.502 1.471 0.285 0.164 -1.256 1.266 1.399 0.056
2001-06-15 eta GE1.00 4385 0.242 0.308 1.502 0.556 577 1.338 4385 
1.502 1.483 0.117 0.161

-1.261 1.272 1.398 0.111
2001-06-15 eta 0.00LT0.01 852225 0.013 0.055 0.000 0.001 799424 
0.000 852225 0.000 0.000 1.368 50.193 0.013 0.013 0.057 0.175
2001-06-15 eta 0.01LT0.10 77643 0.079 0.139 0.039 0.025 113987 0.043 
77643 0.039 0.041 1.617 2.013 0.040 0.079 0.144 0.083
2001-06-15 eta 0.10LT0.25 29388 0.116 0.169 0.162 0.043 47461 0.160 
29388 0.162 0.161 1.596 0.719 -0.045 0.139 0.178 0.055
2001-06-15 eta 0.25LT0.50 17592 0.147 0.197 0.353 0.070 23284 0.345 
17592 0.353 0.348 1.296 0.417 -0.205 0.258 0.291 0.040
2001-06-15 eta 0.50LT1.00 10503 0.180 0.230 0.693 0.138 7003 0.643 
10503 0.693 0.673 0.619 0.260 -0.513 0.532 0.576 0.041
2001-06-15 eta GE1.00 4385 0.242 0.308 1.502 0.556 577 1.338 4385 
1.502 1.483 0.117 0.161

-1.261 1.272 1.398 0.111
2001-06-15 hpc GE1.00 4385 0.339 0.345 1.502 0.556 1326 1.265 4385 
1.502 1.447 0.255 0.225 -1.163 1.172 1.314 0.144
2001-06-15 hpc 0.00LT0.01 852225 0.014 0.057 0.000 0.001 777147 
0.000 852225 0.000 0.000 0.823 54.824 0.014 0.014 0.059 0.195
2001-06-15 hpc 0.01LT0.10 77643 0.092 0.148 0.039 0.025 123342 0.048 
77643 0.039 0.045 1.967 2.346 0.053 0.085 0.156 0.109
2001-06-15 hpc 0.10LT0.25 29388 0.147 0.190 0.162 0.043 56107 0.161 
29388 0.162 0.161 1.896 0.908 -0.015 0.137 0.192 0.077
2001-06-15 hpc 0.25LT0.50 17592 0.195 0.219 0.353 0.070 25677 0.344 
17592 0.353 0.348 1.424 0.552 -0.158 0.237 0.276 0.057
2001-06-15 hpc 0.50LT1.00 10503 0.251 0.265 0.693 0.138 8137 0.659 
10503 0.693 0.678 0.737 0.362 -0.442 0.480 0.529 0.066
2001-06-15 hpc GE1.00 4385 0.339 0.345 1.502 0.556 1326 1.265 4385 
1.502 1.447 0.255 0.225 -1.163 1.172 1.314 0.144
2001-06-15 ngm GE1.00 4385 0.157 0.199 1.502 0.556 297 1.119 4385 
1.502 1.478 0.050 0.105

-1.345 1.345 1.474 -0.062
2001-06-15 ngm 0.00LT0.01 852225 0.017 0.063 0.000 0.001 771901 
0.000 852225 0.000 0.000 0.703 65.457 0.017 0.017 0.065 0.132
2001-06-15 ngm 0.01LT0.10 77643 0.070 0.127 0.039 0.025 133779 0.041 
77643 0.039 0.040 1.803 1.784 0.031 0.073 0.131 0.073
2001-06-15 ngm 0.10LT0.25 29388 0.100 0.152 0.162 0.043 54850 0.161 
29388 0.162 0.161 1.859 0.620 -0.061 0.137 0.168 0.050
2001-06-15 ngm 0.25LT0.50 17592 0.130 0.177 0.353 0.070 24526 0.344 
17592 0.353 0.348 1.360 0.369 -0.222 0.263 0.291 0.047
2001-06-15 ngm 0.50LT1.00 10503 0.152 0.196 0.693 0.138 6383 0.643 
10503 0.693 0.674 0.564 0.219 -0.541 0.551 0.591 0.025
2001-06-15 ngm GE1.00 4385 0.157 0.199 1.502 0.556 297 1.119 4385 
1.502 1.478 0.050 0.105

-1.345 1.345 1.474 -0.062
2001-06-15 rfc GE1.00 4385 0.343 0.349 1.502 0.556 1192 1.239 4385 
1.502 1.446 0.224 0.228 -1.159 1.168 1.310 0.157
2001-06-15 rfc 0.00LT0.01 852225 0.014 0.055 0.000 0.001 773777 
0.000 852225 0.000 0.000 0.719 53.984 0.014 0.014 0.056 0.200
2001-06-15 rfc 0.01LT0.10 77643 0.091 0.141 0.039 0.025 123689 0.047 
77643 0.039 0.044 1.899 2.333 0.052 0.084 0.150 0.114
2001-06-15 rfc 0.10LT0.25 29388 0.148 0.184 0.162 0.043 58569 0.159 
29388 0.162 0.160 1.957 0.913 -0.014 0.134 0.186 0.081
2001-06-15 rfc 0.25LT0.50 17592 0.197 0.214 0.353 0.070 26386 0.340 
17592 0.353 0.345 1.448 0.558 -0.156 0.232 0.271 0.055
2001-06-15 rfc 0.50LT1.00 10503 0.253 0.262 0.693 0.138 8123 0.643 
10503 0.693 0.671 0.718 0.365 -0.440 0.476 0.525 0.074
2001-06-15 rfc GE1.00 4385 0.343 0.349 1.502 0.556 1192 1.239 4385 
1.502 1.446 0.224 0.228 -1.159 1.168 1.310 0.157
2001-07-15 avn GE1.00 3258 0.194 0.233 1.399 0.400

[R] ggplot2/qplot question regarding reducing the no. of x-axis labels

2010-02-03 Thread Thomas Adams

All:

I am using the command: qplot(date,MAE,data=data,facets=INTERVAL~type) 
which works fine except that the dates for my date axes are crunched 
together so much that they are unreadable. I can not find an option that 
I can set that will automatically reduce the x-axis labels to fit the 
available space.


regards to all…

--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] ggplot2/qplot question regarding reducing the no. of x-axis labels

2010-02-03 Thread Thomas Adams

Dennis,

Thanks; that's just what I needed!

Regards,
Tom

Dennis Murphy wrote:

Hi:

ggplot2 works with dates of class date and times of class POSIXct.
See scale_x_date(), which is discussed in section 6.4.2 of the ggplot2
book.

HTH,
Dennis

On Wed, Feb 3, 2010 at 11:15 AM, Thomas Adams thomas.ad...@noaa.gov 
mailto:thomas.ad...@noaa.gov wrote:


All:

I am using the command:
qplot(date,MAE,data=data,facets=INTERVAL~type) which works fine
except that the dates for my date axes are crunched together so
much that they are unreadable. I can not find an option that I can
set that will automatically reduce the x-axis labels to fit the
available space.

regards to all…

-- 
Thomas E Adams

National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov mailto:thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
R-help@r-project.org mailto: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, reproducible code.





--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] Are there free R webinar recordings somewhere ?

2009-12-07 Thread Thomas Adams

Tal,

You might look here: http://www.fort.usgs.gov/brdscience/LearnR.htm

I just googled r stats webinar

Tom

Tal Galili wrote:

Hi all,
A friend just sent me this:
http://www.mathworks.com/company/events/webinars/index.html?id=language=en
http://www.mathworks.com/company/events/webinars/index.html?id=language=enAnd
asked me if there is something of the like in the R community.
Does anyone know of such a think ?

Cheers,
Tal


Contact
Details:---
Contact me: tal.gal...@gmail.com |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com/ (English)
--

[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
  



--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] From R to LaTeX to pdf?

2009-11-24 Thread Thomas Adams

Joel,

You should consider using Sweave: 
http://www.stat.umn.edu/~charlie/Sweave/ -or- 
http://en.wikipedia.org/wiki/Sweave


Regards,
Tom


Joel Fürstenberg-Hägg wrote:

Hi all,

 


Anyone experienced in the LaTeX format?

 


I'm trying to use the xtable package to create nice anova tables, but how do I 
do to produce a pdf from the resulting LaTeX table? I've tried WinShell and 
MiKTeX, but I couldn't get any of them working...

 


Here's an example of the output in R:

 


% latex table generated in R 2.9.2 by xtable 1.5-6 package
% Tue Nov 24 14:17:32 2009
\begin{tabular}{lr}
  \hline
  Df  Sum Sq  Mean Sq  F value  Pr($$F) \\ 
  \hline
cat  2  40.50  20.25  6.66  0.0019 \\ 
  Residuals  107  325.13  3.04 \\ 
   \hline

\end{tabular}

 


Best regards,

 


Joel
 		 	   		  
_

Lagra alla dina foton på Skydrive. Det är enkelt och säkert!
http://www.skydrive.live.com
[[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-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
  



--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] Problem building R 2.10.0 - Matrix package

2009-11-13 Thread Thomas Adams

Martin,

That's exactly right. I'm simply building R from source, downloaded from 
CRAN, and doing exactly what I have easily been able to do previously. I 
think I first encountered this problem with version 2.9.2 (if memory 
serves…).


Tom


Martin Maechler wrote:

Thank you, Russ,
but ...

  

RPH == R P Herrold herr...@owlriver.com
on Thu, 12 Nov 2009 14:13:26 -0500 (EST) writes:



 TA == Thomas Adams thomas.ad...@noaa.gov
TA Attached is the output file from building R 2.10.0 on  RedHat Linux. I
TA have never previously experienced any problems when building R from
TA source with new releases. But, now I get a compile error with the Matrix
TA package:

[...]

RPH The Raw Hide packaging of R 2.10.0 has Matrix in it as a 
RPH new addition ...


RPH [herr...@centos-5 monit]$ rpm -qf /usr/lib64/R/library/Matrix
RPH R-core-2.10.0-2orc

RPH ... whose packaging of such a build of R are you using, that 
RPH you need to package /Matrix separately?


No, we were talking about building R from the sources.
That should still be pretty easily possible on any Linux system
{which has compilers/perl/latex/tcltk/  and a couple of libraries}.

Martin
  



--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


[R] Problem building R 2.10.0 - Matrix package

2009-11-02 Thread Thomas Adams

All:

Attached is the output file from building R 2.10.0 on RedHat Linux. I 
have never previously experienced any problems when building R from 
source with new releases. But, now I get a compile error with the Matrix 
package:


CHOLMOD/Include/cholmod.h:87:22: error: UFconfig.h: No such file or 
directory

make[3]: *** [CHMfactor.o] Error 1
make[3]: Leaving directory `/tmp/RtmppKsKKl/R.INSTALL327b23c6/Matrix/src'
ERROR: compilation failed for package 'Matrix'

Any help or suggestions would be appreciated.

I am simply doing this, as I always have:

./configure --prefix=/Local/install/location (I can not use the default)
make

I should add that even with this error with the Matrix package, I can do 
a 'make install' OK. Subsequently, R seems to come up fine from the 
command line…


Regards,
Tom

--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] Temperature Prediction Model

2009-10-22 Thread Thomas Adams

Aneeta,

You will have to have a seasonal component built into your model, 
because the seasonal variation does matter, particularly -where- you are 
geographically (San Diego, Chicago, Denver, Miami are very different). 
Generally, there is a sinusoidal daily temperature variation, but 
frontal passages and thunderstorms, etc., can and will disrupt this nice 
pattern. You may have to tie this into temperature predictions from a 
mesoscale numerical weather prediction model. Otherwise, you will end up 
with lots of misses and false alarms…


Regards,
Tom

Aneeta wrote:

The data that I use has been collected by a sensor network deployed by Intel.
You may take a look at the network at the following website
http://db.csail.mit.edu/labdata/labdata.html

The main goal of my project is to simulate a physical layer attack on a
sensor network and to detect such an attack. In order to detect an attack I
need to have a model that would define the normal behaviour. So the actual
variation of temperature throughout the year is not very important out here.
I have a set of data for a period of 7 days which is assumed to be the
correct behaviour and I need to build a model upon that data. I may refine
the model later on to take into account temperature variations throughout
the year.

Yes I am trying to build a model that will predict the temperature just on
the given time of the day so that I am able to compare it with the observed
temperature and determine if there is any abnormality. Each node should have
its own expectation model (i.e. there will be no correlation between the
readings of the different nodes).


Steve Lianoglou-6 wrote:
  

Hi,

On Oct 21, 2009, at 12:31 PM, Aneeta wrote:



Greetings!

As part of my research project I am using R to study temperature data
collected by a network. Each node (observation point) records  
temperature of

its surroundings throughout the day and generates a dataset. Using the
recorded datasets for the past 7 days I need to build a prediction  
model for

each node that would enable it to check the observed data against the
predicted data. How can I derive an equation for temperature using the
datasets?
The following is a subset of one of the datasets:-

 Time  Temperature

07:00:17.369668   17.509
07:03:17.465725   17.509
07:04:17.597071   17.509
07:05:17.330544   17.509
07:10:47.838123   17.5482
07:14:16.680696   17.5874
07:16:46.67457 17.5972
07:29:16.887654   17.7442
07:29:46.705759   17.754
07:32:17.131713   17.7932
07:35:47.113953   17.8324
07:36:17.194981   17.8324
07:37:17.227013   17.852
07:38:17.809174   17.8618
07:38:48.00011 17.852
07:39:17.124362   17.8618
07:41:17.130624   17.8912
07:41:46.966421   17.901
07:43:47.524823   17.95
07:44:47.430977   17.95
07:45:16.813396   17.95
  

I think you/we need much more information.

Are you really trying to build a model that predicts the temperature  
just given the time of day?


Given that you're in NY, I'd say 12pm in August sure feels much  
different than 12pm in February, no?


Or are you trying to predict what one sensor readout would be at a  
particular time given readings from other sensors at the same time?


Or ... ?

-steve

--
Steve Lianoglou
Graduate Student: Computational Systems Biology
   |  Memorial Sloan-Kettering Cancer Center
   |  Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

__
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, reproducible code.





  



--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] Google's R Style Guide

2009-08-28 Thread Thomas . Adams
Esmail,

Very nice; thanks!

Tom

- Original Message -
From: Esmail esmail...@gmail.com
Date: Friday, August 28, 2009 8:59 am
Subject: [R] Google's R Style Guide

 Perhaps most of you have already seen this?
 
   http://google-styleguide.googlecode.com/svn/trunk/google-r-
 style.html
 Comments/Critiques?
 
 Thanks,
 Esmail
 
 ps: Reminds me of PEP 8 for Python
 
 http://www.python.org/dev/peps/pep-0008/
 
 Maybe not that surprising since Python is also one of the main 
 languages used by Google.
 
 __
 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.htmland provide commented, minimal, self-contained, 
 reproducible code.


__
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, reproducible code.


Re: [R] Wind-data analysis with R?

2009-08-20 Thread Thomas Adams

Oliver,

You may consider looking at the climatol: Some Tools for Climatology 
(http://cran.r-project.org/) contributed package. This may come close to 
what you're looking for. I would suggest using R with GRASS GIS 
(http://grass.osgeo.org/), which is a powerful combination.


Tom

Oliver Bandel wrote:

Hello,

are there people outside who use R for analysis of wind-measurement data
(meteorological or for planning of wind power stations)?

Are there already scripts/modules available for analysing and
displaying/plotting wind data in the way it is done in projection/planning
of wind power stations?

If not, would it be of interest to use R for this, and therefore
adapt data-logger output to R (by providing certain data formats)
or by providing R-modules for parsing of the data-logger files?

Or would that better be done by connection to a RDBMS?

Ciao,
   Oliver

__
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, reproducible code.
  



--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


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

2009-07-29 Thread Thomas . Adams
Stephen,

I don't have anything or know of anything in R to do this. But, we download 
USGS streamflow data routinely. I have a Perl script that will reformat the 
downloaded data into a R-importable format (basically two columns date/time 
flow value). Are you interested in mean daily or instantaneous streamflow data?

Regards,
Tom

- Original Message -
From: stephen sefick ssef...@gmail.com
Date: Wednesday, July 29, 2009 9:03 pm
Subject: [R] USGS stream flow data automatic download R

 I don't even know if this is the right place to ask this question.  I
 would like to download USGS stream gauging data for a couple of gauges
 on a daily basis- save the files to .csv files and append the nest
 days time series to this.  Is there a way to do this automatically in
 R?
 thanks,
 
 -- 
 Stephen Sefick
 
 Let's not spend our time and resources thinking about things that are
 so little or so large that all they really do for us is puff us up and
 make us feel like gods.  We are mammals, and have not exhausted the
 annoying little problems of being mammals.
 
   -K. Mullis
 
 __
 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.htmland provide commented, minimal, self-contained, 
 reproducible code.


__
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, reproducible code.


[R] Plotting a time series

2009-04-01 Thread Thomas Adams

I have data that I read in using:

data-read.table(RAVK2.obs.data,sep=\t)

'data' looks like this:

   V1V2
1  2009-03-25 06:00:00 12.86
2  2009-03-25 12:00:00 12.80
3  2009-03-25 18:00:00 12.76
4  2009-03-26 00:00:00 12.68
5  2009-03-26 06:00:00 12.66
6  2009-03-26 12:00:00 12.64
7  2009-03-26 18:00:00 12.83
8  2009-03-27 00:00:00 13.33
9  2009-03-27 06:00:00 13.84
10 2009-03-27 12:00:00 14.13
11 2009-03-27 18:00:00 14.29
12 2009-03-28 00:00:00 14.41
13 2009-03-28 06:00:00 14.48
14 2009-03-28 12:00:00 14.58
15 2009-03-28 18:00:00 14.75
16 2009-03-29 00:00:00 15.02
17 2009-03-29 06:00:00 15.40
18 2009-03-29 12:00:00 15.88
19 2009-03-29 18:00:00 16.50
20 2009-03-30 00:00:00 16.77
21 2009-03-30 06:00:00 16.73
22 2009-03-30 12:00:00 16.55
23 2009-03-30 18:00:00 16.31
24 2009-03-31 00:30:00 16.04
25 2009-03-31 06:00:00 15.80
26 2009-03-31 12:00:00 15.65
27 2009-03-31 18:00:00 15.53
28 2009-04-01 00:00:00 15.39
29 2009-04-01 06:00:00 15.20
30 2009-04-01 12:00:00 15.00

when I use plot(data) the plot looks fine except that the plot symbols 
are broken horizontal lines. How do I change the plot symbol? I have tried:


plot(data, type=p)

and I get the same result.

Thanks,
Tom

--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] popular R packages

2009-03-07 Thread Thomas Adams
I don't think At least one of the participants in the 2004 thread 
suggested that it would be a good thing to track the numbers of 
downloads by package. is reasonable because I download R packages for 2 
home computers (laptop  desktop) and 2 at work (1 Linux  1 Mac). There 
must be many such cases…


Tom

David Winsemius wrote:
When the question arises How many R-users there are?, the consensus 
seems to be that there is no valid method to address the question. The 
thread R-business case from 2004 can be found here:

https://stat.ethz.ch/pipermail/r-help/2004-March/047606.html

I did not see any material revision to that conclusion during the 
recent discussion of the New York Times article on the r-challenge to 
SAS.


Gmane tracks the number of r-help activity (I realize not what you 
asked for):

http://www.gmane.org/info.php?group=gmane.comp.lang.r.general

The distribution of r-packages is, well ... distributed:
http://cran.r-project.org/mirrors.html

At least one of the participants in the 2004 thread suggested that it 
would be a good thing to track the numbers of downloads by package. 
I have not heard of any such system being installed in the mirror 
software and I see nothing that suggests data gathering in the CRAN 
Mirror How-to:

http://cran.r-project.org/mirror-howto.html

On the other hand I am not part of R-core, so you must await more 
authoritative opinion since a 5 year-old thread and amateur 
speculation is not much of a leg to stand on.


There are lexicographic packages for R. One approach to a de novo 
analysis would be to do some sort of natural language analysis of the 
r-help archives counting up either package names with non-English 
names or close proximity of the words library or package to 
package names that overlap the 30,000 common English words. That would 
have the danger of inflating counts of the packages with the least 
adequate documentation or a paucity of good worked examples, but there 
are many readers of this list who suspect that new users don't look at 
the documentation, so who knows?





--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] The Origins of R

2009-02-04 Thread Thomas Adams

Rolf,

Yes, that's what I was referring to as well…

Cheers!
Tom

Rolf Turner wrote:


On 4/02/2009, at 8:15 PM, Mark Difford wrote:




Indeed. The postings exuded a tabloid-esque level of slimy nastiness.


Indeed, indeed. But I do not feel that that is necessarily the case. 
Credit
should be given where credit is due. And that, I believe is the issue 
that
is getting (some) people hot and bothered. Certainly, Trevor Hastie 
in his

reply to the NY Times article, was not too happy with this aspect of the
story.

Granted, his comments were not made on this list, but the objection is
essentially the same. I would not call what he had to say Mischief 
making

or smacking of a tabloid-esque level of slimy nastiness. The knee-jerk
reaction seems to be that this is a criticism of R. It is not. It is a
criticism of a poorly researched article.

It also is an undeniable and inescapable fact that most S code runs 
in R.


The problem is not with criticism of the NY Times article, although as 
Pat

Burns and others have pointed out this criticism was somewhat misdirected
and unrealistic considering the exigencies of newspaper editing. The 
problem

was with a number of posts that cast aspersions upon the integrity of
Ihaka and Gentleman. It is these posts that exuded tabloid-esque slimy
nastiness.

I am sure that Ross and Robert would never dream of failing to give 
credit
where credit is due and it is almost certainly the case that they 
explained
the origins of R in the S language to the writer of the NYT article 
(wherefrom

the explanation was cut in the editing process).

Those of us on this list (with the possible exception of one or two 
nutters)
would take it that it goes without saying that R was developed on the 
basis
of S --- we all ***know*** that. To impugn the integrity of Ihaka and 
Gentleman,
because an article which *they didn't write* failed to mention this 
fact, is

unconscionable.

cheers,

Rolf Turner

##
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

__
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, reproducible code.



--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] The Origins of R

2009-02-03 Thread Thomas Adams

John,

I certainly had that same impression of mischief making — I would call 
it trolling with the intent of trying to discredit R, its developers  
contributors. Mischief making indeed!


Regards,
Tom

John Maindonald wrote:
In another thread on this list, various wild allegations have been 
made, relating to the New York Times article on R.  I object both to 
the subject line and to the content of several of the messages, and 
will not repeat or quote any of that content.  It smacks to me of 
mischief making.


Discussion has centered around the following quote from the NY Times 
article:
“According to them, the notion of devising something like R sprang up 
during a hallway conversation. They both wanted technology better 
suited for their statistics students, who needed to analyze data and 
produce graphical models of the information. Most comparable software 
had been designed by computer scientists and proved hard to use.”
The comment that the notion of devising something like R sprang up 
during a hallway conversation is strictly true.  Certainly, this 
seems like a very plausible account.  I'd have more difficulty 
believing that the notion was communicated to them in separate 
dreams.  Part of the wanted technology was freedom for students to 
take the software home, or copy it down from the web.
There was a further story to be told, about the origins of the 
language that Ross and Robert implemented and adapted.  The NY writer 
pretty much left out that part of the story (S did get a mention, but 
its connection with R did not), but did remedy this omission in a 
follow-up.
Nor did the article do much to acknowledge the workers and work that 
has gone into R's continuing development. Getting the attributions 
right is difficult.  Even if right according to common conventions 
(and one can argue as to just what the conventions are, especially in 
the matter of computer language development), they are unlikely to be 
totally fair.  Stigler's Law of Eponomy has wide sway!


In the preface to the first and second edition of Data Analysis and 
Graphics Using R, we have:
The R system implements a dialect of the S language that was 
developed at ATT Bell Laboratories by Rick Becker, John Chambers and 
Allan Wilks.
The only 1st edition attribution to Ihaka and Gentleman was in Chapter 
12: For citing R in a publication, use Ihaka and Gentleman (1996).  
[NB: Type citation() to see the form of citation that should now be 
used.]
That was as it now strikes me unfair to Ross and Robert, but no-one 
complained.  Perhaps no-one ever read that far through the preface!


There's an excellent brief summary of the history of R, and its 
connections with S, in Section 1.4 of John Chambers' Software for 
Data Analysis.Appendix A has further details on the development 
of S, a kind of pre-history of R.


John Maindonald email: john.maindon...@anu.edu.au
phone : +61 2 (6125)3473fax  : +61 2(6125)5549
Centre for Mathematics  Its Applications, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.

__
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, reproducible code.



--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] R in the NY Times

2009-01-07 Thread Thomas Adams

Wacek,

One would hope that if someone were to use software to build engines 
for aircraft, that said person would sufficiently test the software to 
have confidence in it, whether it had a Warranty or not — at least 
that's my mode of operation…


Cheers!
Tom

Wacek Kusnierczyk wrote:

Kevin E. Thorpe wrote:
  

Zaslavsky, Alan M. wrote:


SAS says it has noticed R’s rising popularity at universities,
despite educational discounts on its own software, but it dismisses
the technology as being of interest to a limited set of people
working on very hard tasks.

“I think it addresses a niche market for high-end data analysts that
want free, readily available code, said Anne H. Milley, director of
technology product marketing at SAS. She adds, “We have customers who
build engines for aircraft. I am happy they are not using freeware
when I get on a jet.”

  

Thanks for posting. Does anyone else find the statement by SAS to be
humourous yet arrogant and short-sighted?



there must be something wrong with me, but i can't find anything
'humorous yet arrogant and short-sighted' in the idea that engines for
aircraft be built with software that does not advertise itself with
'ABSOLUTELY NO WARRANTY.'


vQ

__
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, reproducible code.
  



--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  thomas.ad...@noaa.gov

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


Re: [R] Boxplot 5% and 95% quantile instead of 25% and 75%

2008-08-21 Thread Thomas Adams

Joris,

I found this (http://ceae.colorado.edu/~balajir/r-session-files/) on the web. 
It will do exactly what you want. Get the files:

myboxplot-stats.r
myboxplot.r
Leesferry-mon-data.txt = example data

The usage is:

#Boxplots 

#Source the ‘myboxplot’ codes from Balaji’s directory. 
source(myboxplot-stats.r) 
source(myboxplot.r) 

#Define Variable flow3 
flow3=as.data.frame(flow2) 

#Only one graph per page: 
par(mfrow=c(1,1)) 

#For 12 months all on one graph: 
xs=1:12 
zz=myboxplot(split(t(flow3),xs),plot=F,cex=1.0) 
zz$names=rep( ,length(zz$names)) 
z1=bxp(zz,ylim=range(flow3,zmean),xlab=Month,ylab=Monthly Streamflow (cms),axes=F) 
box() 
axis(1,at=z1,labels=months) 
axis(2) 
points(z1,zmean,lty=1,lwd=2, col=red) 
title(main=”Monthly Boxplots of Streamflow”) 

I hope this helps. I have a complete example for data I am using if you 
need something more complete.


Regards,
Tom

Joris Meijerink wrote:

Hi,

I'm new to the whole R-thing as a replacement for Matlab, not disappointed 
sofar ;)

I found out how to make nice looking boxplots, but i also would like the make a 
boxplot with 5% and 95% instead of the standard 25 and 75% quantiles.

My csv input looks something like:
LOCATIONFILTER NR   DATEVALUE   MONTH
Peelhorst01 1   14-Jan-94   23.07   1
Peelhorst01 1   28-Jan-94   23.68   1
Peelhorst01 1   14-Feb-94   23.38   2
Peelhorst01 1   28-Feb-94   23.27   2
Peelhorst01 1   14-Mar-94   23.25   3
Peelhorst01 1   28-Mar-94   23.69   3
Peelhorst01 1   14-Apr-94   23.63   4
Peelhorst01 1   28-Apr-94   23.34
Peelhorst01 1   14-May-94   23.14   5
Peelhorst01 1   28-May-94   23.09   5
Peelhorst01 1   14-Jun-94   23.06   6
Peelhorst01 1   28-Jun-94   22.86   6
Peelhorst01 1   14-Jul-94   22.63   7
Peelhorst01 1   28-Jul-94   22.48   7
Peelhorst01 1   14-Aug-94   22.35   8
Peelhorst01 1   28-Aug-94   22.27   8
Peelhorst01 1   14-Sep-94   22.21   9
Peelhorst01 1   28-Sep-94   22.27   9
Peelhorst01 1   14-Oct-94   22.33   10
Peelhorst01 1   28-Oct-94   22.28   10
Peelhorst01 1   14-Nov-94   22.37   11
Peelhorst01 1   28-Nov-94   22.49   11
Peelhorst01 1   14-Dec-94   22.56   12
Peelhorst01 1   28-Dec-94   22.62   12

going on for 13 more years

I used the following to produce a boxplot:
z - boxplot(VALUE ~ MONTH, data = reeks,
  plot = FALSE
)

Then I replace the numbers of the month in jan, feb etc. with
z$names - 
c('jan','feb','mrt','apr','mei','jun','jul','aug','sep','okt','nov','dec')
and make the boxplot with the bxp function.

Now I was thinking of using the same sollution by replacing row 2 and 4 in 
z$stats with the results of the quantile function for 5% and 95% but to be able 
to calculate that I need the vectors of only 1 month without the other months. 
How can i do that, or is there even a better/easier sollution to my problem?

kind regards
Joris

--
DISCLAIMER:\ This e-mail is strictly confidential and is...{{dropped:16}}

__
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, reproducible code.
  



--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  [EMAIL PROTECTED]

VOICE:  937-383-0528
FAX:937-383-0033

__
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, reproducible code.


  1   2   >