respR
integrates nicely in the tidyverse, specifically with dplyr
functions e.g. select()
, filter()
and mutate()
, and magrittr
pipe operators (“%>%
”) to clearly express workflows in an organised sequence. For more information about using pipes in particular, see the “Pipes” chapter in the online R for Data Science book.
Here we show how using %>%
pipes can make data analysis worklows simpler for the user.
Typical analysis using regular R
syntax:
# 1. check data for errors, select cols 1 and 15:
urch <- inspect(urchins.rd, 1, 15)
# 2. automatically determine linear segment:
rate <- auto_rate(urch)
# 3. convert units
out <- convert_rate(rate, "mg/l", "s", "mg/h/kg", 0.6, 0.4)
Alternatively, use tidyverse
pipes:
urchins.rd %>% # using the urchins dataset,
select(1, 15) %>% # select columns 1 and 15
inspect() %>% # inspect the data, then
auto_rate() %>% # automatically determine most linear segment
convert_rate("mg/l", "s", "mg/h/kg", 0.6, 0.4) # convert units