Skip to content

Commit b4b8d15

Browse files
committed
corrected mistake with n1 and added code to embed in slidify
1 parent ffbd4eb commit b4b8d15

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

9_DEVDATAPROD/Developing Data Products Course Notes HTML.Rmd

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,16 @@ grid.raster(readPNG("figures/5.png"))
335335
* rChart objects have various attributes/functions that you can use when saved `n1 <- nplot(...)`
336336
- `n1$` + TAB in R Console brings up list of all functions contained in the object
337337
- `n1$html()` = prints out the HTML for the plot
338-
- `n1$save(filename)` = embeds code into slidify document
338+
- `n1$save("filename.html")` = saves result to a file named "filename.html"
339+
- `cat(embeds code into slidify document
339340
- `n1$print()` = print out the JavaScript
340341
- `n1$show("inline", include_assets = TRUE, cdn = F)` = embed HTML/JS code directly with in Rmd file (for HTML output)
341342
- `n1$publish('plotname', host = 'gist'/'rpubs')` = publishes the plot under the specified `plotname` as a `gist` or to `rpubs`
342-
* to use with ***slidify***, the following YAML (Yet Another Markup Language/YAML Ain't Markup Language) must be added
343-
- `yaml ext_widgets : {rCharts: ["libraries/nvd3"]}`
343+
* to use with ***slidify***,
344+
- the following YAML (Yet Another Markup Language/YAML Ain't Markup Language) must be added
345+
- `yaml ext_widgets : {rCharts: ["libraries/nvd3"]}`
346+
- `cat('<iframe src="map3.html" width=100%, height=600></iframe>')` to embed a map or chart form a saved file (saved with: `map3$save('map3.html', cdn = TRUE)`)
347+
344348

345349
### Example
346350

9_DEVDATAPROD/Developing Data Products Course Notes.Rmd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,14 @@ $\pagebreak$
334334
* rChart objects have various attributes/functions that you can use when saved `n1 <- nplot(...)`
335335
- `n1$` + TAB in R Console brings up list of all functions contained in the object
336336
- `n1$html()` = prints out the HTML for the plot
337-
- `n1$save(filename)` = embeds code into slidify document
337+
- `n1$save("filename.html")` = saves result to a file named "filename.html"
338338
- `n1$print()` = print out the JavaScript
339339
- `n1$show("inline", include_assets = TRUE, cdn = F)` = embed HTML/JS code directly with in Rmd file (for HTML output)
340340
- `n1$publish('plotname', host = 'gist'/'rpubs')` = publishes the plot under the specified `plotname` as a `gist` or to `rpubs`
341-
* to use with ***slidify***, the following YAML (Yet Another Markup Language/YAML Ain't Markup Language) must be added
342-
- `yaml ext_widgets : {rCharts: ["libraries/nvd3"]}`
341+
* to use with ***slidify***,
342+
- the following YAML (Yet Another Markup Language/YAML Ain't Markup Language) must be added
343+
- `yaml ext_widgets : {rCharts: ["libraries/nvd3"]}`
344+
- `cat('<iframe src="map3.html" width=100%, height=600></iframe>')` to embed a map or chart form a saved file (saved with: `map3$save('map3.html', cdn = TRUE)`)
343345

344346
### Example
345347

0 commit comments

Comments
 (0)