R connection speedup and error checking
R connection speedup and error checking