Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Data Science
  3. Question
Data Science

How to make write a data frame to a csv file?

Asked by Anushri Singh May 18, 2021 1.5K views 1 answer
Share

About this question

 I am forming a data frame where one column is named as a major, and the second column is the list of courses in the major.

df <- data.frame(majors = majors)

df[, "courses"] <- courses, where majors are a vector and courses, is a list of lists. When I try to write using

write.csv(df, "Majors_and_Courses.csv", row. names = FALSE)

I get an error:

"Error in write.table(df, "Majors_and_Courses.csv", row.names = FALSE, : unimplemented type 'list' in 'EncodeElement'"

Your answer

1 Answer

More Data Science discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Data Science Blogs

Guides, tips and career advice on Data Science from JanBask experts.