Commit 079237dc authored by Jean-Marie Lepioufle's avatar Jean-Marie Lepioufle
Browse files

update readme

parent 8094cf75
......@@ -2,10 +2,12 @@
## Description
Compute basic statistics on a tbl_friendlyts table:
1. Mean, standard-deviation, IQR. min, max,...
2. On different groups: year, month, weekday, hour,minute, second.
Basic information from a tbl_friendlyts data.frame.
- Mean, standard-deviation, IQR. min, max,... on different groups: year, month, weekday, hour, minute, second.
- Timeseries of basic information.
- L-moments.
- Plots.
## Installation
......@@ -16,13 +18,15 @@ devtools::install_git("https://git.nilu.no/rdiagnosis/basicr.git")
```
## Usage
### get 'weather' dataset from 'nycflights13'
### Basic analysis on 'weather' from 'nycflights13' package.
#### get dataset
```R
#install.packages("nycflights13")
library(nycflights13)
data(weather)
# There are some duplicated rows, I assume there were a maximum of 2 stations for each location.
# There are some duplicated rows, I assume there were a maximum of 2 stations.
varnames <- setdiff(names(weather), c("year", "month", "day", "hour","time_hour"))
dup <- weather %>% select('origin':'hour') %>% duplicated %>% as.numeric
......@@ -34,63 +38,62 @@ tmp <- tmp %>%
tidyr::gather('variable', 'value', -c('dup','origin','time_hour')) %>%
tidyr::unite('var_tmp', 'origin','dup','variable') %>%
tidyr::spread('var_tmp', 'value')
```
### 'weather' as friendlyts
#### 'weather' as friendlyts
```R
# 'weather' as friendlyts
# devtools::install_git("https://git.nilu.no/rfriendlyts/friendlyts.git")
devtools::install_git("https://git.nilu.no/rfriendlyts/friendlyts.git")
tmp <- friendlyts::friendlyts(df=tmp,date_col="time_hour",date_type="posixlt",tzone="EST")
tmp
```
### Basic analysis.
#### Basic analysis.
```R
names(tmp)
# Relative humidity
res <- basicr::basicr(df=tmp,target="EWR_0_humid")
res <- basicr::basic_info(df=tmp,target="EWR_0_humid")
res
res <- basicr::basicr(df=tmp,target="EWR_0_humid",group="YEAR")
res <- basicr::basic_info(df=tmp,target="EWR_0_humid",group="YEAR")
res
plot_tbl_basic(df=tmp,target="EWR_0_humid",group="YEAR")
basicr::plot_tbl_basic(df=tmp,target="EWR_0_humid",group="YEAR")
res <- basicr::basicr(df=tmp,target="EWR_0_humid",group="MONTH")
res <- basicr::basic_info(df=tmp,target="EWR_0_humid",group="MONTH")
res
plot_tbl_basic(df=tmp,target="EWR_0_humid",group="MONTH")
basicr::plot_tbl_basic(df=tmp,target="EWR_0_humid",group="MONTH")
res <- basicr::basicr(df=tmp,target="NEWR_0_humidO2_7",group="WDAY")
res <- basicr::basic_info(df=tmp,target="NEWR_0_humidO2_7",group="WDAY")
res
plot_tbl_basic(df=tmp,target="EWR_0_humid",group="WDAY")
basicr::plot_tbl_basic(df=tmp,target="EWR_0_humid",group="WDAY")
res <- basicr::basicr(df=tmp,target="EWR_0_humid",group="HOUR")
res <- basicr::basic_info(df=tmp,target="EWR_0_humid",group="HOUR")
res
plot_tbl_basic(df=tmp,target="EWR_0_humid",group="HOUR")
basicr::plot_tbl_basic(df=tmp,target="EWR_0_humid",group="HOUR")
# temperature
res <- basicr::basicr(df=tmp,target="EWR_0_temp")
res <- basicr::basic_info(df=tmp,target="EWR_0_temp")
res
res <- basicr::basicr(df=tmp,target="EWR_0_temp",group="YEAR")
res <- basicr::basic_info(df=tmp,target="EWR_0_temp",group="YEAR")
res
plot_tbl_basic(df=tmp,target="EWR_0_temp",group="YEAR")
basicr::plot_tbl_basic(df=tmp,target="EWR_0_temp",group="YEAR")
res <- basicr::basicr(df=tmp,target="EWR_0_temp",group="MONTH")
res <- basicr::basic_info(df=tmp,target="EWR_0_temp",group="MONTH")
res
plot_tbl_basic(df=tmp,target="EWR_0_temp",group="MONTH")
basicr::plot_tbl_basic(df=tmp,target="EWR_0_temp",group="MONTH")
res <- basicr::basicr(df=tmp,target="EWR_0_temp",group="WDAY")
res <- basicr::basic_info(df=tmp,target="EWR_0_temp",group="WDAY")
res
plot_tbl_basic(df=tmp,target="EWR_0_temp",group="WDAY")
basicr::plot_tbl_basic(df=tmp,target="EWR_0_temp",group="WDAY")
res <- basicr::basicr(df=tmp,target="EWR_0_temp",group="HOUR")
res <- basicr::basic_info(df=tmp,target="EWR_0_temp",group="HOUR")
res
plot_tbl_basic(df=tmp,target="EWR_0_temp",group="HOUR")
basicr::plot_tbl_basic(df=tmp,target="EWR_0_temp",group="HOUR")
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment