1

I have to save data from the server to my desktop. The size of data is in TB. I connect to server using library(RMySQL). And created a database by following command,

db <- src_mysql(host = "192.100.XX.XX", db = "aaa", user = "bbb", password  = "sss")

con <- dbConnect(dbDriver("MySQL"), host="192.100.XX.XX",
            db="aaa", user="bbb", password="sss")
dbListTables(con)

dbGetQuery(con,"describe daily_stocks")

stocks <- dbGetQuery(con, "SELECT code, company, daily_stocks")

I will save objects in rda file to keep it with me. Is there anyway to know size of rda file or data before saving it. It might crash my laptop. I am fairly new to R and SQL. Is there better way to download data from server in laptop without crashing it. Thanks in advance.

  • 2
    Maybe try: `object.size(stocks)` ? – zx8754 May 29 '19 at 09:41
  • 1
    Possible duplicate of [Is there a way to guess the size of data.frame based on rows, columns and variable types?](https://stackoverflow.com/questions/31591051/is-there-a-way-to-guess-the-size-of-data-frame-based-on-rows-columns-and-variab) – Hector Haffenden May 29 '19 at 09:42
  • Related https://stackoverflow.com/questions/1395270/determining-memory-usage-of-objects – zx8754 May 29 '19 at 09:43

0 Answers0