Skip to content

Instantly share code, notes, and snippets.

@shelajev
Created May 10, 2018 12:17
Show Gist options
  • Select an option

  • Save shelajev/974187db4d2d955c049a9f8a130f88d0 to your computer and use it in GitHub Desktop.

Select an option

Save shelajev/974187db4d2d955c049a9f8a130f88d0 to your computer and use it in GitHub Desktop.
@Value(value = "classpath:plot.R")
private Resource rSource;
@Bean
Function<Double, String> getPlotFunction(@Autowired Context ctx)
throws IOException {
Source source = Source.newBuilder("R", rSource.getURL()).build();
return ctx.eval(source).as(Function.class);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment