Skip to content

Commit 59b71ff

Browse files
committed
BUG FIXES
* `freq_first_names` and `freq_last_names` were just a string of the data set name. This has been updated with the actual data set. NEW FEATURES * `available_data` added to see what data sets are available in **lexicon**.
1 parent 53b2cf6 commit 59b71ff

17 files changed

+224
-99
lines changed

.Rbuildignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ README.Rmd
1515
README.R
1616
travis.yml
1717
inst/maintenance.R
18-
inst/lexicon_logo
1918
inst/staticdocs
2019
inst/extra_statdoc
2120
inst/scraping_scripts
21+
tools/lexicon_logo/r_lexicona.png
22+
tools/lexicon_logo/r_lexicon.pptx
23+
tools/lexicon_logo/resize_icon.txt

DESCRIPTION

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,18 @@ Authors@R: c(person("Tyler", "Rinker", email =
55
"[email protected]", role = c("aut", "cre")))
66
Maintainer: Tyler Rinker <[email protected]>
77
Description: A collection of lexical hash tables, dictionaries, and
8-
word lists.
9-
Depends:
10-
R (>= 3.2.2)
11-
Imports:
12-
data.table,
13-
syuzhet (>= 1.0.1)
14-
Date: 2017-03-06
8+
word lists.
9+
Depends: R (>= 3.2.2)
10+
Imports: data.table, syuzhet (>= 1.0.1)
11+
Date: 2017-04-09
1512
License: MIT + file LICENSE
1613
LazyData: TRUE
1714
Roxygen: list(wrap = FALSE)
1815
RoxygenNote: 6.0.1
1916
BugReports: https://github.com/trinker/lexicon/issues?state=open
2017
URL: https://github.com/trinker/lexicon
21-
Collate:
18+
Collate:
19+
'available_data.R'
2220
'common_names.R'
2321
'discourse_markers_alemany.R'
2422
'dodds_sentiment.R'

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
export(available_data)
34
export(hash_sentiment_jockers)
45
export(key_sentiment_jockers)

NEWS

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@ And constructed with the following guidelines:
2020
lexicon 0.3.0
2121
----------------------------------------------------------------
2222

23+
BUG FIXES
24+
25+
* `freq_first_names` and `freq_last_names` were just a string of the data set
26+
name. This has been updated with the actual data set.
27+
2328
NEW FEATURES
2429

25-
CHANGES
30+
* `available_data` added to see what data sets are available in **lexicon**.
2631

2732

2833
lexicon 0.2.0

NEWS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@ And constructed with the following guidelines:
2020
lexicon 0.3.0
2121
----------------------------------------------------------------
2222

23+
**BUG FIXES**
24+
25+
* `freq_first_names` and `freq_last_names` were just a string of the data set
26+
name. This has been updated with the actual data set.
27+
2328
**NEW FEATURES**
2429

25-
**CHANGES**
30+
* `available_data` added to see what data sets are available in **lexicon**.
2631

2732

2833
lexicon 0.2.0

R/available_data.R

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#' Get Available \pkg{lexicon} Data
2+
#'
3+
#' See available \pkg{lexicon} data a data.frame.
4+
#'
5+
#' @return Returns a data.frame
6+
#' @export
7+
#' @examples
8+
#' available_data()
9+
available_data <- function(){
10+
11+
12+
results <- utils::data(package = 'lexicon')[["results"]]
13+
dat <- stats::setNames(data.frame(results[, 3:4, drop = FALSE],
14+
stringsAsFactors = FALSE), c("Data", "Description"))
15+
16+
ns <- getNamespaceExports(loadNamespace('lexicon'))
17+
ns <- ns[!ns %in% c("available_data")]
18+
dat <- rbind.data.frame(dat,
19+
data.frame(
20+
Data = ns,
21+
Description = c('Jockers Sentiment Polarity Table', 'Jockers Sentiment Data Set'),
22+
stringsAsFactors = FALSE
23+
))
24+
dat <- dat[order(dat[['Data']]),]
25+
row.names(dat) <- NULL
26+
dat
27+
}
28+
29+
30+

R/lexicon-package.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@
77
NULL
88

99

10-

README.Rmd

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ verbadge <- sprintf('<a href="https://img.shields.io/badge/Version-%s-orange.svg
2121
2222
2323
24-
<img src="inst/lexicon_logo/r_lexicon.png" width="135" alt="lexicon Logo">
24+
![](tools/lexicon_logo/r_lexicon.png)
25+
2526
2627
2728
# Description
@@ -42,19 +43,9 @@ Prefix | Meaning
4243
4344
```{r, echo=FALSE}
4445
pacman::p_load(pander)
45-
dat <- rbind.data.frame(pacman::p_data(lexicon),
46-
data.frame(
47-
Data = pacman::p_funs(lexicon),
48-
Description = c('Jockers Sentiment Polarity Table', 'Jockers Sentiment Data Set'),
49-
stringsAsFactors = FALSE
50-
))
51-
dat <- dat[order(dat$Data),]
52-
53-
dat[[1]] <- paste0('`',dat[[1]], '`')
54-
row.names(dat) <- NULL
46+
dat <- available_data()
5547
pander::set.alignment('left')
5648
pander(dat, style = "grid")
57-
5849
```
5950

6051
# Installation

0 commit comments

Comments
 (0)