Rstudio read csv file leading to the last column/variable in NA

Hello,

I’ve got an issue during reading csv file using Rstudio (both latest versions). After importing data into Rstudio, all values of the last column/variable became NA. When reading the same data using R, data showed normally. When I converted the data set to RData file, Rstudio showed data normally.
Does anyone know the reason why?

Much appreciate any your comments and suggestions.
-Thuan

Hi!

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

Are you using read.csv? What messages do you get? Probably you just have an extra column in your data file.

Thanks Woodward and Andres,

I found that Rstudio use read_csv() that read csv flies in incorrect way.
I typed read.csv() in Rstudio environment as usually use in R software, it shows results normally.

I think that read_csv() from menu bar have had an issue that needs to be considered.

Kind regards,
-Thuan

I usually use read_csv() in a script. Sometime I need to fiddle with the options to get the right result.

read.csv and read_csv are slightly different.