Since R is such a dynamic and permissive language I often find it hard to spot bugs that are result of my poor typing skills. So, to help myself I set the following options, along with others, in my .Rprofile file: options(warnPartialMatchArgs=TRUE, warnPartialMatchAttr=TRUE,warnPartialMatchDollar=TRUE). Recently, I have gotten interested in writing tests for R code and I was aware that data.table has extensive testing so I started learning it to get a little feel for it. So, I tried running the test.data.table() function today. After my amazement at the thoroughness of the testing used by data.table subsided I realized that it reported that there were some errors. However, after a little bit of digging about I realized that it was from my options settings! So, is it possible to modify the test.data.table() function to check if these options are set before running the tests? And, it would be awesome if the function disabled these options while the tests are running and then reset the options to original ones. Just fyi, I use Patrick Burns's withOptions function to temporarily turn off these functions for running the test.data.table function.
Currently, I do (using Patrick Burns's withOptions functions)
withOptions(list(warnPartialMatchArgs=F,warnPartialMatchAttr=F,warnPartialMatchDollar=F), test.data.table())
But it would be awesome if I could just do
Since R is such a dynamic and permissive language I often find it hard to spot bugs that are result of my poor typing skills. So, to help myself I set the following options, along with others, in my .Rprofile file:
options(warnPartialMatchArgs=TRUE, warnPartialMatchAttr=TRUE,warnPartialMatchDollar=TRUE). Recently, I have gotten interested in writing tests for R code and I was aware thatdata.tablehas extensive testing so I started learning it to get a little feel for it. So, I tried running thetest.data.table()function today. After my amazement at the thoroughness of the testing used by data.table subsided I realized that it reported that there were some errors. However, after a little bit of digging about I realized that it was from my options settings! So, is it possible to modify thetest.data.table()function to check if these options are set before running the tests? And, it would be awesome if the function disabled these options while the tests are running and then reset the options to original ones. Just fyi, I use Patrick Burns's withOptions function to temporarily turn off these functions for running the test.data.table function.Currently, I do (using Patrick Burns's withOptions functions)
But it would be awesome if I could just do