I am trying to export the following dataframe as an excel file but I keep getting this error:
Error in x[is.na(x)] <- na.string : replacement has length zero
I believe it is due to NA values causing this error so I tried to replace them with "NULL" but only when I convert my dataframe into a list.
When I try replacing NA with NULL I get:
Assigned data `"NULL"` must be compatible with existing data.
i Error occurred for column `If you feel comfortable, please explain the answer to the last question..y`.
x Can't convert <character> to <list>.
so there is a column that is causing all this.
it contains cells like "c(NA NA NA)
how can I correct this columns format so I can finally print out my dataframe.
I have tried reprexing my dataframe but unfortunately I get R code Execution error
R CODE EXECUTION ERROR
My code and part of the dataframe :
my code:
dfTranformedWithEmployeeProfile2 %>% replace_na(list(dfTranformedWithEmployeeProfile2 = "NULL"))
dfTransformedWithEmployeeProfile3 = dfTranformedWithEmployeeProfile2[is.na(dfTranformedWithEmployeeProfile2)]<-"NULL"
write.xlsx(dfTranformedWithEmployeeProfile2, outputFilepath)
rm(list = ls())
sort(names(df))
print(dfTranformedWithEmployeeProfile2)
dp_set_max_rows(6)
exampleDF = head(dfTranformedWithEmployeeProfile2,5)
head(exampleDF)
dpasta(exampleDF)
exampleDF <- tibble::tribble(
~Employee.ID, ~Workflow.Step, ~I.feel.my.objectives.are.challenging.but.achievable., ~It.was.easy.to.update.my.objectives., ~I.feel.motivated.by.my.objectives., ~I.understand.what.s.expected.of.me.in.terms.of.my.performance., ~If.you.feel.comfortable..please.explain.the.answer.to.the.last.question..y, ~Is.there.anything.else.you.would.like.to.share..y,
28999, "Manage Objectives (Default Definition) step c - Complete Questionnaire", "Strongly agree", "Strongly agree", "Strongly agree", "Strongly agree", NULL, NULL,
26050, "Manage Objectives (Default Definition) step c - Complete Questionnaire", "Strongly agree", "Disagree", "Strongly agree", "Neither agree nor disagree", The objectives "above" me (at Centrica and DTS level) could be better quantified, so that I knew exactly which KPIs I was expected to influence., The Workday experience is awful. The UI is ugly and the process seems to have been designed by someone who has never used it.,
125307, "Manage Objectives (Default Definition) step c - Complete Questionnaire", "Agree", "Neither agree nor disagree", "Agree", "Strongly agree", c(NA, NA, NA), NULL,
107986, "Manage Objectives (Default Definition) step c - Complete Questionnaire", "Agree", "Disagree", "Neither agree nor disagree", "Agree", c(NA, NA, NA), NA,
127131, "Manage Objectives (Default Definition) step c - Complete Questionnaire", "Strongly agree", "Strongly agree", "Strongly agree", "Strongly agree", c(NA, NA, NA), NA
)
head(exampleDF)