Closed VCF closed 5 years ago
Ok, I see one problem. I told you to use \
for escapes, but that seems to have been bad advice. You should remove all slashes (eg Frozen\, Algae
) and instead quote the whole value (eg "Frozen, Algae"
).
Per our discussion, you can also remove the $Area
column - you will be using R to calculate that dynamically from your data.
Alright, things are improving with 706e7a4, but you still have some problems. Let's open a new issue to deal with them.
It turns out you do have some issues with your data. If you look at the
str()
report, you'll see something like this:We'll get to the "Factor" thing in a bit - that's not so much an issue as a fundamental, but confusing, part of R. You now have a "data.frame" (which I'll call "DF") holding your hard-won data. DFs have a few features / rules:
read.table
will refuse to load the data (so your data isn't ragged)Let's start by dealing with the Factor issue. We can talk about what factors are later, but for now just know that you don't want them here. You want to update your
read.csv
so that strings are not automatically converted to factors. Look at?read.csv
to see how to setstringsAsFactors
toFALSE
and then push the changes.