You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# create a new dataframe with only the necessary columns, and switching all field names to lower-case Change the first parameter of select() to the name of your data frame (from importing SPSS file) and then list any of the columns you want to keep
con <- dbConnect(RPostgres::Postgres(), dbname='database name', host='database host', user='user', password='password') #connect to the database. Change the database name, host, user, and password to your own
dbListTables(con) #list the database tables, to check if the database is working
dbWriteTable(con,'dhshh',dhshh, overwrite=TRUE) #import the table to the database and overwrite existing one. con is the database connection, 'dhshh' is the name of the new table, and dhshh is the data frame to be imported