0

When importing my data.set to RStudio I keep getting some name changes in variables. I was hoping someone knows why or how to fix it? Screenshot It is the variables that are now starting with "\r\n". Thanks for any tips!

  • 1
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. Pictures of code and data aren't that helpful. What does that actual data look like? How are you importing the data exactly? – MrFlick Dec 08 '21 at 09:20
  • perhaps that you have line-breaks (e.g. return) in the data you are reading in (see https://stackoverflow.com/questions/1761051/difference-between-n-and-r for a little about what those characters are) - we could do with some code and example data to create a reproducible example and see what your are actually doing though – rg255 Dec 08 '21 at 09:20

1 Answers1

0

You can try to use the "Import data" option when browsing files. That will allow to preview the data or data table before exporting. There it will show the class of each variable (if that is your problem) which you can also change from the same preview tool. Once you are happy, the code needed for the data to quit imported appears in a window below which you can directly import or just copy to your own script for using it later.

I don't know if that is your problem, but may help!

Also I would try to chose names or column titles without spaces for this matter, that will be easier to code later

MonicaOrt
  • 46
  • 4