Created
July 25, 2019 00:20
-
-
Save erykml/0c7cf1a16cb50ac056f70c0df5c18519 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # specify size | |
| n <- 1e7 | |
| # generate data.table with random data | |
| data_dt <- data.table(id=stri_rand_strings(n, 3, pattern = "[A-Z]"), | |
| product=stri_rand_strings(n, 3, pattern = "[A-Z]"), | |
| date=sample(seq(as.Date('2019/01/01'), as.Date('2019/04/01'), by="day"), n, replace=TRUE), | |
| amount=sample(1:10000,n,replace=TRUE), | |
| price=rnorm(n, mean = 100, sd = 20)) | |
| data_dt_lazy <- lazy_dt(data_dt) | |
| # convert to data.frame | |
| data_df <- as.data.frame(data_dt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment