How to treat NAs introduced by coersion?

Hello, I faced on this error. Actually, there are many cases and solutions on internet to deal with that error, reproducing an example with an insertation of some characters...but I couldn't find the solution dealing with error case that occurred with existing csv file.

I downloaded this csv file on somewhere and found it contains character forms like as following :

Since I wanted to calculate using these, I tried to convert it with 'as.integer', but got that error.

I looked into the types of variables and they were as followings :
image

So what should I do to convert those character things into integer? Some examples are explaining using 'gsub', but I even don't know which character I have to eliminate...At first I tried to use 'gsub("-", "", data)', but it didn't work. Please help me.

"NAs introduced by coercion" isn't an error. It's just a warning to let you know that some strings don't represent numbers. Those are correctly changed to NA.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.