[R] cannot read iso639 table

peter dalgaard pdalgd at gmail.com
Thu Sep 13 21:31:37 CEST 2012


On Sep 13, 2012, at 19:42 , Sam Steingold wrote:

> line 109 did not have 5 elements ... but it did!
> empty beginning of file ... but it's not!
> 
> details:
> --8<---------------cut here---------------start------------->8---
> get.language.ISO.table <- function () {
>  socket <- url("http://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt",
>                open="r",encoding="utf-8");
>  data <- read.table(socket, as.is = TRUE, sep = "|", header = FALSE,
>                     col.names = c("a3bibliographic","a3terminologic",
>                       "a2","english","french"));

quote="" would seem to be your friend (apostrophes in the file are doing you in). I can't reproduce the "empty beginning" error, though.


>  close(socket);
>  data
> }
> language.ISO.table <- get.language.ISO.table()


-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com




More information about the R-help mailing list