I'm trying to manipulate the following dataset (From FBI crime statistics) https://www.ucrdatatool.gov/Search/Crime/Local/RunCrimeJurisbyJuris.cfm . It is in .CSV format. Once downloaded, using R, I've used the following commands
a=read.csv("RunCrimeJurisbyJuris.csv",header=FALSE);
Then, we remove the stuff at the top, and the n/a at the end.
b=a[-c(1:5),-c(24,25)];
Which, when viewed, looks proper. For example, b[1,] produces the list of the first row, as it should However, when I try to name headers, for example,
names(b)=b[1,],
Produces what I THINK is a list of the levels. Why is it doing this?
I get some very confusing stuff going on. I think this is due to when I look at, for example, b[1,1], instead of just getting "Year", I get
Year
41 Levels: ...
In addition, using view(b) produces an excel like representation that looks like a normal data set. It's been awhile since I've used R, and if I recall correctly, I've never seen this behavior before. In addition, I think these "Levels" are the source of the error. What am I doing wrong?
ABOVE IS SOLVED
Now, when I pull members, say, b["Population"], each element looks like this (number)" ". Is there a way to remove these " ", and if i pull a specific number, say b[3,2], it has the form "number". This dataset is quite frustrating (: .