I am new to the beautiful language of R and currently I am having difficulties understanding the following:
I am loading in a CSV file. This CSV file contains two columns. The first column is a unique ID. The second column is named 'content'. The content column is basically all the readable text from a specific URL.
If I print the content of the first row of the second column I get the following output.
Text[1:1,2:2]
[1] Autoservice Hofra Home \xa0 Home Contact \xa0 Autoservice Hofra \xa0 Home Contact Autoservice Hofra Welkom op onze website \xa0 \xa0LASSA BANDEN DEALER \xa0 Wanneer is mijn auto toe aan een onderhouds inspectie Iedere auto heeft een instructieboekje Dat ligt meestal in het dashboardkastje van uw auto In dat boekje staat hoe en wanneer u de auto onderhoudt Autoservice Hofra Albert Einsteinweg 12 6045 GX Roermond Tel 0654965305 Kleine en grote beurt Bij Autoservice Hofra kun je terecht voor een grote en kleine beurt voor de zomer en winter checks maar ook airco onderhoud Zo zorgen we dat je niet alleen veilig en comfortabel de weg op gaat maar ook nog eens extra lang plezier hebt van je auto \xa0 We vervangen motorolie en het oliefilter vullen de ruitenvloeistof koelvloeistof en remvloeistof bij en houden rekening met de milieutoeslag Een groot deel van de checks die bij een APK worden gedaan komen ook bij de grote beurt aan bod Het is daarom voordelig om deze te combineren De motormanagement van de auto wordt zorgvuldig uitgelezen met diagnose apparatuur waardoor storingen en andere meldingen aan het licht komen \xa0 \xa0 \xa0 Airco Check \xa0Houdt de airco uw auto op de juiste temperatuur Ontwasemt de airco de autoruit slecht En blaast hij nog frisse lucht Doe de Airco Check Ook als het geen zomer is Wij voeren alle voorkomende onderhoudswerkzaamheden uit aan uw auto voor een zeer scherpe prijs Bij een duurdere reparatie wordt er te allen tijde overleg gepleegd met u Daarnaast zijn we in het bezit van de juiste kennis en gereedschappen om alle voorkomende reparaties uit te voeren \xa0\xa0Laat de werkzaamheden uitvoeren wanneer u dat uitkomt Home \xa0 \xa0 Contact
5432 Levels: ...
If I print the type of this first row of the second column, I get the type integer
typeof(Text[1:1,2:2])
[1] "integer"
Could someone explain me why specific column is having a type 'integer' while it is containing characters. I am also confused about the '5432 levels: ...' part. What is meant with 'levels' in R?
Finally, what I want to do is convert each row of the 'content' column into characters so I can apply for example remove all rows which have a length of < 200, my code:
SText <- subset(Text, nchar(as.character(content)) > 200)
Right now I get the error:
Error in type(Text[1:1, 2:2]) : could not find function "type"
How can I solve this problem? Any help and information would be highly appreciated!