AEADataEditor / replication-template-development

Development repo for the replication template
2 stars 6 forks source link

Parse R data files for readability #3

Closed larsvilhuber closed 2 years ago

larsvilhuber commented 2 years ago

See comments in https://github.com/AEADataEditor/replication-template-development/commit/5df50a79a0105e5a24ee10534c8cff25a2797609

larsvilhuber commented 2 years ago

@aaf101 I made a few changes to streamline/self-contain the program. Also corrected the "pattern" it was picking up files it shouldn't - needed to quote the ".".

It is now picking up the right files. I created a test file (touch test.rds creates an empty file) that would NOT read, and it generates the following error messages:

Error in readRDS(datafiles_list[[k]]) : error reading from connection
Writing out results: /mnt/local/raid5_1/vilhuber/Workspace-non-encrypted/git/AEA/replication-template-development/r-data-checks.txt
Error in write.table(df, file = txtfile, sep = ",", quote = FALSE, row.names = FALSE) : 
  unimplemented type 'list' in 'EncodeElement'
> datafiles_list
[1] "/mnt/local/raid5_1/vilhuber/Workspace-non-encrypted/git/AEA/replication-template-development/12345/test.rds"
> df
                                                                                                    File name
1 /mnt/local/raid5_1/vilhuber/Workspace-non-encrypted/git/AEA/replication-template-development/12345/test.rds
  Successfully read
1                No

The first error (Error in readRDS(datafiles_list[[k]]) : error reading from connection) is expected (the file is not readable), but might be misleading - might be suppressed?

The second error (Error in write.table(df,) is not clear to me, and will require a bit of debugging.

aaf101 commented 2 years ago

@larsvilhuber I have suppressed the potentially confusing error message, and have (hopefully) resolved the write.table(df) error.

larsvilhuber commented 2 years ago

Merged in using Pull request #4