I am interested in creating a csv or similar Excel-compliant file with data that I scraped from the web by using R. So far I stored the data by doing this:
require(textreadr)
spiegel <- read_html("http://www.spiegel.de/schlagzeilen/")
headlines <- html_nodes(spiegel, ".headline-date")
mydata <- html_text(headlines)
The variable "mydata" now contains the following:
[1] "(Wirtschaft, 00:00)" "(Kultur, 23:42)" "(Sport, 23:38)" "(Politik, 23:16)"
[5] "(Sport, 22:29)" "(Panorama, 21:56)" "(Sport, 21:39)" "(Sport, 21:25)"
[9] "(Sport, 20:23)" "(Politik, 20:21)" "(Politik, 20:09)" "(Wissenschaft, 19:41)"
When I use write.csv now I want to create two columns, the first one should contain the categories like "Wirtschaft, Sport, etc." and the second one the time. Can someone tell me how to do this specifically in this case?