I think your principal problem was that you were outputting the factor index for each ISO3 code instead of the ISO3 codes themselves. Thus you had 42 for China because China is the 42nd country in the map. The as.character() below sorts that.
So making minor edits to your & Barry's code gives the code below which I think does what you want.
Replace 'first' with 'pts' in the final 4 lines to run for your whole dataset.
coords2country = function(points)
{
library(rworldmap)
countriesSP <- getMap(resolution='low')
#I assume that points have same projection as the map
pointsSP = SpatialPoints(points, proj4string=CRS(proj4string(countriesSP)))
# use 'over' to get indices of the Polygons object containing each point
indices = over(pointsSP, countriesSP)
#as.character(indices$ADMIN) # return the ADMIN names of each country
as.character(indices$ISO3) # return the ISO3 code
#as.character(indices$ISO_N3) # return the ISO numeric code
}
library(sp)
pts=read.table("points.csv",head=TRUE,sep=",")
pts=subset(pts,!is.na(lon)) # just take the good ones to save NA faffing
coordinates(pts)=~lon+lat
first = pts[1:100,] # take first 100 for starters
cc = coords2country(first)
plot(first,pch=".")
text(coordinates(first),label=cc)
firstPlusISO3 <- cbind(coordinates(first),cc)