diff --git a/R/write_ical.R b/R/write_ical.R index 05d9f93..21516c7 100644 --- a/R/write_ical.R +++ b/R/write_ical.R @@ -25,10 +25,10 @@ #' @examples #' df <- data.frame( #' date = c("2020-02-10", "2020-02-11"), -#' end = c("2020-02-13",NA), +#' date.end = c("2020-02-13",NA), #' title = c("Conference", "Lunch"), #' start = c("12:00:00", NA), -#' bye = c("13:00:00", NA), +#' time.end = c("13:00:00", NA), #' note = c("Hi there","Remember to come"), #' link = c("https://icalendar.org","https://agdamsbo.github.io/stRoke/") #' ) @@ -36,10 +36,10 @@ #' write_ical( #' df, #' date = "date", -#' date.end = "end", +#' date.end = "date.end", #' title = "title", #' time.start = "start", -#' time.end = "bye", +#' time.end = "time.end", #' place.def = "Conference Room", #' descr = "note", #' link = "link" @@ -78,6 +78,10 @@ write_ical <- stop("Supplied title is not a valid column name") } + if (any(is.na(df[,title]))) { + stop("Missing title values are not allowed") + } + if (is.character(place) & !place %in% colnames(df)) { stop("Supplied place is not a valid column name") } @@ -109,16 +113,14 @@ write_ical <- lubridate::hms(i[, time.start]) } - if (is.character(date.end) & - !is.na(i[, time.end]) & - is.na(i[, date.end])) { - stop("time.end is needed for entries - with supplied date.end") + is.na(i[, time.end]) & + !is.na(i[, date.end])) { + stop("time.end is missing for some date.end") } else if (is.character(date.end) & - !is.na(i[, time.end]) & - !is.na(i[, date.end])) { + !is.na(i[, time.end]) & + !is.na(i[, date.end])) { i$end_time <- lubridate::ymd(i[, date.end], tz = t.zone) + lubridate::hms(i[, time.end]) diff --git a/README.md b/README.md index ebb3c95..171b986 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -![GitHub R package version](https://img.shields.io/github/r-package/v/agdamsbo/stRoke) -![CRAN/METACRAN](https://img.shields.io/cran/v/stRoke) -![CRAN/METACRAN](https://img.shields.io/cran/l/stRoke) +[![GitHub R package version](https://img.shields.io/github/r-package/v/agdamsbo/stRoke)](https://github.com/agdamsbo/stRoke) +[![CRAN/METACRAN](https://img.shields.io/cran/v/stRoke)](https://cran.r-project.org/web/packages/stRoke/index.html) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7572023.svg)](https://doi.org/10.5281/zenodo.7572023) [![Github Actions](https://github.com/agdamsbo/stRoke/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/agdamsbo/stRoke/actions/workflows/R-CMD-check.yaml) [![Page deployed](https://github.com/agdamsbo/stRoke/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/agdamsbo/stRoke/actions/workflows/pages/pages-build-deployment) [![codecov](https://codecov.io/github/agdamsbo/stRoke/branch/main/graph/badge.svg?token=U0RBZYSKG5)](https://codecov.io/github/agdamsbo/stRoke) @@ -19,7 +19,13 @@ This package is [shared on GitHub](https://github.com/agdamsbo/stRoke), and you # Installation -The package can be installed from GitHub: +The package can be installed directly from CRAN: + +``` +install.packages("stRoke") +``` + +The latest version in development can be installed from GitHub: ``` remotes::install_github("agdamsbo/stRoke") diff --git a/docs/articles/Toolbox.html b/docs/articles/Toolbox.html index 8252946..b0ad56c 100644 --- a/docs/articles/Toolbox.html +++ b/docs/articles/Toolbox.html @@ -214,12 +214,12 @@ model plot (with stRoke::ci_plot() variables = c("hypertension", "diabetes", "civil")) #> Waiting for profiling to be done... #> $`Table 1` -#> <div id="oxsdboznol" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;"> +#> <div id="methqihjax" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;"> #> <style>html { #> font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif; #> } #> -#> #oxsdboznol .gt_table { +#> #methqihjax .gt_table { #> display: table; #> border-collapse: collapse; #> margin-left: auto; @@ -244,7 +244,7 @@ model plot (with stRoke::ci_plot() #> border-left-color: #D3D3D3; #> } #> -#> #oxsdboznol .gt_heading { +#> #methqihjax .gt_heading { #> background-color: #FFFFFF; #> text-align: center; #> border-bottom-color: #FFFFFF; @@ -256,12 +256,12 @@ model plot (with stRoke::ci_plot() #> border-right-color: #D3D3D3; #> } #> -#> #oxsdboznol .gt_caption { +#> #methqihjax .gt_caption { #> padding-top: 4px; #> padding-bottom: 4px; #> } #> -#> #oxsdboznol .gt_title { +#> #methqihjax .gt_title { #> color: #333333; #> font-size: 125%; #> font-weight: initial; @@ -273,7 +273,7 @@ model plot (with stRoke::ci_plot() #> border-bottom-width: 0; #> } #> -#> #oxsdboznol .gt_subtitle { +#> #methqihjax .gt_subtitle { #> color: #333333; #> font-size: 85%; #> font-weight: initial; @@ -285,13 +285,13 @@ model plot (with stRoke::ci_plot() #> border-top-width: 0; #> } #> -#> #oxsdboznol .gt_bottom_border { +#> #methqihjax .gt_bottom_border { #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> } #> -#> #oxsdboznol .gt_col_headings { +#> #methqihjax .gt_col_headings { #> border-top-style: solid; #> border-top-width: 2px; #> border-top-color: #D3D3D3; @@ -306,7 +306,7 @@ model plot (with stRoke::ci_plot() #> border-right-color: #D3D3D3; #> } #> -#> #oxsdboznol .gt_col_heading { +#> #methqihjax .gt_col_heading { #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; @@ -326,7 +326,7 @@ model plot (with stRoke::ci_plot() #> overflow-x: hidden; #> } #> -#> #oxsdboznol .gt_column_spanner_outer { +#> #methqihjax .gt_column_spanner_outer { #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; @@ -338,15 +338,15 @@ model plot (with stRoke::ci_plot() #> padding-right: 4px; #> } #> -#> #oxsdboznol .gt_column_spanner_outer:first-child { +#> #methqihjax .gt_column_spanner_outer:first-child { #> padding-left: 0; #> } #> -#> #oxsdboznol .gt_column_spanner_outer:last-child { +#> #methqihjax .gt_column_spanner_outer:last-child { #> padding-right: 0; #> } #> -#> #oxsdboznol .gt_column_spanner { +#> #methqihjax .gt_column_spanner { #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; @@ -358,7 +358,7 @@ model plot (with stRoke::ci_plot() #> width: 100%; #> } #> -#> #oxsdboznol .gt_group_heading { +#> #methqihjax .gt_group_heading { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; @@ -384,7 +384,7 @@ model plot (with stRoke::ci_plot() #> text-align: left; #> } #> -#> #oxsdboznol .gt_empty_group_heading { +#> #methqihjax .gt_empty_group_heading { #> padding: 0.5px; #> color: #333333; #> background-color: #FFFFFF; @@ -399,15 +399,15 @@ model plot (with stRoke::ci_plot() #> vertical-align: middle; #> } #> -#> #oxsdboznol .gt_from_md > :first-child { +#> #methqihjax .gt_from_md > :first-child { #> margin-top: 0; #> } #> -#> #oxsdboznol .gt_from_md > :last-child { +#> #methqihjax .gt_from_md > :last-child { #> margin-bottom: 0; #> } #> -#> #oxsdboznol .gt_row { +#> #methqihjax .gt_row { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; @@ -426,7 +426,7 @@ model plot (with stRoke::ci_plot() #> overflow-x: hidden; #> } #> -#> #oxsdboznol .gt_stub { +#> #methqihjax .gt_stub { #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; @@ -439,7 +439,7 @@ model plot (with stRoke::ci_plot() #> padding-right: 5px; #> } #> -#> #oxsdboznol .gt_stub_row_group { +#> #methqihjax .gt_stub_row_group { #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; @@ -453,11 +453,11 @@ model plot (with stRoke::ci_plot() #> vertical-align: top; #> } #> -#> #oxsdboznol .gt_row_group_first td { +#> #methqihjax .gt_row_group_first td { #> border-top-width: 2px; #> } #> -#> #oxsdboznol .gt_summary_row { +#> #methqihjax .gt_summary_row { #> color: #333333; #> background-color: #FFFFFF; #> text-transform: inherit; @@ -467,16 +467,16 @@ model plot (with stRoke::ci_plot() #> padding-right: 5px; #> } #> -#> #oxsdboznol .gt_first_summary_row { +#> #methqihjax .gt_first_summary_row { #> border-top-style: solid; #> border-top-color: #D3D3D3; #> } #> -#> #oxsdboznol .gt_first_summary_row.thick { +#> #methqihjax .gt_first_summary_row.thick { #> border-top-width: 2px; #> } #> -#> #oxsdboznol .gt_last_summary_row { +#> #methqihjax .gt_last_summary_row { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; @@ -486,7 +486,7 @@ model plot (with stRoke::ci_plot() #> border-bottom-color: #D3D3D3; #> } #> -#> #oxsdboznol .gt_grand_summary_row { +#> #methqihjax .gt_grand_summary_row { #> color: #333333; #> background-color: #FFFFFF; #> text-transform: inherit; @@ -496,7 +496,7 @@ model plot (with stRoke::ci_plot() #> padding-right: 5px; #> } #> -#> #oxsdboznol .gt_first_grand_summary_row { +#> #methqihjax .gt_first_grand_summary_row { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; @@ -506,11 +506,11 @@ model plot (with stRoke::ci_plot() #> border-top-color: #D3D3D3; #> } #> -#> #oxsdboznol .gt_striped { +#> #methqihjax .gt_striped { #> background-color: rgba(128, 128, 128, 0.05); #> } #> -#> #oxsdboznol .gt_table_body { +#> #methqihjax .gt_table_body { #> border-top-style: solid; #> border-top-width: 2px; #> border-top-color: #D3D3D3; @@ -519,7 +519,7 @@ model plot (with stRoke::ci_plot() #> border-bottom-color: #D3D3D3; #> } #> -#> #oxsdboznol .gt_footnotes { +#> #methqihjax .gt_footnotes { #> color: #333333; #> background-color: #FFFFFF; #> border-bottom-style: none; @@ -533,7 +533,7 @@ model plot (with stRoke::ci_plot() #> border-right-color: #D3D3D3; #> } #> -#> #oxsdboznol .gt_footnote { +#> #methqihjax .gt_footnote { #> margin: 0px; #> font-size: 90%; #> padding-left: 4px; @@ -542,7 +542,7 @@ model plot (with stRoke::ci_plot() #> padding-right: 5px; #> } #> -#> #oxsdboznol .gt_sourcenotes { +#> #methqihjax .gt_sourcenotes { #> color: #333333; #> background-color: #FFFFFF; #> border-bottom-style: none; @@ -556,7 +556,7 @@ model plot (with stRoke::ci_plot() #> border-right-color: #D3D3D3; #> } #> -#> #oxsdboznol .gt_sourcenote { +#> #methqihjax .gt_sourcenote { #> font-size: 90%; #> padding-top: 4px; #> padding-bottom: 4px; @@ -564,64 +564,64 @@ model plot (with stRoke::ci_plot() #> padding-right: 5px; #> } #> -#> #oxsdboznol .gt_left { +#> #methqihjax .gt_left { #> text-align: left; #> } #> -#> #oxsdboznol .gt_center { +#> #methqihjax .gt_center { #> text-align: center; #> } #> -#> #oxsdboznol .gt_right { +#> #methqihjax .gt_right { #> text-align: right; #> font-variant-numeric: tabular-nums; #> } #> -#> #oxsdboznol .gt_font_normal { +#> #methqihjax .gt_font_normal { #> font-weight: normal; #> } #> -#> #oxsdboznol .gt_font_bold { +#> #methqihjax .gt_font_bold { #> font-weight: bold; #> } #> -#> #oxsdboznol .gt_font_italic { +#> #methqihjax .gt_font_italic { #> font-style: italic; #> } #> -#> #oxsdboznol .gt_super { +#> #methqihjax .gt_super { #> font-size: 65%; #> } #> -#> #oxsdboznol .gt_footnote_marks { +#> #methqihjax .gt_footnote_marks { #> font-style: italic; #> font-weight: normal; #> font-size: 75%; #> vertical-align: 0.4em; #> } #> -#> #oxsdboznol .gt_asterisk { +#> #methqihjax .gt_asterisk { #> font-size: 100%; #> vertical-align: 0; #> } #> -#> #oxsdboznol .gt_indent_1 { +#> #methqihjax .gt_indent_1 { #> text-indent: 5px; #> } #> -#> #oxsdboznol .gt_indent_2 { +#> #methqihjax .gt_indent_2 { #> text-indent: 10px; #> } #> -#> #oxsdboznol .gt_indent_3 { +#> #methqihjax .gt_indent_3 { #> text-indent: 15px; #> } #> -#> #oxsdboznol .gt_indent_4 { +#> #methqihjax .gt_indent_4 { #> text-indent: 20px; #> } #> -#> #oxsdboznol .gt_indent_5 { +#> #methqihjax .gt_indent_5 { #> text-indent: 25px; #> } #> </style> diff --git a/docs/index.html b/docs/index.html index 72a1616..54b3448 100644 --- a/docs/index.html +++ b/docs/index.html @@ -94,7 +94,9 @@

Installation

-

The package can be installed from GitHub:

+

The package can be installed directly from CRAN:

+
install.packages("stRoke")
+

The latest version in development can be installed from GitHub:

remotes::install_github("agdamsbo/stRoke")
@@ -132,6 +134,9 @@

Dev status