How to get notebookid programmatically using R

kirankv
New Contributor

Hi, I would like to log the notebook id programmatically in R, Is there any command that exists in R so that I can leverage to grab the notebook id, I tried with python using the below command and grab it without any issues, and looking for similar functionality in R. Any tips or thoughts?

Python code:

data = json.loads(dbutils.notebook.entry_point.getDbutils().notebook().getContext().toJson())

print(data[‘tags’][‘notebookId’])

Looking for a similar output in R.