I exported data using the write.csv function, but the table gets truncated. The original table has 4,073,561 rows, but the csv file has about 700,000 rows. Please how do I rectify this?
How have you checked the number of rows in the .csv file?
We need reproducible example (reprex)
A minimal reproducible example consists of the following items:
A minimal dataset, necessary to reproduce the issue
The minimal runnable code necessary to reproduce the issue, which can be run
on the given dataset, and including the necessary information on the used packages.
Let's quickly go over each one of these with examples:
Minimal Dataset (Sample Data)
You need to provide a data frame that is small enough to be (reasonably) pasted on a post, but big enough to reproduce your issue.
Let's say, as an example, that you are working with the iris data frame
head(iris)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.2…
I just tried exporting a 5,000,000 data.frame to .csv with no problem but it was a very simple one. See the example below.
dat1 <- data.frame(kk = sample(letters, 5000000, replace = TRUE),
zz = sample(1:10, 5000000, replace = TRUE) )
write.csv(dat1, "millions.csv", row.names = FALSE)