# NOT RUN {
# Create a dataframe
soccer.worldcups <- data.frame(list(year=c(2014, 2010, 2006),
location=c("Brazil", "South Africa", "Germany"),
goals_scored=c(171, 145, 147),
average_goals=c(2.7, 2.3, 2.4),
average_attendance=c(57918, 49669,52491)),
stringsAsFactors = FALSE)
# Convert to XML with the fields (i.e. dataframe variables/columns) stored in XML tags
xml <- df_to_xml(soccer.worldcups, fields="tags", record.tag = "worldcup")
# Convert to XML with the fields (i.e. dataframe variables/columns) stored in attributes
xml <- df_to_xml(soccer.worldcups, fields="tags", record.tag = "worldcup")
# }
Run the code above in your browser using DataLab