if (FALSE) {
path <- "some/path"
# Create a database
db <- create_db(path = path, db_name = "my_db")
# Import all JSON files in the current directory
import(path = path, db = db)
# Import all JSON files in the current directory, but do so sequentially
import(path = path, db = db, batch_size = 1)
# Import all JSON files in the current directory, but only the accelerometer data
import(path = path, db = db, sensors = "accelerometer")
# Import all JSON files in the current directory, but only the accelerometer and gyroscope data
import(path = path, db = db, sensors = c("accelerometer", "gyroscope"))
# Remember to close the database
close_db(db)
}
Run the code above in your browser using DataLab