library(mosaic)
## Registered S3 method overwritten by 'mosaic':
## method from
## fortify.SpatialPolygonsDataFrame ggplot2
##
## The 'mosaic' package masks several functions from core packages in order to add
## additional features. The original behavior of these functions should not be affected by this.
##
## Attaching package: 'mosaic'
## The following objects are masked from 'package:dplyr':
##
## count, do, tally
## The following object is masked from 'package:Matrix':
##
## mean
## The following object is masked from 'package:ggplot2':
##
## stat
## The following objects are masked from 'package:stats':
##
## binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test,
## quantile, sd, t.test, var
## The following objects are masked from 'package:base':
##
## max, mean, min, prod, range, sample, sum
as_daily_income <- function(yearly_income, duration) {
yearly_income/duration
}
as_daily_income(20000000, 365)
## [1] 54794.52
drug_remaining <- function(dose, duration, time_constant) {
dose * exp(-duration / time_constant)
}
t = 0;20
## [1] 20
plotFun(drug_remaining(dose = 100, time_constant = 4, duration = t) ~ t, t.lim = range(0, 20))
