I am having an issue creating a linear model from a data frame I have stored because the independent variable contains comma-separators (i.e 314,567.5 vs 314567.4). How could I use read.csv
or readr
to read a data set and return a data frame without the commas in that specific column?
Asked
Active
Viewed 379 times
1

enzymeR
- 21
- 1
- 4
-
Use `preetyNum` after reading the file. Please see [here](http://stackoverflow.com/questions/30648323/how-to-separate-thousands-with-space/30648432#30648432) – user227710 Jun 12 '15 at 15:57
-
What separators does your .csv file use? – C_Z_ Jun 12 '15 at 16:04
1 Answers
0
The answer to the commas question is here.
However, you first need to read the file into R
. Although it can be a bit of a pain, I've found that read.fwf
is often the best solution in these situations, unless you have a different delimiter, such as a pipe, |
, in which case read.delim
would probably be best.

Community
- 1
- 1

Daniel Anderson
- 2,394
- 13
- 26