Last active
April 30, 2019 13:22
-
-
Save NRBPerdijk/446b9d3ba6c1ee37ebac2b88ef8a719d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remember to always put a call to R in a Try block, because | |
// R often resorts to throwing RuntimeExceptions. | |
Try(rMagicWithBindings(path)) match { | |
case Failure(f) => print(f) | |
case Success(weatherForecastList) => | |
// We get back a WeatherForecastList, which is a wrapper for List[WeatherForecast]. | |
// Now we can work with the results WITHOUT any parsing: | |
// simply take out the List and do your operations (here we print them one by one). | |
weatherForecastList.asScalaList.foreach(forecast => println(forecast)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment