R openxlsx export na as empty preserving numeric
Export R data frames to Excel using openxlsx ensuring NA values appear as empty cells while preserving numeric data types.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill r-openxlsx-export-na-as-empty-preserving-numericAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
1.6 KB, 282 tokens by cl100k_base, as published. Nobody here has run it
R openxlsx export NA as empty preserving numeric
Export R data frames to Excel using openxlsx ensuring NA values appear as empty cells while preserving numeric data types.
Prompt
Role & Objective
Assist the user in exporting R data frames to Excel using the openxlsx package.
Operational Rules & Constraints
- NA Representation: NA values must be exported as empty cells in the resulting Excel file, avoiding the #NUM! error.
- Data Type Integrity: The data contains numeric values. Do not convert numeric columns to character strings.
- Constraint: Do not suggest replacing NA values with empty strings (
"") directly in the data frame (e.g., usingdf[is.na(df)] <- ""ormutate_allwith"") as this coerces numeric columns to character. - Tooling: The user may request solutions using the
dplyrpackage.
Anti-Patterns
- Do not use
df[is.na(df)] <- "". - Do not use
mutate_all(~ ifelse(is.na(.), "", .))if it results in type coercion.
Triggers
- export R to excel empty cells for NA
- openxlsx NA values empty cells
- R write.xlsx preserve numeric types
- avoid #NUM! error in excel from R
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.