R allows us to conduct a wide variety of data analytics. Everything we have done with pandas
in Python, we are able to do in R as well.
Take a look at the following code:
df = read.csv(file=file.choose(), header=T, fill=T, sep=",", stringsAsFactors=F)
file.choose()
means there will be a new window that will allow you to select the data file to be opened. header=T
means it will read the header. fill=T
means it will fill in NaN for any undefined or missing data values. Finally, sep=","
means that it knows how to distinguish between the different data values in the .csv
file. In this case, they are all separated by commas. stringsAsFactors
tells it to treat all the string values as strings, not as factors. This allows us to replace values in the data later on.
Now, you should see this:
Figure: Screenshot of output you will obtain
Press Enter. You should see something like this if you are on Windows:
Regardless of the OS, you should see a window that opens up to allow you to choose a...