knitr::opts_chunk$set(echo = TRUE, cache = TRUE, message = FALSE, warning = FALSE)
(this is a small snippet of a data processing nightmare)
gps.dir <- "data/SonoranPronghorn/Locations_GPSCollarTelemetry/" pronghorn <- read.csv(paste0(gps.dir,f.v1[i])) %>% processRaw_v1(id = id.v1[i], filename = f.v1[i]) pronghorn.sf <- st_as_sf(df.raw, coords = c("ECEF_X..m.","ECEF_Y..m.","ECEF_Z..m.")) %>% st_set_crs(4978) %>% st_transform(4326) %>% st_coordinates with(df.raw, data.frame( File = filename, ID = CollarID, DateTime = mdy_hms(paste(UTC_Date, UTC_Time)), Latitude = ll[,"Y"], Longitude = ll[,"X"], Elevation = ll[,"Z"])) %>% subset(!is.na(DateTime))
require(pronghorn) data("pronghorn_gps") str(pronghorn_gps)
require(pronghorn) data("pronghorn_gps") str(pronghorn_gps[,-1])
R
folder contains codedata
folder contains data - as .rda
man
folder contains documentation DESCRIPTION
- file contains essential infoNAMESPACE
- complicated file (mainly automated)DESCRIPTION
filePackage: pronghorn Type: Package Title: Sonoran pronghorn analysis project Version: 0.1.0 Author: Elie, Nicky, others Maintainer: The package maintainer <yourself@somewhere.net> Description: The pronghorn package is a PRIVATE collaborative package containing processed data, code and results for analysis of sonoran pronghorn. License: PRIVATE Encoding: UTF-8 LazyData: false Depends: lubridate, magrittr, plyr, dplyr, ggplot2, ggpubr, sp, sf, stringr Suggests: mapview RoxygenNote: 7.1.1
Streamlines documentation by turning "comments" into help files.
Need to install roxugen2
package and fiddle with some "build" settings.
#' GPS data of Sonoran pronghorn #' #' 43 GPS collared pronghorn collared between 2008 and 2020 #' #' @usage #' data(pronghorn_gps) #' #' @format Contains only five columns: #' \describe{ #' \item{File}{Original file name} #' \item{ID}{ID of animal} #' \item{DateTime}{Date and time in POSIXct} #' \item{Longitude,Latitude}{} #' } #' @example #' examples/pronghorn_gps_examples.R #' @source Unclear. Arizona DFG? Anyways - via Andy Goodwin. #' @keywords data
By hand
base::package.skeleton()
usethis::create_package()
build directly off of existing GitHub project
David provided some code and a function ...
Bernardo will walk us through building a package from "scratch" ...
git
and Github
Version control - a system to track and organize all progress on a project. Mainly ... programming and coding projects. Facilitates project management.
git
(most common tool) runs locally, and tracks all the changes, via command line or a GUI.
GitHub
(or GitLab
or bitbucket
)git
repository and upload to GitHub
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.