View source: R/import_to_workspace.R
import_to_workspace | R Documentation |
This function allows you to import .R and .Rmd files into Databricks as an R notebook. This will work whether the files are on your local machine, on DBFS, or from an instance of RStudio that is hosted on a Databricks cluster.
import_to_workspace( file, notebook_path, workspace, token = NULL, overwrite = "false", verbose = T )
workspace |
A string representing the web workspace of your Databricks instance. E.g., "https://eastus2.azuredatabricks.net" or "https://company.cloud.databricks.com". |
token |
A valid authentication token generated via User Settings in Databricks or via the Databricks REST API 2.0. If none is provided, netrc will be used. |
overwrite |
Replace an existing notebook? Defaults to 'true', a string. |
verbose |
If true, will pretty print the success or failure of the request. Defaults to TRUE. |
local_file |
A string representing the path to a .R or .Rmd file. Generated by |
The API endpoint for importing files to the workspace is '2.0/workspace/import'. For all details on API calls please see the official documentation at https://docs.databricks.com/dev-tools/api/latest/.
The API response.
## Import an R script from your local machine to a Notebook on Databricks import_to_workspace(file = "C:/my_files/my_r_program.R", notebook_path = "/Shared/R/my_r_program", workspace = "https://company.cloud.databricks.com", token = "dapi2130940djvafn98wefasdfjn")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.