Browse Source

only install package if not installed

pull/15/head
janwey 7 months ago
parent
commit
8e56bcbc34
2 changed files with 9 additions and 12 deletions
  1. 7
    8
      collecto.R
  2. 2
    4
      plotte.R

+ 7
- 8
collecto.R View File

@@ -7,19 +7,18 @@

### Loading Packages {{{ ----
#### Twitter
install.packages("rtweet")
library("rtweet")
if(!require("rtweet")){ install.packages("rtweet"); library("rtweet") }
# had to install "httr" via packagemanager

#### Fediverse (eg: mastodon)
install.packages("curl")
library("curl")
install.packages("rjson")
library(rjson)
if(!require("curl")){ install.packages("curl"); library("curl") }
if(!require("rjson")){ install.packages("rjson"); library("rjson") }

### Reddit
install.packages("RedditExtractoR")
library("RedditExtractoR")
if(!require("RedditExtractoR")){
install.packages("RedditExtractoR")
library("RedditExtractoR")
}
# }}}

## Twitter Collector {{{ ----

+ 2
- 4
plotte.R View File

@@ -6,11 +6,9 @@

## Loading Packages {{{ ----
### ggplot2 for plots
install.packages("ggplot2")
library("ggplot2")
if(!require("ggplot2")){ install.packages("ggplot2"); library("ggplot2") }
### arrange ggplot2 plots
install.packages("gridExtra")
library("gridExtra")
if(!require("gridExtra")){ install.packages("gridExtra"); library("gridExtra") }
# }}}

## Loading Data {{{ ----

Loading…
Cancel
Save