Radiant (0.9.3.3) has some changes that may break existing code. Code generated for Report > Rmd (and Report > R) will no longer use an
r_data list to store and access data. This means that code generated and used in the Radiant browser interface can now more easily be used without the browser interface as well (e.g., in R or Rmarkdown documents). As an example, code you generate through Data > Transform will now look like this:
<- mutate(diamonds, carat_ln = log(carat))diamonds
instead of this:
"diamonds"]] <- mutate(r_data[["diamonds"]], carat_ln = log(carat))r_data[[
You can add also any data.frame (or tibble) you create in Report > Rmd, e.g., by loading from disk, to the
Datasets dropdown by adding a line with:
The updates also effect code for adding residuals and predictions to a dataset. The
store command below is now similar in structure to dplyr’s mutate (i.e., pass a data.frame and add a column). The advantage of using the
store function in the example below is that it will automatically assign values to the correct index in the dataset, even if a filter is used or there are missing values.
<- logistic( result titanic,rvar = "survived", evar = c("pclass", "sex", "age", "sibsp"), lev = "Yes" )summary(result) <- predict(result, pred_data = titanic) pred <- store(titanic, pred, name = "pred_logit")titanic
If you open an old state file in Radiant and try to knit a report in Report > Rmd you will likely see a pop-up that will ask if you want to clean the code. If you click the Clean report button, Radiant will try to update your existing code to the new format. I expect that this will automatically handle about 90-95% of cases.
In sum, please try out the new version and let me now if you run into any problems. If you see any errors or messages in R(studio) please post an issue on GitHub through the link below.
Blog posts about Radiant are available at http://vnijs.github.io/blog/
For an overview of Radiant updates see:
To get the latest version of all Radiant components run the command below: