-
Notifications
You must be signed in to change notification settings - Fork 52
Closed
Labels
types 🏭Cell and column typesCell and column types
Description
Specifying na
explicitly to not convert the default value of "" to NA, still converts "" to NA's once read into R.
I have created a public spread sheet( 1dyCsWgVu72w3yYA6BdmFDqMTrf2OBxawwD_ZBPN7JF8
) containing:
https://docs.google.com/spreadsheets/d/1dyCsWgVu72w3yYA6BdmFDqMTrf2OBxawwD_ZBPN7JF8
col1 | col2 | col3 |
---|---|---|
1 | a | NA |
2 | b | missing |
3 | c | |
4 | d | hello |
5 | e | w |
gsheet_id <-"1dyCsWgVu72w3yYA6BdmFDqMTrf2OBxawwD_ZBPN7JF8"
googlesheets4::read_sheet(gsheet_id, na = c("NA", "missing"))
#> Reading from "googlesheets4_bug"
#> Range "Sheet1"
#> # A tibble: 5 x 3
#> col1 col2 col3
#> <dbl> <chr> <chr>
#> 1 1 a NA
#> 2 2 b NA
#> 3 3 c NA
#> 4 4 d hello
#> 5 5 e w
Was expecting similar behaviour to readr
, where "" is retained.
csv_txt <- "col1,col2,col3
1,a,NA
2,b,missing
3,c,
4,d,hello
5,e,w"
readr::read_delim(csv_txt, na = c("missing", "NA"), delim = ",")
#> # A tibble: 5 x 3
#> col1 col2 col3
#> <int> <chr> <chr>
#> 1 1 a NA
#> 2 2 b NA
#> 3 3 c ""
#> 4 4 d "hello"
#> 5 5 e "w"
Metadata
Metadata
Assignees
Labels
types 🏭Cell and column typesCell and column types