Created
March 12, 2019 23:05
-
-
Save krlmlr/1c23936abc6d55734e3d186ae5849254 to your computer and use it in GitHub Desktop.
Reprex for https://stackoverflow.com/q/53807654/946850
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RSQLite) | |
conn <- dbConnect(SQLite()) | |
dbExecute(conn, " | |
CREATE TABLE IF NOT EXISTS `sim` ( | |
`time` TEXT, | |
`subject` INTEGER, | |
`encounter` INTEGER, | |
`location` INTEGER, | |
`temp` REAL, | |
`hr` INTEGER, | |
`sbp` INTEGER, | |
`dbp` INTEGER, | |
`rr` INTEGER, | |
`spo2` INTEGER, | |
`o2Log` INTEGER, | |
`avpu` TEXT, | |
`gcs` INTEGER, | |
`concern` INTEGER | |
); | |
") | |
dbExecute(conn, " | |
INSERT INTO `sim` (time,subject,encounter,location,temp,hr,sbp,dbp,rr,spo2,o2Log,avpu,gcs,concern) VALUES ('2010-01-01 08:00',2,1,1,NULL,97,113,66,12,100,1,'A',15,0); | |
") | |
dbExecute(conn, " | |
INSERT INTO `sim` (time,subject,encounter,location,temp,hr,sbp,dbp,rr,spo2,o2Log,avpu,gcs,concern) VALUES ('2010-01-01 08:15',2,1,1,36.2,95,110,62,12,100,1,'A',15,0); | |
") | |
dbExecute(conn, " | |
INSERT INTO `sim` (time,subject,encounter,location,temp,hr,sbp,dbp,rr,spo2,o2Log,avpu,gcs,concern) VALUES ('2010-01-01 08:30',2,1,1,36.2,84,90,61,12,100,1,'A',15,0); | |
") | |
dbExecute(conn, " | |
INSERT INTO `sim` (time,subject,encounter,location,temp,hr,sbp,dbp,rr,spo2,o2Log,avpu,gcs,concern) VALUES ('2010-01-01 08:45',2,1,1,36.2,80,96,55,12,100,1,'A',15,0); | |
") | |
dbExecute(conn, " | |
INSERT INTO `sim` (time,subject,encounter,location,temp,hr,sbp,dbp,rr,spo2,o2Log,avpu,gcs,concern) VALUES ('2010-01-01 09:00',2,1,1,36.2,77,88,51,12,100,0,'A',15,0); | |
") | |
dbExecute(conn, " | |
INSERT INTO `sim` (time,subject,encounter,location,temp,hr,sbp,dbp,rr,spo2,o2Log,avpu,gcs,concern) VALUES ('2010-01-01 09:15',2,1,1,36.3,75,91,50,12,100,0,'A',15,0); | |
") | |
dbExecute(conn, " | |
INSERT INTO `sim` (time,subject,encounter,location,temp,hr,sbp,dbp,rr,spo2,o2Log,avpu,gcs,concern) VALUES ('2010-01-01 09:30',2,1,1,36.3,76,92,52,12,100,1,'A',15,0); | |
") | |
dbExecute(conn, " | |
INSERT INTO `sim` (time,subject,encounter,location,temp,hr,sbp,dbp,rr,spo2,o2Log,avpu,gcs,concern) VALUES ('2010-01-01 10:00',2,1,1,36.4,73,91,52,12,100,0,'A',15,0); | |
") | |
dbExecute(conn, " | |
INSERT INTO `sim` (time,subject,encounter,location,temp,hr,sbp,dbp,rr,spo2,o2Log,avpu,gcs,concern) VALUES ('2010-01-01 10:30',2,1,1,36.5,71,91,51,12,100,1,'A',15,0); | |
") | |
dbExecute(conn, " | |
INSERT INTO `sim` (time,subject,encounter,location,temp,hr,sbp,dbp,rr,spo2,o2Log,avpu,gcs,concern) VALUES ('2010-01-01 11:30',2,1,1,36.6,69,92,53,12,100,1,'A',15,0); | |
") | |
dbExecute(conn, " | |
INSERT INTO `sim` (time,subject,encounter,location,temp,hr,sbp,dbp,rr,spo2,o2Log,avpu,gcs,concern) VALUES ('2010-01-01 12:30',2,1,1,36.6,76,118,63,14,100,1,'A',15,0); | |
") | |
dbExecute(conn, " | |
INSERT INTO `sim` (time,subject,encounter,location,temp,hr,sbp,dbp,rr,spo2,o2Log,avpu,gcs,concern) VALUES ('2010-01-01 13:00',2,1,1,NULL,NULL,NULL,NULL,NULL,NULL,1,'A',15,0); | |
") | |
dbReadTable(conn, "sim")[12, ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment