Skip to content

Commit

Permalink
Update checks using strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mages committed May 10, 2022
1 parent ae50950 commit 795cb41
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: googleVis
Type: Package
Title: R Interface to Google Charts
Version: 0.7.0
Date: 2022-04-23
Date: 2022-05-10
Authors@R: c(person("Markus", "Gesmann", role = c("aut", "cre"),
email = "[email protected]"),
person("Diego", "de Castillo", role = "aut",
Expand Down
12 changes: 6 additions & 6 deletions R/gvis.R
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ check.char <- function(x){

check.date <- function(x){
y = as.Date(x)
if (class(y)!="Date")
if (!class(y) %in% "Date")
stop(paste("The column has to be of date format. Currently it is", class(x)))
y
}
Expand Down Expand Up @@ -463,17 +463,17 @@ gvisCheckData <- function(data="", options=list(), data.structure=list()){
if(any(is.na(vars.pos)) & (length(varNames) < length(vars.req))){
stop("There are not enough columns in your data.")
}
x <- x[as.character(options$data[options$data!="" &
names(options$data) != "allowed" &
names(options$data) != "date.format"])]
x <- x[as.character(options$data[!options$data %in% "" &
!names(options$data) %in% "allowed" &
!names(options$data) %in% "date.format"])]

html.tooltip.col <- names(data)[endsIn(names(data), '.tooltip')]
if (length(html.tooltip.col) == 1) {
x[[html.tooltip.col]] <- data[[html.tooltip.col]]
}

sapply(names(options$data[options$data!="" & names(options$data) !=
"allowed" & names(options$data) != "date.format"]),
sapply(names(options$data[!options$data %in% "" & !names(options$data) %in%
"allowed" & !names(options$data) %in% "date.format"]),
function(.x){
.x <- as.character(.x)
y <- x[[as.character(options$data[.x])]];
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ library(googleVis)
demo(googleVis)
```

See the googleVis package [vignette](http://mages.github.io/googleVis/articles/googleVis_intro.html) for more details. For a brief introduction read the five page [R Journal article](https://journal.r-project.org/archive/2011-2/RJournal_2011-2_Gesmann+de~Castillo.pdf).
See the googleVis package [vignette](https://mages.github.io/googleVis/articles/googleVis_intro.html) for more details. For a brief introduction read the five page [R Journal article](https://journal.r-project.org/archive/2011-2/RJournal_2011-2_Gesmann+de~Castillo.pdf).

## License

Expand Down
2 changes: 1 addition & 1 deletion vignettes/googleVis.bib
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ @misc{googleVis
title = {google{V}is: Using the {G}oogle {C}harts {API} with {R}},
author = {Markus Gesmann and Diego de Castillo},
year = {2020},
note ={R package version 0.6.5},
note ={R package version 0.7.0},
Howpublished = {\url{https://github.com/mages/googleVis}}
}

Expand Down
2 changes: 1 addition & 1 deletion vignettes/googleVis_intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ Here we will use the columns `'Country'` and
```

The structural output of `gvisGeoChart` is a list of lists as
described above
described below.

```{r eval=FALSE}
str(gchart)
Expand Down

0 comments on commit 795cb41

Please sign in to comment.