. Advertisement .
..3..
. Advertisement .
..4..
I am tired of fixing the problem: error in file(file, “rt”) : invalid ‘description’ argument in the r; even if I get the reference from another forum, it still returns an error:
Error in file(file, "rt") : invalid 'description' argument
To identity the problem, I will show you the detail here:
> df = data.frame(A = c(“A”,”B”,”C”,”D”,”E”,”F”,”G”),
+ B = c(1, 2, 3, 4, 5, 6, 7),
+ C = c(2, 3, 4, 5, 6, 7, 8),
+ D = c(2, 4, 6, 8,10,14,16))
> df
A B C D
1 A 1 2 2
2 B 2 3 4
3 C 3 4 6
4 D 4 5 8
5 E 5 6 10
6 F 6 7 14
7 G 7 8 16
Try it and let us know how it goes.
The cause: There is an argument in the read.csv2 function when the paste0 function is embedded. This is what causes the error because you cannot access more than one file by this way.
Solution: Using separately two functions with a for loop instead of embedding them so that the read.csv2 function can read each CSV file separately.
Your file path is not working correctly. The full vector ID =c (1:332) is being passed to the file path name. This line can be changed if your files are named 1.csv.csv. 3.csv., etc.
To
You can either leave it out or modify the id input for your function.