Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save richierocks/7a32011e213c2828b7e083f3e3039c95 to your computer and use it in GitHub Desktop.
Save richierocks/7a32011e213c2828b7e083f3e3039c95 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Make a local HTML file and verify that it exists."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"download.file(\"https://duckduckgo.com\", \"ddg.html\")\n",
"file.exists(\"ddg.html\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Try opening it using the standard `browseURL()` approach. This works in a local Jupyter notebook, but not in Colab."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"browseURL(\"ddg.html\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Try again using `system2()`. This also works locally but not in Colab."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"system2(\"open\", \"ddg.html\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "R",
"language": "R",
"name": "ir"
},
"language_info": {
"codemirror_mode": "r",
"file_extension": ".r",
"mimetype": "text/x-r-source",
"name": "R",
"pygments_lexer": "r",
"version": "4.0.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment