Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
| library(XML) | |
| library(data.table) | |
| library(lubridate) | |
| library(ggplot2) | |
| library(stringr) | |
| library(leaflet) | |
| # import and divide xml file ---------------------------------------------- | |
| # import |
| import xmltodict | |
| import json | |
| import numpy as np | |
| import pandas as pd | |
| #Parse XML to dictionary | |
| with open('export.xml') as f: | |
| health = xmltodict.parse(f.read()) | |
| #Extract desired data and turn into a Data Frame |
| int main(int argc, char **argv) { | |
| struct SoundIo *soundio = soundio_create(); | |
| if (!soundio) { | |
| fprintf(stderr, "out of memory\n"); | |
| return 1; | |
| } | |
| int err; | |
| if ((err = soundio_connect(soundio))) { | |
| fprintf(stderr, "unable to connect: %s\n", soundio_strerror(err)); | |
| soundio_destroy(soundio); |
| library(dplyr) | |
| library(ggplot2) | |
| library(lubridate) | |
| library(XML) | |
| #load apple health export.xml file | |
| xml <- xmlParse("C:\\Users\\praskry\\Desktop\\apple_health_data\\export.xml") | |
| #transform xml file to data frame - select the Record rows from the xml file | |
| df <- XML:::xmlAttrsToDataFrame(xml["//Record"]) |
| require("RSQLite") | |
| # Set up database | |
| drv <- dbDriver("SQLite") | |
| tfile <- "Iowa.db" | |
| con <- dbConnect(drv, dbname = "Iowa.db") | |
| dbWriteTable(con, "data1", as.data.frame(data1)) | |
| dbDisconnect(con) |