Skip to content

Commit

Permalink
BUG FIXES
Browse files Browse the repository at this point in the history
* `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**.
  • Loading branch information
trinker committed Apr 10, 2017
1 parent 53b2cf6 commit 59b71ff
Show file tree
Hide file tree
Showing 17 changed files with 224 additions and 99 deletions.
4 changes: 3 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ README.Rmd
README.R
travis.yml
inst/maintenance.R
inst/lexicon_logo
inst/staticdocs
inst/extra_statdoc
inst/scraping_scripts
tools/lexicon_logo/r_lexicona.png
tools/lexicon_logo/r_lexicon.pptx
tools/lexicon_logo/resize_icon.txt
14 changes: 6 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@ Authors@R: c(person("Tyler", "Rinker", email =
"[email protected]", role = c("aut", "cre")))
Maintainer: Tyler Rinker <[email protected]>
Description: A collection of lexical hash tables, dictionaries, and
word lists.
Depends:
R (>= 3.2.2)
Imports:
data.table,
syuzhet (>= 1.0.1)
Date: 2017-03-06
word lists.
Depends: R (>= 3.2.2)
Imports: data.table, syuzhet (>= 1.0.1)
Date: 2017-04-09
License: MIT + file LICENSE
LazyData: TRUE
Roxygen: list(wrap = FALSE)
RoxygenNote: 6.0.1
BugReports: https://github.com/trinker/lexicon/issues?state=open
URL: https://github.com/trinker/lexicon
Collate:
Collate:
'available_data.R'
'common_names.R'
'discourse_markers_alemany.R'
'dodds_sentiment.R'
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Generated by roxygen2: do not edit by hand

export(available_data)
export(hash_sentiment_jockers)
export(key_sentiment_jockers)
7 changes: 6 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ And constructed with the following guidelines:
lexicon 0.3.0
----------------------------------------------------------------

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

CHANGES
* `available_data` added to see what data sets are available in **lexicon**.


lexicon 0.2.0
Expand Down
7 changes: 6 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ And constructed with the following guidelines:
lexicon 0.3.0
----------------------------------------------------------------

**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**

**CHANGES**
* `available_data` added to see what data sets are available in **lexicon**.


lexicon 0.2.0
Expand Down
30 changes: 30 additions & 0 deletions R/available_data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#' Get Available \pkg{lexicon} Data
#'
#' See available \pkg{lexicon} data a data.frame.
#'
#' @return Returns a data.frame
#' @export
#' @examples
#' available_data()
available_data <- function(){


results <- utils::data(package = 'lexicon')[["results"]]
dat <- stats::setNames(data.frame(results[, 3:4, drop = FALSE],
stringsAsFactors = FALSE), c("Data", "Description"))

ns <- getNamespaceExports(loadNamespace('lexicon'))
ns <- ns[!ns %in% c("available_data")]
dat <- rbind.data.frame(dat,
data.frame(
Data = ns,
Description = c('Jockers Sentiment Polarity Table', 'Jockers Sentiment Data Set'),
stringsAsFactors = FALSE
))
dat <- dat[order(dat[['Data']]),]
row.names(dat) <- NULL
dat
}



1 change: 0 additions & 1 deletion R/lexicon-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
NULL



15 changes: 3 additions & 12 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ verbadge <- sprintf('<a href="https://img.shields.io/badge/Version-%s-orange.svg
<img src="inst/lexicon_logo/r_lexicon.png" width="135" alt="lexicon Logo">
![](tools/lexicon_logo/r_lexicon.png)
# Description
Expand All @@ -42,19 +43,9 @@ Prefix | Meaning
```{r, echo=FALSE}
pacman::p_load(pander)
dat <- rbind.data.frame(pacman::p_data(lexicon),
data.frame(
Data = pacman::p_funs(lexicon),
Description = c('Jockers Sentiment Polarity Table', 'Jockers Sentiment Data Set'),
stringsAsFactors = FALSE
))
dat <- dat[order(dat$Data),]
dat[[1]] <- paste0('`',dat[[1]], '`')
row.names(dat) <- NULL
dat <- available_data()
pander::set.alignment('left')
pander(dat, style = "grid")
```

# Installation
Expand Down
Loading

0 comments on commit 59b71ff

Please sign in to comment.