analyze and visualize batscope data
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R
data
man
.gitignore
DESCRIPTION
LICENCE
NAMESPACE
README.md

README.md

batplotR - BatScope Data Visualization in R

About batplotR

batplotR is a R package to visualize data generated with BatScope and allows simple visualization of short (one night) and long (many nights) time-series of ultrasound calls recorded with a BatLogger. All you need is a Excel file export from BatScope. Most functions can be accessed from within a Shiny web-app.

How to install

To install batplotr you need the devtoolspackage which can be installed from CRAN. Once installed you can run the following code to get the latest version batplotr:

library(devtools)
install_github("dcangst/batplotr")

or to get a specific version:

library(devtools)
install_github("dcangst/batplotr", ref="v0.1")

Standalone Shiny Web App

The package includes the function shiny_batPlots(). It launches a shiny web app that replicates most futures of the package in a web app. For ease of use you can set up a script to launch the web app directly from your computer.

Mac OS / probably other UNIX systems (tested in MacOSX 10.10.3 only)

Paste the following code into a plain text file with extension '.command'

#!/usr/bin/Rscript

if("batplotr" %in% rownames(installed.packages())){
  tryCatch(suppressMessages(batplotr::github_update("batplotr","dcangst/batplotr")),error=function(Cond){devtools::install_github("dcangst/batplotr",dependencies=TRUE)})
} else {
  if("devtools" %in% rownames(installed.packages())){
    devtools::install_github("dcangst/batplotr",dependencies=TRUE)
  } else {
    install.packages(c("devtools"),dependencies=TRUE)
    devtools::install_github("dcangst/batplotr",dependencies=TRUE)
  }
}

suppressMessages(library(batplotr))
shiny_batPlots()

The file then needs to be made executable, which you can do in the terminal using the following command:

chmod +x /path/to/shellfile.command

(you can drag and drop the file into the terminal so you don't have to type the path). This Script will install and or update all necessary components and launch the shiny web app.

Windows

the easiest way on windows is to follow the instructions on this page: http://www.r-datacollection.com/blog/Making-R-files-executable/ and use the following R-Script:

devtools::install_github("dcangst/batplotr",dependencies=TRUE)
suppressMessages(library(batplotr))
shiny_batPlots()

This will install batplotr and launch the web app. (Unfortunately the above version does not work on Windows)

Usage in R

see ?batplotr for more information on the individual functions. for simple plots run this example using a .xlsx generated by BatScope Export

batScopeData <- readBatscopeXLSX()
batScopeData_sum <- sumBatscopeData()
nightPlot(batScopeData_sum)
periodPlot(batScopeData_sum)

ther is also a detailed manual here, but unfortunately in German only.