-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not allow NA
as column name
#316
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #316 +/- ##
=======================================
Coverage 67.70% 67.71%
=======================================
Files 34 34
Lines 8897 8898 +1
=======================================
+ Hits 6024 6025 +1
Misses 2873 2873
Continue to review full report at Codecov.
|
You just want to know, if the string is imported as "NA"? If written, is is converted into a The position in the shared string is a 0 index, matching the value of I know that feeling in |
You could look into |
Considered that. Not sure if it's that's to best. There's no requirement for data in sheets to be unique, so the x <- data.frame(x = 1)
x <- cbind(x, x)
x
#> x x
#> 1 1 1
str(x)
#> 'data.frame': 1 obs. of 2 variables:
#> $ x: num 1
#> $ x: num 1 Created on 2022-01-11 by the reprex package (v2.0.1) I've seen plenty of workbooks with repeated column names. Maybe something a little nicer? x <- c(NA, "a", "b", NA, "b", "a", NA)
make.names(x)
#> [1] "NA." "a" "b" "NA." "b" "a" "NA."
make.names(x, unique = TRUE)
#> [1] "NA." "a" "b" "NA..1" "b.1" "a.1" "NA..2"
clean_na_names <- function(x) {
w <- which(is.na(x))
for (i in w) {
x[w] <- paste0("NA..", w)
}
x
}
clean_na_names(x)
#> [1] "NA..1" "a" "b" "NA..4" "b" "a" "NA..7" Created on 2022-01-11 by the reprex package (v2.0.1) What I'm worried about is disharmony between reading and writing though. Maybe warnings/controls for reading a workbook as a |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Resolves #292
@JanMarvin do you know how we can tell if the
NA
is converted to"NA"
in the sheet data?The change is in
writeData
so it should have an effect inbuildWorkbook()
. Just couldn't get my head around whatwriteData()
andWorkbook$writeData()
were doing.