0

R numerical list

I wonder how to export the list above to csv or excel? I do not need to keep the data type, but having counts displayed next to Embase.n in a csv/Excel file would be very useful to me. Many thanks for helping me out.

jojo
  • 25
  • 4

1 Answers1

0

From what I see, your list seems to consist of one single value for each element. You can use Jonathan V. Solórzano's way to get a very wide table. Alternatively you can use unlist() to collapse your list into a vector, and create a dataframe and export it.

mylist <- list(Embase.1 = 1, Embase.2 = 0, Embase.3 = 2)
v <- unlist(mylist)
df <- data.frame(Embase = v)
df
#         Embase
#Embase.1      1
#Embase.2      0
#Embase.3      2
write.csv(df, row.names = F)
Ben Toh
  • 742
  • 5
  • 9