Skip to content

Commit

Permalink
version 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Bauer authored and cran-robot committed Mar 24, 2017
1 parent c926866 commit 23825bc
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 18 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -0,0 +1,5 @@
RchivalTag versions

RchivalTag_0.0.2 -- March 22, 2017 (Robert Bauer)
- small bug in hist_tad/hist_tat functions fixed
- adding example on back-to-back histogram for day vs night TaD-data (see: ?hist_tad)
8 changes: 4 additions & 4 deletions DESCRIPTION
@@ -1,8 +1,8 @@
Package: RchivalTag
Type: Package
Title: Analyzing Archival Tagging Data
Version: 0.0.1
Date: 2017-03-20
Version: 0.0.2
Date: 2017-03-22
Author: Robert Bauer
Maintainer: Robert Bauer <robert.bauer@ird.fr>
Description: A set of functions to generate, access and analyze standard data products from archival tagging data.
Expand All @@ -11,7 +11,7 @@ Imports: plyr, akima, maptools, graphics, stats, raster, rgeos, ncdf4,
maps, mapdata, grDevices, oceanmap, sp, methods, PBSmapping
License: CC BY-NC-SA 4.0
LazyLoad: yes
Packaged: 2017-03-21 09:28:11 UTC; robert
Packaged: 2017-03-24 18:02:44 UTC; robert
Repository: CRAN
Date/Publication: 2017-03-21 15:20:26 UTC
Date/Publication: 2017-03-24 19:07:25 UTC
NeedsCompilation: no
17 changes: 9 additions & 8 deletions MD5
@@ -1,10 +1,11 @@
c28cb13ebc4fbb1df366c8e538aea8e1 *DESCRIPTION
f21d4892b5423153dfd9779fe78baa10 *ChangeLog
b77853cad60e51624f87ea04db3e2bb3 *DESCRIPTION
8b43c3895e01857f02fedd5ed61ff8a3 *NAMESPACE
3e611abed9a9cac153c07f2681682a8e *R/bin_TempTS.r
4496a3299a5b651e488ff184fb363094 *R/get_DaytTimeLimits.r
5a9b700d9095f7dabdb593f7ceef78fc *R/get_thermalstrat.r
d0238a97d31e3bc0bb39758ffea3a359 *R/hidden_functions.r
75c153561406b2fc85838be932a5900d *R/hist_tad.r
ac03eff18ad7382bce1a16ef3e447dfa *R/hist_tad.r
983d14437b0aabbcaba53a1669868b7d *R/image_TempDepthProfiles.r
2488fc005f517758e20112941f5bbcaa *R/interpolate_TempDepthProfiles.r
3f4dd32dc5378d04c152e1d89c4f2800 *R/plot_TS.r
Expand All @@ -14,7 +15,7 @@ a64d0ede8100a59f1bd71108932d4c30 *R/plot_geopos.r
ee79db69ed156d837cfb299d11475653 *R/read_histos.r
57d180cfc03aa9be75938c0f018ef197 *R/tad_summary.r
976cabc1b75f6dbea28566ad6cfa031c *R/ts2histos.r
ae93e1e353b6fd7ce811ff8b44212f64 *inst/doc/RchivalTag.pdf
9544216ac9dfc9c625c8ef7fa1f5a6e9 *inst/doc/RchivalTag.pdf
5ed8535044dcec09af091dca0617ac41 *inst/example_files/104659-Histos.csv
14919538772cfbcc8dde94b889ede6f9 *inst/example_files/104659-PDTs.csv
ec53f903951050e6c4f96a0b7be076b8 *inst/example_files/104659-Series.csv
Expand All @@ -24,18 +25,18 @@ ec53f903951050e6c4f96a0b7be076b8 *inst/example_files/104659-Series.csv
17ec587e2ccd909540cb761cac3c267c *inst/example_files/15P1019-104659-1-GPE3.nc
091f7f38953b7f084ee750e93d97b978 *man/RchivalTag.Rd
328353bb9a7cc8f29c0078f5ea8a85bb *man/bin_TempTS.Rd
3310f1e72fedf454cedb0f944f2282e1 *man/classify_DayTime.Rd
8fbcb76a6fac0d2643d6aa7c0db38d33 *man/classify_DayTime.Rd
4b01620123bacb718d7543dab21a8734 *man/combine_histos.Rd
1463031ac752cc657542d708e9e7bfef *man/get_DayTimeLimits.Rd
f979938df6f52db266c41491f8e65e03 *man/get_thermalstrat.Rd
ca8dd355686d7597c88afea4fe7ed4c0 *man/hist_tad.Rd
a42873b0e3a6bde221d987242f72f4e5 *man/hist_tat.Rd
fa3b7ffb000adad1753f9538c59f55df *man/hist_tad.Rd
6ad3f7777d9b2c2f65d353e258a70af7 *man/hist_tat.Rd
502c3b2d3a0f7679e23191b4054c72ee *man/image_TempDepthProfiles.Rd
9037e0a4076a8aa9f8dfbd8fc563efb3 *man/interpolate_TempDepthProfiles.Rd
8fad25981fae098bc1b4760e7b8709c0 *man/merge_histos.Rd
e4a4857d2d9b80ec016faae515d881f7 *man/plot_TS.Rd
05d8b6e6538acd960c4015322dac7059 *man/plot_geopos.Rd
3f96d82782905a5d9f87894034ab6e92 *man/plot_geopos.Rd
948318f09b613af552f4d887f67a794a *man/read_PDT.Rd
4ff61484a4a2ecfb0264d10b1933e6d1 *man/read_histos.Rd
aaf50a330671dd46328f1451b7100baf *man/ts2histos.Rd
cf2de73b343be4014402c023a8fb54a2 *man/ts2histos.Rd
1e725d644d978f8637cd1e90c560bbe2 *man/unmerge_histos.Rd
3 changes: 1 addition & 2 deletions R/hist_tad.r
Expand Up @@ -187,7 +187,7 @@ hist_tad <- function(df,

xticks <- pretty(xlim)
xlabels <- abs(xticks)
ylabels <- rev(bin_prefix)
ylabels <- rev(bin_breaks)
# if(!labeling){
# xlabels <- rep('', length(xlabels))
# ylabels <- rep('', length(ylabels))
Expand All @@ -203,7 +203,6 @@ hist_tad <- function(df,
axis(2, pos=xlim[1]+yaxis.pos, at=(0.5:(ncol(raw)-0.5)), lwd="", labels=ylabels2a, las=1)

}else{

axis(2, pos=xlim[1]+yaxis.pos, at=(0:ncol(raw)), c("", ylabels), las=1)
}

Expand Down
Binary file modified inst/doc/RchivalTag.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions man/classify_DayTime.Rd
Expand Up @@ -55,6 +55,21 @@ get_DayTimeLimits(pos)
#### example 1b) classify current ime of the day in Mainz, Germany:
classify_DayTime(get_DayTimeLimits(pos))
## convert 1c) back-to-back histogram showing day vs night TAD frequencies:
### load sample depth and temperature time series data from miniPAT:
ts_file <- system.file("example_files/104659-Series.csv",package="RchivalTag")
ts_df <- read.table(ts_file, header = TRUE, sep = ",")
tad_breaks <- c(0, 2, 5, 10, 20, 50, 100, 200, 300, 400, 600, 2000)
ts_df$Lat <- 4; ts_df$Lon=42.5 ## required geolocations to estimate daytime
ts_df$date.long <- strptime(paste(ts_df$Day,ts_df$Time),"\%d-\%B-\%Y \%H:\%M:\%S")
head(ts_df)
ts_df2 <- classify_DayTime(get_DayTimeLimits(ts_df)) # estimate daytime
head(ts_df2)
ts2histos(ts_df2, tad_breaks = tad_breaks,split_by = "daytime")
hist_tad(ts_df2, bin_breaks = tad_breaks,split_by = "daytime", do_mid.ticks = FALSE)
}
14 changes: 13 additions & 1 deletion man/hist_tad.Rd
Expand Up @@ -68,7 +68,7 @@ a vector defining the limits (x1,x2) of the x-axis, by default c(0,100). However
}

\item{split_by}{
Name of the logical vector by which TaD data should be splitted (e.g. day.time).
Name of the logical vector by which TaD data should be splitted (e.g. daytime; see \link{classify_DayTime}).
}

\item{split_levels, xlab2}{
Expand Down Expand Up @@ -161,6 +161,17 @@ hist_tat(tat$TAT$merged, do_mid.ticks = FALSE)
## convert 1c) DepthTS & TemperatureTS data to daily TAD & TAT frequencies:
ts2histos(ts_df, tad_breaks = tad_breaks, tat_breaks = tat_breaks)

## convert 1d) back-to-back histogram showing day vs night TAD frequencies:
ts_df$Lat <- 4; ts_df$Lon=42.5 ## required geolocations to estimate daytime
ts_df$date.long <- strptime(paste(ts_df$Day,ts_df$Time),"\%d-\%B-\%Y \%H:\%M:\%S")
head(ts_df)
ts_df2 <- classify_DayTime(get_DayTimeLimits(ts_df)) # estimate daytime
head(ts_df2)

ts2histos(ts_df2, tad_breaks = tad_breaks,split_by = "daytime")
hist_tad(ts_df2, bin_breaks = tad_breaks,split_by = "daytime", do_mid.ticks = FALSE)


## example 2) rebin daily TAD frequencies:
tad <- ts2histos(ts_df, tad_breaks = tad_breaks)
tad2 <- rebin_histos(hist_list = tad, tad_breaks = tad_breaks[c(1:3,6:12)])
Expand All @@ -169,6 +180,7 @@ hist_tad(tad, do_mid.ticks = FALSE) ## example for multiple individuals
hist_tad(tad$TAD$merged, do_mid.ticks = FALSE)
hist_tad(tad$TAD$merged, bin_breaks = tad_breaks[c(1:3,6:12)]) ## from inside hist_tad


## example 3) read, merge and plot TAD frequency data from several files:
## part I - read histogram data from two files:
hist_dat_1 <- read_histos(system.file("example_files/104659-Histos.csv",package="RchivalTag"))
Expand Down
14 changes: 13 additions & 1 deletion man/hist_tat.Rd
Expand Up @@ -66,7 +66,7 @@ a vector defining the limits (x1,x2) of the x-axis, by default c(0,100). However
}

\item{split_by}{
Name of the logical vector by which TaD data should be splitted (e.g. day.time).
Name of the logical vector by which TaD data should be splitted (e.g. daytime; see \link{classify_DayTime}).
}

\item{split_levels, xlab2}{
Expand Down Expand Up @@ -157,6 +157,17 @@ hist_tat(tat$TAT$merged, do_mid.ticks = FALSE)
## convert 1c) DepthTS & TemperatureTS data to daily TAD & TAT frequencies:
ts2histos(ts_df, tad_breaks = tad_breaks, tat_breaks = tat_breaks)

## convert 1d) back-to-back histogram showing day vs night TAD frequencies:
ts_df$Lat <- 4; ts_df$Lon=42.5 ## required geolocations to estimate daytime
ts_df$date.long <- strptime(paste(ts_df$Day,ts_df$Time),"\%d-\%B-\%Y \%H:\%M:\%S")
head(ts_df)
ts_df2 <- classify_DayTime(get_DayTimeLimits(ts_df)) # estimate daytime
head(ts_df2)

ts2histos(ts_df2, tad_breaks = tad_breaks,split_by = "daytime")
hist_tad(ts_df2, bin_breaks = tad_breaks,split_by = "daytime", do_mid.ticks = FALSE)


## example 2) rebin daily TAD frequencies:
tad <- ts2histos(ts_df, tad_breaks = tad_breaks)
tad2 <- rebin_histos(hist_list = tad, tad_breaks = tad_breaks[c(1:3,6:12)])
Expand All @@ -165,6 +176,7 @@ hist_tad(tad, do_mid.ticks = FALSE) ## example for multiple individuals
hist_tad(tad$TAD$merged, do_mid.ticks = FALSE)
hist_tad(tad$TAD$merged, bin_breaks = tad_breaks[c(1:3,6:12)]) ## from inside hist_tad


## example 3) read, merge and plot TAD frequency data from several files:
## part I - read histogram data from two files:
hist_dat_1 <- read_histos(system.file("example_files/104659-Histos.csv",package="RchivalTag"))
Expand Down
2 changes: 1 addition & 1 deletion man/plot_geopos.Rd
Expand Up @@ -85,7 +85,7 @@ plot_geopos(csv_file, add=TRUE) ## show tracks as scatter plot
## example 2) probability surfaces of horizontal tracks from nc-file:
## this can take some time as it inlcudes time consuming data processing
nc_file <- system.file("example_files/15P1019-104659-1-GPE3.nc",package="RchivalTag")
plot_geopos(nc_file)
# plot_geopos(nc_file)

}

13 changes: 12 additions & 1 deletion man/ts2histos.Rd
Expand Up @@ -31,7 +31,7 @@ a numeric vector, defining the depth and/or temperature breakpoints of the histo
}

\item{split_by}{
Name of the logical vector by which TaD/TaT data shall be splitted (e.g. day.time).
Name of the logical vector by which TaD/TaT data shall be splitted (e.g. daytime; see \link{classify_DayTime}).
}

\item{aggregate_by}{
Expand Down Expand Up @@ -72,6 +72,17 @@ hist_tat(tat$TAT$merged, do_mid.ticks = FALSE)
## convert 1c) DepthTS & TemperatureTS data to daily TAD & TAT frequencies:
ts2histos(ts_df, tad_breaks = tad_breaks, tat_breaks = tat_breaks)

## convert 1d) back-to-back histogram showing day vs night TAD frequencies:
ts_df$Lat <- 4; ts_df$Lon=42.5 ## required geolocations to estimate daytime
ts_df$date.long <- strptime(paste(ts_df$Day,ts_df$Time),"\%d-\%B-\%Y \%H:\%M:\%S")
head(ts_df)
ts_df2 <- classify_DayTime(get_DayTimeLimits(ts_df)) # estimate daytime
head(ts_df2)

ts2histos(ts_df2, tad_breaks = tad_breaks,split_by = "daytime")
hist_tad(ts_df2, bin_breaks = tad_breaks,split_by = "daytime", do_mid.ticks = FALSE)


## example 2) rebin daily TAD frequencies:
tad <- ts2histos(ts_df, tad_breaks = tad_breaks)
tad2 <- rebin_histos(hist_list = tad, tad_breaks = tad_breaks[c(1:3,6:12)])
Expand Down

0 comments on commit 23825bc

Please sign in to comment.