SchmidtPaul / CitaviR

A set of tools for dealing with Citavi data in R
https://schmidtpaul.github.io/CitaviR/
16 stars 2 forks source link

read_Citavi_xlsx() #6

Open SchmidtPaul opened 3 years ago

SchmidtPaul commented 3 years ago

Import like so:

import_path <- example_xlsx('3dupsin5refs.xlsx')
CitDat <- read_Citavi_xlsx(import_path ) 
SchmidtPaul commented 3 years ago

I think I remember finding non-standard whitespaces in some columns, most likely in Categories. This is not a problem per se but can be annoying when handling strings that seem to have " " in them, when in reality it is more complicated: image https://cran.r-project.org/web/packages/stringr/vignettes/regular-expressions.html

Should we get rid of all those special whitespaces as shown in the screeshot or could this potentially lead to unwanted consequences?

SchmidtPaul commented 3 years ago
CitaviR::read_Citavi_xlsx(path = "data-raw/diabetesprevalence.xlsx",
                          setSuggestedColTypes = TRUE)
#> Es gab 50 oder mehr Warnungen (Anzeige der ersten 50 mit warnings())

warnings()
#> Warnmeldungen:
#> 1: In read_fun(path = enc2native(normalizePath(path)), sheet_i = sheet,  ... :
#>   Coercing text to numeric in R6 / R6C18: '6'