Paul wrote:
>
> Thanks for the responses. 'Try' seems to be the function that I needed. I
> had to adapt the code suggested below because vapply wasn't recognised,
> but this seemed to work:
> x<‑lapply(a,function(x){try(read.table(x,colClasses='character'))})
>
There is the risk with this a
Thanks for the responses. 'Try' seems to be the function that I needed. I had
to adapt the code suggested below because vapply wasn't recognised, but this
seemed to work:
a<-list.files()
x<-lapply(a,function(x){try(read.table(x,colClasses='character'))})
bad <- sapply(x, function(x){inherits(x, "
Perhaps ?try can help...
"Paul" wrote:
>
>Hi All,
>
>I have a problem with reading in multiple text files where some of the files
>have no data and was hoping someone may be able to help me find a solution.
>
>Each text file is a daily log of fish movement. However, on some occasions
>no movemen
What about trimming the file list based on a minimum size? You can
also use the arguments to list.files to get only certain patterns in
file names, and otherwise you can put a condition in the function
passed to lapply to return NULL, which will rbind ok, or process x in
a similar way.
a <- a[file
Hi All,
I have a problem with reading in multiple text files where some of the files
have no data and was hoping someone may be able to help me find a solution.
Each text file is a daily log of fish movement. However, on some occasions
no movements will be recorded on a particular day and theref
5 matches
Mail list logo