Skip to content
Prev 294666 / 398502 Next

Data read as labels

On May 15, 2012, at 11:13 AM, barb wrote:

            
Sadder and less informative words were never written!

Learn to express in natural language or in code what you were  
expecting rather than use the phrase "doesn't work" which can mean one  
of an almost infinite sources of programming failure.
When I do that, I get a series of comma-separated digit values inside  
strings (because the default setting for the decimal separator is  
period = Punct auf Deutsch if I remember my lessons from 40 years ago,  
"." and not Komma ) so at the end I get:

....
[490] "94801,00"
[491] "85013,00"
[492] "85982,00"
[493] "91213,00"
[494] "98912,00"
[495] "Bemerkung: "
[496] "Methodik: Ab Januar 1993 einschl. der Zusch?tzungen f?r  
nichtmelde- pflichtigen Au?enhandel, die bis Dezember 1992 in den  
Erg?nzungen zum Au?enhandel enthalten sind."

So what is "not working" and what would be "success"? Is this  
successful?

 > aconv <- sub("\\,", ".", a)
 > str(as.numeric(aconv))
  num [1:496] 10716 12897 11330 10930 11485 ...
Warning message:
In str(as.numeric(aconv)) : NAs introduced by coercion
 > as.numeric(aconv[480:494])
  [1] 78645.63 84067.37 98180.37 84252.25 92003.35 88139.63 85664.93  
85138.00 94960.00
[10] 89170.00 94801.00 85013.00 85982.00 91213.00 98912.00
David Winsemius, MD
West Hartford, CT