Displaying 1 result from an estimated 1 matches for "codpa".
Did you mean:
coda
2013 Jan 02
2
Read many cvs files
...table('global2001.csv',head=T,sep=';',stringsAsFactors=F)
datos[datos==""] <- NA
temp <- datos[,19:53]
y <- split(temp,1:nrow(temp))
y2 <- lapply(y,function(x) paste(x[!is.na(x)],collapse=";"))
global2001 <- datos[,-19:-53]
global2001[1,"CODPA"] <- 1
global2001$CODPA <- y2
global2001$CODPA <- unlist(global2001$CODPA)
Example of a file:
> str(datos)
'data.frame': 112598 obs. of 53 variables:
$ Identificación.do.Paciente : chr "34" "41" "42" "46" ...
$ Númer...