-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.Rmd
111 lines (91 loc) · 2.29 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!-- badges go here -->
[![Travis build status](https://travis-ci.org/news-r/accunews.svg?branch=master)](https://travis-ci.org/news-r/accunews) [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/news-r/accunews?branch=master&svg=true)](https://ci.appveyor.com/project/news-r/accunews) [![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/JohnCoene)
```{r setup, include = FALSE}
knitr::opts_chunk$set(
warning = FALSE,
collapse = TRUE,
comment = "#>"
)
library(htmltools)
```
```{r, echo=FALSE}
br()
br()
div(
class = "row",
div(
class = "col-md-4",
img(
src = "logo.png",
class = "img-responsive responsive-img"
)
),
div(
class = "col-md-8",
p(
"Access local and world news."
),
p(
tags$a(
tags$i(class = "fa fa-github"),
class = "btn btn-primary",
href = "https://github.com/news-r/accunews",
style = "margin-bottom: 5px;",
"Repository"
),
tags$a(
tags$i(class = "fa fa-code"),
class = "btn btn-default",
href = "reference/index.html",
style = "margin-bottom: 5px;",
"Reference"
)
)
)
)
```
## Installation
You can install accunews with `remotes` from Github, see [changes](news/index.html).
```r
# install.packages("remotes")
remotes::install_github("news-r/accunews") # github
```
## Setup
Get a free key from the [accunewsapp.com](https://www.accunewsapp.com/) website.
```r
accunews_key("xxXXxxXx")
```
Note that you can specify the `ACCUNEWS_API_KEY` key as an environment variable in your `.Renviron` for convenience.
## Examples
```{r example}
library(accunews)
# get business news sources
(src <- acc_world_sources(type = "business", pages = 2))
```
Plot with [echarts4r](https://echarts4r.john-coene.com).
```{r}
library(echarts4r.suite)
src %>%
e_charts(lon) %>%
em_map("USA") %>%
e_geo("USA") %>%
e_scatter(
lat,
bind = name,
symbol_size = 10,
symbol = ea_icons("signals"),
legend = FALSE,
coord_system = "geo"
) %>%
e_tooltip() %>%
e_color(
"#247BA0",
"#f9f7f1"
)
```
You can also look for local news.
```{r}
library(accunews)
# get articles local (to somewhere)
acc_local_articles(27.964157, -82.452606, pages = 2)
```