Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
Updated README and vignette with new path for github installation
Browse files Browse the repository at this point in the history
  • Loading branch information
cvitolo committed Sep 7, 2016
1 parent 34d5045 commit 1c9cfd0
Show file tree
Hide file tree
Showing 51 changed files with 27 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ tests/*
*.html

README_cache/*
vignettes/rdefra_vignette_cache/*
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ cache: packages
before_install:
- sudo apt-get -qq update
- sudo apt-get install r-cran-rgdal
- cd rdefra

r_github_packages:
- jimhester/covr
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ install.packages('rdefra')
Or the development version from github using [devtools](https://github.com/hadley/devtools):

```{r}
devtools::install_github('cvitolo/r_rdefra', subdir = 'rdefra')
devtools::install_github('cvitolo/rdefra')
```

Load the rdefra package:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ install.packages('rdefra')
Or the development version from github using [devtools](https://github.com/hadley/devtools):

``` r
devtools::install_github('cvitolo/r_rdefra', subdir = 'rdefra')
devtools::install_github('cvitolo/rdefra')
```

Load the rdefra package:
Expand Down
37 changes: 24 additions & 13 deletions vignettes/rdefra_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,16 @@ if(length(new.packages)) install.packages(new.packages)

### Installation

You can install this package from CRAN:
Get the released version from CRAN:

```{r}
install.packages('rdefra')
```


Or you can install the development version from Github with [devtools](https://github.com/hadley/devtools):
Or the development version from github using [devtools](https://github.com/hadley/devtools):

```{r}
devtools::install_github('cvitolo/r_rdefra', subdir = 'rdefra')
devtools::install_github('cvitolo/rdefra')
```

Load the rdefra package:
Expand All @@ -63,7 +62,7 @@ library('rdefra')

## Functions

The package logic assumes that the user access the UK-AIR database in two steps:
The package logic assumes that users access the UK-AIR database in two steps:

1. Browse the catalogue of available stations and selects some stations of interest.
2. Retrieves data for the selected stations.
Expand Down Expand Up @@ -125,6 +124,12 @@ plot(aggregate(my1, as.Date(as.POSIXlt(df$datetime)), mean),
mu, 'g/', m^3, ']')))
```

Units are available as attribute of the `ukair_get_hourly_data()`.

```{r, eval = TRUE}
attributes(my1)$units
```

Highest concentrations seem to happen in late spring and at the beginning of summer. In order to check whether this happens every year, we can download multiple years of data and then compare them.

```{r, eval = TRUE}
Expand All @@ -145,7 +150,7 @@ df %>%
ggplot() +
geom_boxplot(aes(x = as.factor(month), y = ozone, group = month),
outlier.shape = NA) +
xlab("") +
xlab("Month of the year") +
ylab(expression(paste("Ozone concentration (", mu, "g/",m^3,")")))
```

Expand Down Expand Up @@ -185,6 +190,8 @@ leaflet(data = stations) %>% addTiles() %>%
```

![](../assets/figures/leaflet.png)

### Analyse the spatial distribution of the monitoring stations

Below are two plots showing the spatial distribution of the monitoring stations. These are concentrated largely in urban areas and mostly estimate the background level of concentration of pollutants.
Expand All @@ -201,21 +208,25 @@ dotchart(as.matrix(table(stations$Environment.Type[stations$Environment.Type !=

### Use multiple cores to speed up data retrieval from numerous sites

Using parallel processing, the acquisition of data from hundreds of sites takes only few minutes:
The acquisition of data from hundreds of sites takes only few minutes:

```{r}
library('parallel')
# Calculate the number of cores
no_cores <- detectCores() - 1
# Initiate cluster
cl <- makeCluster(no_cores)
# Use detectCores() to find out many cores are available on your machine
cl <- makeCluster(getOption("cl.cores", detectCores()))
system.time(myList <- parLapply(cl, stations$SiteID[stations_with_Hdata],
ukair_get_hourly_data, years=1999:2016))
ukair_get_hourly_data, years=1999:2016))
stopCluster(cl)
df <- bind_rows(myList)
```

## Meta

* Please note that this project is released with a [Contributor Code of Conduct](rdefra/CONDUCT.md). By participating in this project you agree to abide by its terms.
* Please [report any issues or bugs](https://github.com/kehraProject/r_rdefra/issues).
* License: [GPL-3](https://opensource.org/licenses/GPL-3.0)
* Get citation information for `rdefra` in R doing `citation(package = 'rdefra')`
7 changes: 0 additions & 7 deletions vignettes/rdefra_vignette_cache/html/__packages

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 1c9cfd0

Please sign in to comment.