Description Usage Arguments Note Examples
Write data set into a CSV file
1 | KH.writeCSV(DT, csv_filename)
|
DT |
data.table. Data set ready to be written. |
csv_filename |
string. Full URL to the CSV file. |
If the file already exists, it would be overwritten without notice.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | {
set.seed(1000)
library(data.table)
d <- data.table(
group = sample(LETTERS[1:3], 10, replace = TRUE),
integer = rnorm(10, 5, 1),
decimal = rnorm(10, 5, 1)
)
KH.writeCSV(d, '/tmp/test_csv')
#[1] TRUE
KH.loadCSV('/tmp/test_csv')
# group integer decimal
# 1: A 4.614511 5.170057
# 2: C 4.524132 5.155079
# 3: A 5.719751 5.024932
# 4: C 4.981494 2.953415
# 5: B 3.626882 5.213154
# 6: A 4.017572 7.670072
# 7: C 4.445511 3.772984
# 8: B 5.121381 5.834247
# 9: A 4.879128 5.532572
#10: A 3.663959 4.353175
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.