On Thu, May 12, 2016, at 22:49, Josh B wrote:
> Example of aother R code giving me errors... codes are provided below.
I'm replying to this on the motus list; if people feel there's too much
of this kind of traffic here, we could start another list.
You didn't convert REEDS$ts to POSIXct, as you did for tides$ts,
and read.csv() has left it as a factor.
J.
P.S. Not sure how you're pasting code into messages, but it's getting
marked up with "*" (indicating bold?) which confuses things a bit.
> require(lubridate)
> require(plyr)
> require(ggplot2)
> library(sensorgnome)
> install.packages("XML")
> require(ggmap)
> require(data.table)
> require(gridExtra)
> require(dplyr)
>
> *##Download Reeds Beach Tag Data*
> REEDS<-read.csv("2014_alltags.csv",header=TRUE)
>
> *##Download Tidal Data*
> tides<-read.csv("Tidal Data.csv")
>
> *##Subset Tide/rename*
> tides<-subset(tides,select=c("Date.Time","Water.Level","Sigma"))
> tides<-rename(tides,ts=Date.Time, w.level=Water.Level)
>
> tides$ts<-as.POSIXct(tides$ts)
> del<-subset(REEDS,site%in%c("REEDS"))
>
> del<-subset(del, select=c(fullID, site, lat, lon, ant, ts))
>
> *##Make Map of Site*
> del.map<-get_map(location=c(lon= -75, lat=39),
> maptype="terrain",source="google",zoom=9)
> ggmap(del.map)+geom_point(data=del, aes(lon, lat, size=3, group=site,
> col=site))
>
> *##Rounding Tide Data to nearest 6min interval to join with
> detection data*
> *del.tide<-del*
> del.tide$ts<-round_any(del.tide$ts, 360)
>
> > del.tide$ts<-round_any(del.tide$ts, 360)
> Error in UseMethod("round_any") :
> no applicable method for 'round_any' applied to an object of class
> "factor"
>
> I'm lost as to why it won't let me round the ts column. The
> only thing I
> can think of is the date is also in the ts column (see below for
> example).
> Could this be throwing it all off? I want to join the tide data to the
> detection data, but before I can do that the ts need to be in the
> same time
> intervals (6min). Any ideas? Your help is much appreciated. Thank you.
>
> *example of ts column:*
> 2014-05-23 11:07:47
>
> *Joshua N. Barth*
> M.S. Student
> Environmental Science
> Graduate Assistant
> Wesley College
> 120 North State Street
> Dover, DE 19901
>
> c:
(910) 320-4735
>
jbart...@gmail.com
>
>
>
>
>
>
> On Thu, May 12, 2016 at 10:51 AM, john brzustowski
> <
jbrz...@fastmail.fm>