Skip to content

Commit

Permalink
Update facet plot
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Aug 24, 2019
1 parent 7575039 commit ed38258
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
23 changes: 14 additions & 9 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,10 @@ They have also seen impressive growth in popularity over the past decade, sugges

```{r, eval=FALSE}
library(gtrendsR)
res = gtrends(c("R programming", "Python programming", "QGIS"), time = "2010-01-01 2019-08-01")
res = gtrends(c("R programming", "Python programming", " VBA programming"), time = "2010-01-01 2019-08-01")
res
plot(res)
p = plot(res)
class(p)
head(res$interest_over_time)
tail(res$interest_over_time)
Expand All @@ -418,9 +419,15 @@ res$interest_over_time$hits_smoothed = c(
zoo::rollmean(res$interest_over_time$hits[(start_rows:end_rows) + 2 * end_rows], 6, fill = "extend")
)
res2 = gtrends(c("RStudio", "Pycharm", "VS code"), time = "2010-01-01 2019-08-01")
res2 = gtrends(c("RStudio", "Pycharm", " QGIS"), time = "2010-01-01 2019-08-01")
p2 = plot(res2)
devtools::install_github("thomasp85/patchwork")
library(patchwork)
p + p2
plot(res2)
end_rows = nrow(res2$interest_over_time) / 3
class(res2$interest_over_time$hits) = "numeric"
Expand All @@ -441,13 +448,11 @@ ggplot(res_all) +
ggplot2::ggsave("google-trends-open.png", width = 6, height = 4)
```

```{r, fig.cap="Relative number of searches for terms related to open source ecosystems R, Python and QGIS. Code to reproduce the plot is hosted in this paper's code repository.", out.width="70%"}
knitr::include_graphics("google-trends-open.png")
```{r, fig.cap="Relative number of searches for terms related to open source (R and Python) and proprietary-based (VBA) programming languages (left) and open source programs (Pychame, QGIS, RStudio) that can be used for transport planning. Code to reproduce the plot is hosted in this paper's code repository.", out.width="70%"}
knitr::include_graphics("google-trends-facet.png")
```

Each ecosystem, and it's potential to be used for geographic analysis in transport planning, is outlined below.


Each open source ecosystem, and it's potential to be used for geographic analysis in transport planning, is outlined below.

## R

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,10 @@ over the past decade, suggesting they are future proof, as illustrated
in Figure
2.

<img src="google-trends-open.png" title="Relative number of searches for terms related to open source ecosystems R, Python and QGIS. Code to reproduce the plot is hosted in this paper's code repository." alt="Relative number of searches for terms related to open source ecosystems R, Python and QGIS. Code to reproduce the plot is hosted in this paper's code repository." width="70%" />
<img src="google-trends-facet.png" title="Relative number of searches for terms related to open source (R and Python) and proprietary-based (VBA) programming languages (left) and open source programs (Pychame, QGIS, RStudio) that can be used for transport planning. Code to reproduce the plot is hosted in this paper's code repository." alt="Relative number of searches for terms related to open source (R and Python) and proprietary-based (VBA) programming languages (left) and open source programs (Pychame, QGIS, RStudio) that can be used for transport planning. Code to reproduce the plot is hosted in this paper's code repository." width="70%" />

Each ecosystem, and it’s potential to be used for geographic analysis in
transport planning, is outlined below.
Each open source ecosystem, and it’s potential to be used for geographic
analysis in transport planning, is outlined below.

## R

Expand Down
Binary file added google-trends-facet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ed38258

Please sign in to comment.