diff --git a/news/index.html b/news/index.html index e352481..6c96fd9 100644 --- a/news/index.html +++ b/news/index.html @@ -37,6 +37,8 @@

freesearcheR 25.3.2

Focus is on polish and improved ui/ux.

+

First steps towards an updated name (will be FreesearchR), with renamed repository. Also, the repo will move to an organisation (named FreesearchR).

+

Testing file upload conducted and improved.

freesearcheR 25.3.1

diff --git a/pkgdown.yml b/pkgdown.yml index c00ca7c..a7ec4c2 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.11 pkgdown: 2.1.1 pkgdown_sha: ~ articles: {} -last_built: 2025-03-07T14:27Z +last_built: 2025-03-11T13:01Z urls: reference: https://agdamsbo.github.io/freesearcheR/reference article: https://agdamsbo.github.io/freesearcheR/articles diff --git a/reference/columnSelectInput.html b/reference/columnSelectInput.html index 2a98851..66a5427 100644 --- a/reference/columnSelectInput.html +++ b/reference/columnSelectInput.html @@ -33,7 +33,7 @@ Adds the option to select "none" which is handled later'>
diff --git a/reference/data-plots-4.png b/reference/data-plots-4.png index b145dc4..741d6b5 100644 Binary files a/reference/data-plots-4.png and b/reference/data-plots-4.png differ diff --git a/reference/data-plots-5.png b/reference/data-plots-5.png index 8fd363e..0f0df97 100644 Binary files a/reference/data-plots-5.png and b/reference/data-plots-5.png differ diff --git a/reference/data-plots-6.png b/reference/data-plots-6.png index 866f55b..c228680 100644 Binary files a/reference/data-plots-6.png and b/reference/data-plots-6.png differ diff --git a/reference/data-plots-7.png b/reference/data-plots-7.png index eef2750..0b9b69c 100644 Binary files a/reference/data-plots-7.png and b/reference/data-plots-7.png differ diff --git a/reference/data-plots-8.png b/reference/data-plots-8.png index 48cd52f..e5cabc6 100644 Binary files a/reference/data-plots-8.png and b/reference/data-plots-8.png differ diff --git a/reference/data-plots.html b/reference/data-plots.html index 2086790..1e2054e 100644 --- a/reference/data-plots.html +++ b/reference/data-plots.html @@ -4,11 +4,13 @@ Wrapper to create plot based on provided type Nice horizontal stacked bars (Grotta bars) Beatiful violin plot Beautiful violin plot +Readying data for sankey plot Beautiful sankey plot with option to split by a tertiary group"> Skip to contents @@ -51,6 +53,7 @@ Beautiful sankey plot with option to split by a tertiary group">

Nice horizontal stacked bars (Grotta bars)

Beatiful violin plot

Beautiful violin plot

+

Readying data for sankey plot

Beautiful sankey plot with option to split by a tertiary group

@@ -66,6 +69,8 @@ Beautiful sankey plot with option to split by a tertiary group"> plot_scatter(data, x, y, z = NULL) +sankey_ready(data, x, y, z = NULL, numbers = "count") + plot_sankey(data, x, y, z = NULL, color.group = "x", colors = NULL) @@ -73,7 +78,23 @@ Beautiful sankey plot with option to split by a tertiary group">

Arguments

-
...
+
data
+

data.frame

+ + +
x
+

primary variable

+ + +
y
+

secondary variable

+ + +
z
+

tertiary variable

+ + +
...

ignored for now

@@ -88,6 +109,7 @@ Beautiful sankey plot with option to split by a tertiary group">

ggplot2 object

ggplot2 object

ggplot2 object

+

data.frame

ggplot2 object

@@ -148,6 +170,53 @@ Beautiful sankey plot with option to split by a tertiary group"> mtcars |> plot_scatter(x = "mpg", y = "wt") +ds <- data.frame(g = sample(LETTERS[1:2], 100, TRUE), first = REDCapCAST::as_factor(sample(letters[1:4], 100, TRUE)), last = sample(c(letters[1:4], NA), 100, TRUE, prob = c(rep(.23, 4), .08))) +ds |> sankey_ready("first", "last") +#> # A tibble: 19 × 7 +#> first last n gx.sum gy.sum lx ly +#> <fct> <chr> <int> <int> <int> <fct> <fct> +#> 1 c a 7 28 32 "c\n(n=28)" "a\n(n=32)" +#> 2 c b 6 28 26 "c\n(n=28)" "b\n(n=26)" +#> 3 c c 5 28 15 "c\n(n=28)" "c\n(n=15)" +#> 4 c d 6 28 17 "c\n(n=28)" "d\n(n=17)" +#> 5 c NA 4 28 10 "c\n(n=28)" "NA\n(n=10)" +#> 6 a a 9 24 32 "a\n(n=24)" "a\n(n=32)" +#> 7 a b 6 24 26 "a\n(n=24)" "b\n(n=26)" +#> 8 a c 6 24 15 "a\n(n=24)" "c\n(n=15)" +#> 9 a d 1 24 17 "a\n(n=24)" "d\n(n=17)" +#> 10 a NA 2 24 10 "a\n(n=24)" "NA\n(n=10)" +#> 11 b a 8 20 32 "b\n(n=20)" "a\n(n=32)" +#> 12 b b 5 20 26 "b\n(n=20)" "b\n(n=26)" +#> 13 b c 4 20 15 "b\n(n=20)" "c\n(n=15)" +#> 14 b d 2 20 17 "b\n(n=20)" "d\n(n=17)" +#> 15 b NA 1 20 10 "b\n(n=20)" "NA\n(n=10)" +#> 16 d a 8 28 32 "d\n(n=28)" "a\n(n=32)" +#> 17 d b 9 28 26 "d\n(n=28)" "b\n(n=26)" +#> 18 d d 8 28 17 "d\n(n=28)" "d\n(n=17)" +#> 19 d NA 3 28 10 "d\n(n=28)" "NA\n(n=10)" +ds |> sankey_ready("first", "last", numbers = "percentage") +#> # A tibble: 19 × 7 +#> first last n gx.sum gy.sum lx ly +#> <fct> <chr> <int> <int> <int> <fct> <fct> +#> 1 c a 7 28 32 "c\n(28%)" "a\n(32%)" +#> 2 c b 6 28 26 "c\n(28%)" "b\n(26%)" +#> 3 c c 5 28 15 "c\n(28%)" "c\n(15%)" +#> 4 c d 6 28 17 "c\n(28%)" "d\n(17%)" +#> 5 c NA 4 28 10 "c\n(28%)" "NA\n(10%)" +#> 6 a a 9 24 32 "a\n(24%)" "a\n(32%)" +#> 7 a b 6 24 26 "a\n(24%)" "b\n(26%)" +#> 8 a c 6 24 15 "a\n(24%)" "c\n(15%)" +#> 9 a d 1 24 17 "a\n(24%)" "d\n(17%)" +#> 10 a NA 2 24 10 "a\n(24%)" "NA\n(10%)" +#> 11 b a 8 20 32 "b\n(20%)" "a\n(32%)" +#> 12 b b 5 20 26 "b\n(20%)" "b\n(26%)" +#> 13 b c 4 20 15 "b\n(20%)" "c\n(15%)" +#> 14 b d 2 20 17 "b\n(20%)" "d\n(17%)" +#> 15 b NA 1 20 10 "b\n(20%)" "NA\n(10%)" +#> 16 d a 8 28 32 "d\n(28%)" "a\n(32%)" +#> 17 d b 9 28 26 "d\n(28%)" "b\n(26%)" +#> 18 d d 8 28 17 "d\n(28%)" "d\n(17%)" +#> 19 d NA 3 28 10 "d\n(28%)" "NA\n(10%)" ds <- data.frame(g = sample(LETTERS[1:2], 100, TRUE), first = REDCapCAST::as_factor(sample(letters[1:4], 100, TRUE)), last = REDCapCAST::as_factor(sample(letters[1:4], 100, TRUE))) ds |> plot_sankey("first", "last") #> Loading required package: ggplot2 diff --git a/reference/drop_empty_event.html b/reference/drop_empty_event.html new file mode 100644 index 0000000..2159c52 --- /dev/null +++ b/reference/drop_empty_event.html @@ -0,0 +1,84 @@ + +Drop empty events from REDCap export — drop_empty_event • freesearcheR + Skip to contents + + +
+
+
+ +
+

Drop empty events from REDCap export

+
+ +
+

Usage

+
drop_empty_event(data, event = "redcap_event_name")
+
+ +
+

Arguments

+ + +
data
+

data

+ + +
event
+

"redcap_event_name", "redcap_repeat_instrument" or +"redcap_repeat_instance"

+ +
+
+

Value

+

data.frame

+
+ +
+ + +
+ + + +
+ + + + + + + diff --git a/reference/get_label.html b/reference/get_label.html index 89ac6f3..aeb65c4 100644 --- a/reference/get_label.html +++ b/reference/get_label.html @@ -51,6 +51,10 @@
data

vector or data frame

+ +
var
+

variable name. Optional.

+

Value

diff --git a/reference/getfun.html b/reference/getfun.html index bcd5296..249d24c 100644 --- a/reference/getfun.html +++ b/reference/getfun.html @@ -132,7 +132,7 @@ #> z$qr <- NULL #> z #> } -#> <bytecode: 0x55bc2c4223f8> +#> <bytecode: 0x55a6d152e008> #> <environment: namespace:stats>
diff --git a/reference/grepl_fix.html b/reference/grepl_fix.html new file mode 100644 index 0000000..32bb73d --- /dev/null +++ b/reference/grepl_fix.html @@ -0,0 +1,93 @@ + +Matches pattern to vector based on match type — grepl_fix • freesearcheR + Skip to contents + + +
+
+
+ +
+

Matches pattern to vector based on match type

+
+ +
+

Usage

+
grepl_fix(data, pattern, type = c("prefix", "infix", "suffix"))
+
+ +
+

Arguments

+ + +
data
+

vector

+ + +
pattern
+

pattern(s) to match. Character vector of length 1 or more.

+ + +
type
+

type of match. can be one of "prefix","infix" or "suffix".

+ +
+
+

Value

+

logical vector

+
+ +
+

Examples

+
c("id", "age", "weight_0", "weight_1") |> grepl_fix(pattern = c("_0", "_1"), type = "suffix")
+#> [1] FALSE FALSE  TRUE  TRUE
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/reference/import-file.html b/reference/import-file.html new file mode 100644 index 0000000..108c4e6 --- /dev/null +++ b/reference/import-file.html @@ -0,0 +1,113 @@ + +Import data from a file — import-file • freesearcheR + Skip to contents + + +
+
+
+ +
+

Let user upload a file and import data

+
+ +
+

Usage

+
import_file_ui(
+  id,
+  title = TRUE,
+  preview_data = TRUE,
+  file_extensions = c(".csv", ".txt", ".xls", ".xlsx", ".rds", ".fst", ".sas7bdat",
+    ".sav"),
+  layout_params = c("dropdown", "inline")
+)
+
+import_file_server(
+  id,
+  btn_show_data = TRUE,
+  show_data_in = c("popup", "modal"),
+  trigger_return = c("button", "change"),
+  return_class = c("data.frame", "data.table", "tbl_df", "raw"),
+  reset = reactive(NULL),
+  read_fns = list()
+)
+
+ +
+

Arguments

+ + +
preview_data
+

Show or not a preview of the data under the file input.

+ + +
file_extensions
+

File extensions accepted by shiny::fileInput(), can also be MIME type.

+ + +
layout_params
+

How to display import parameters : in a dropdown button or inline below file input.

+ + +
read_fns
+

Named list with custom function(s) to read data:

  • the name must be the extension of the files to which the function will be applied

  • +
  • the value must be a function that can have 5 arguments (you can ignore some of them, but you have to use the same names), +passed by user through the interface:

    • file: path to the file

    • +
    • sheet: for Excel files, sheet to read

    • +
    • skip: number of row to skip

    • +
    • dec: decimal separator

    • +
    • encoding: file encoding

    • +
    • na.strings: character(s) to interpret as missing values.

    • +
  • +
+ +
+ +
+ + +
+ + + +
+ + + + + + + diff --git a/reference/import_delim.html b/reference/import_delim.html new file mode 100644 index 0000000..cd8ac9a --- /dev/null +++ b/reference/import_delim.html @@ -0,0 +1,87 @@ + +Wrapper of data.table::fread to import delim files with few presets — import_delim • freesearcheR + Skip to contents + + +
+
+
+ +
+

Wrapper of data.table::fread to import delim files with few presets

+
+ +
+

Usage

+
import_delim(file, skip, encoding, na.strings)
+
+ +
+

Arguments

+ + +
file
+

file

+ + +
encoding
+

encoding

+ + +
na.strings
+

na.strings

+ +
+
+

Value

+

data.frame

+
+ +
+ + +
+ + + +
+ + + + + + + diff --git a/reference/import_file_server.html b/reference/import_file_server.html new file mode 100644 index 0000000..1571659 --- /dev/null +++ b/reference/import_file_server.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/reference/import_file_ui.html b/reference/import_file_ui.html new file mode 100644 index 0000000..1571659 --- /dev/null +++ b/reference/import_file_ui.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/reference/index.html b/reference/index.html index 5754b36..72ef037 100644 --- a/reference/index.html +++ b/reference/index.html @@ -94,6 +94,12 @@
gsub wrapper for piping with default values for separator substituting
+ columnSelectInput() + +
+
A selectizeInput customized for data frames with column labels
+
+ contrast_text()
@@ -130,7 +136,7 @@
Data correlations evaluation module
- plot_ridge() create_plot() plot_hbars() plot_violin() plot_scatter() plot_sankey() + plot_ridge() create_plot() plot_hbars() plot_violin() plot_scatter() sankey_ready() plot_sankey()
Title
@@ -154,6 +160,12 @@
Default data parsing
+ drop_empty_event() + +
+
Drop empty events from REDCap export
+
+ factorize()
@@ -208,6 +220,24 @@
GGplot default theme for plotting in Shiny
+ grepl_fix() + +
+
Matches pattern to vector based on match type
+
+ + import_file_ui() import_file_server() + +
+
Import data from a file
+
+ + import_delim() + +
+
Wrapper of data.table::fread to import delim files with few presets
+
+ index_embed()
@@ -235,7 +265,7 @@ is_valid_redcap_url() -
Title
+
Test if url is valid format for REDCap API
is_valid_token() @@ -346,10 +376,16 @@
Remove NA labels
- sankey_ready() + repeated_instruments()
-
Readying data for sankey plot
+
Get names of repeated instruments
+
+ + selectInputIcon() + +
+
Create a select input control with icon(s)
shiny_freesearcheR() @@ -406,12 +442,24 @@
Modified from the datamods pacakge
+ vectorSelectInput() + +
+
A selectizeInput customized for named vectors
+
+ vertical_stacked_bars()
Vertical stacked bar plot wrapper
+ wide2long() + +
+
Alternative pivoting method for easily pivoting based on name pattern
+
+ write_quarto()
diff --git a/reference/is_valid_redcap_url.html b/reference/is_valid_redcap_url.html index e8f2cb5..b4570f2 100644 --- a/reference/is_valid_redcap_url.html +++ b/reference/is_valid_redcap_url.html @@ -1,5 +1,5 @@ -Title — is_valid_redcap_url • freesearcheR +Test if url is valid format for REDCap API — is_valid_redcap_url • freesearcheR Skip to contents @@ -30,13 +30,13 @@
-

Title

+

Test if url is valid format for REDCap API

@@ -49,19 +49,25 @@
url
-
+

url

+
+

Value

+

logical

+

Examples

url <- c(
   "www.example.com",
-  "http://example.com",
-  "https://redcap.your.inst/api/"
+  "redcap.your.inst/api/",
+  "https://redcap.your.inst/api/",
+  "https://your.inst/redcap/api/",
+  "https://www.your.inst/redcap/api/"
 )
 is_valid_redcap_url(url)
-#> [1] FALSE FALSE  TRUE
+#> [1] FALSE FALSE  TRUE  TRUE  TRUE
 
+
+

Value

+

logical

+

Examples

diff --git a/reference/line_break.html b/reference/line_break.html index 1db3aff..e0d3a43 100644 --- a/reference/line_break.html +++ b/reference/line_break.html @@ -41,18 +41,39 @@

Usage

-
line_break(data, lineLength = 20)
+
line_break(data, lineLength = 20, fixed = FALSE)

Arguments

-
lineLength
-
+
data
+

string

+ + +
lineLength
+

maximum line length

+ + +
fixed
+

flag to force split at exactly the value given in lineLength. +Default is FALSE, only splitting at spaces.

+
+

Value

+

character string

+
+
+

Examples

+
"Lorem ipsum... you know the routine" |> line_break()
+#> [1] "Lorem ipsum... you\nknow the routine"
+paste(sample(letters[1:10], 100, TRUE), collapse = "") |> line_break(fixed=TRUE)
+#> [1] "caahdfjbagdgcagcgggcbfadgdgafjibiiaaccjiehcafjibhfjdicgbcjdfijbjiejedbbdbejdhbachfijieffaghcjjjjchda"
+
+
diff --git a/reference/plot_sankey_single-1.png b/reference/plot_sankey_single-1.png index d55f926..6c09988 100644 Binary files a/reference/plot_sankey_single-1.png and b/reference/plot_sankey_single-1.png differ diff --git a/reference/plot_sankey_single-2.png b/reference/plot_sankey_single-2.png index 427752a..bd0e3f0 100644 Binary files a/reference/plot_sankey_single-2.png and b/reference/plot_sankey_single-2.png differ diff --git a/reference/plot_sankey_single.html b/reference/plot_sankey_single.html index cdf25ea..8a68137 100644 --- a/reference/plot_sankey_single.html +++ b/reference/plot_sankey_single.html @@ -41,15 +41,24 @@

Usage

-
plot_sankey_single(data, x, y, color.group = "x", colors = NULL)
+
plot_sankey_single(data, x, y, color.group = c("x", "y"), colors = NULL, ...)

Arguments

-
colors
-
+
color.group
+

set group to colour by. "x" or "y".

+ + +
colors
+

optinally specify colors. Give NA color, color for each level +in primary group and color for each level in secondary group.

+ + +
...
+

passed to sankey_ready()

diff --git a/reference/possible_plots.html b/reference/possible_plots.html index 5e438c2..4f840ec 100644 --- a/reference/possible_plots.html +++ b/reference/possible_plots.html @@ -70,7 +70,7 @@ default_parsing() |> dplyr::select("mpg") |> possible_plots() -#> [1] "Violin plot" "Ridge plot" "Scatter plot" +#> [1] "Violin plot" "Scatter plot"