-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathu.r
More file actions
31 lines (30 loc) · 665 Bytes
/
u.r
File metadata and controls
31 lines (30 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
df <- data.frame(carname = rownames(mtcars),
mtcars,
row.names = NULL)
sql_command <- "CREATE TABLE cartable
(
carname character varying NOT NULL,
mpg numeric(3,1),
cyl numeric(1,0),
disp numeric(4,1),
hp numeric(3,0),
drat numeric(3,2),
wt numeric(4,3),
qsec numeric(4,2),
vs numeric(1,0),
am numeric(1,0),
gear numeric(1,0),
carb numeric(1,0),
CONSTRAINT cartable_pkey PRIMARY KEY (carname)
)
WITH (
OIDS=FALSE
);
ALTER TABLE cartable
OWNER TO openpg;
COMMENT ON COLUMN cartable.disp IS '
';"
# sends the command and creates the table
dbGetQuery(con, sql_command)
df <- Quandl("LPPM")
head(df,5)