Bugfix in R script

Added code to the script to output the tide dataset as both cdv and txt
file.