AutoSkill 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.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/r-openxlsx-export-na-as-empty-preserving-numeric" ~/.claude/skills/ecnu-icalk-autoskill-r-openxlsx-export-na-as-empty-preserving-numeric && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/r-openxlsx-export-na-as-empty-preserving-numeric/SKILL.mdsource content
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., using""
ordf[is.na(df)] <- ""
withmutate_all
) as this coerces numeric columns to character."" - Tooling: The user may request solutions using the
package.dplyr
Anti-Patterns
- Do not use
.df[is.na(df)] <- "" - Do not use
if it results in type coercion.mutate_all(~ ifelse(is.na(.), "", .))
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