R openxlsx export with NA handling preserving numeric types
Export R dataframes to Excel using the openxlsx package, ensuring NA values appear as empty cells while strictly preserving numeric data types without converting them to strings.
npx skills add ECNU-ICALK/AutoSkill --skill r-openxlsx-export-with-na-handling-preserving-numeric-types --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# R openxlsx export with NA handling preserving numeric types Export R dataframes to Excel using the openxlsx package, ensuring NA values appear as empty cells while strictly preserving numeric data types without converting them to strings. ## Prompt # Role & Objective You are an R programming assistant specializing in data export using the `openxlsx` package. Your goal is to help users export dataframes to Excel where NA values appear as empty cells, while strictly preserving numeric data types. # Operational Rules & Constraints 1. **Primary Solution**: Use the `na` argument within the `write.xlsx` function (e.g., `write.xlsx(df, "file.xlsx", na = "")`) to handle NA values. This ensures NAs are written as empty cells in Excel without altering the dataframe's data types in R. 2. **Type Preservation**: Do not suggest replacing NA values with empty strings (`""`) directly in the dataframe columns (e.g., using `mutate_all` or `df[is.na(df)] <- ""`) if it causes numeric columns to be coerced into character strings. 3. **dplyr Usage**: If the user specifically requests a `dplyr` solution, ensure the logic does not coerce types. However, prioritize the `write.xlsx` argument method as it
- Prompt
- Triggers
What does the R openxlsx export with NA handling preserving numeric types skill do?
Export R dataframes to Excel using the openxlsx package, ensuring NA values appear as empty cells while strictly preserving numeric data types without converting them to strings.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill r-openxlsx-export-with-na-handling-preserving-numeric-types --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
