Turns cell formatting into annotations for values in the target row.

annotate_mf(xlfilepath, orig, new)

Arguments

xlfilepath

Path to a single-sheet spreadsheet file (xls or xlsx).

orig

Variable to annotate formatting in.

new

Name of new variable with cell formatting pasted as a string.

Value

A tibble with a new column with meaningful formatting embedded as text.

Details

At this point, only four popular approaches for meaningful formatting (bold, italic, underline, cell highlighting) are hardcoded in the function. `sheets`, `skip`, and `range` arguments for spreadsheet input are not supported. The HTML code of the fill color used for cell highlighting is also appended in the output. Ensure the data in the spreadsheet are rectangular before running.

Examples

example_spreadsheet <- system.file("extdata/dog_test.xlsx", package = "unheadr") annotate_mf(example_spreadsheet, orig = Task, new = Task_annotated)
#> # A tibble: 11 x 3 #> Task Task_annotated Score #> <chr> <chr> <dbl> #> 1 Outdoor activities (bolded, highlighted-FFFFF200) Outdoor a… 7.67 #> 2 Walks on a loose leash witho… Walks on a loose leash without pulling 7 #> 3 Walks without chasing bicycl… Walks without chasing bicycles, animals,… 6 #> 4 Greets friends and strangers… Greets friends and strangers without jum… 10 #> 5 Home behavior (bolded, highlighted-FFFFF200) Home beha… 8.5 #> 6 Moves location when directed… Moves location when directed without gro… 9 #> 7 Does not rush through doorwa… Does not rush through doorways 8 #> 8 General social skills and ob… (bolded, highlighted-FFFFF200) General s… 7 #> 9 Can play or interact appropr… Can play or interact appropriately with … 7 #> 10 Can be groomed or handled wi… Can be groomed or handled without squirm… 8 #> 11 Stops barking on command Stops barking on command 6