Skip to content

Commit

Permalink
πŸ“ Adapt R quickstart to laminr 0.2.0 (#186)
Browse files Browse the repository at this point in the history
* πŸ“ Fix R quickstart

* πŸ“ Polish

* πŸ’„ More polish

* πŸ’š Fix
  • Loading branch information
falexwolf authored Nov 21, 2024
1 parent f06fb1a commit b9a3939
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions docs/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
"import lamindb as ln\n",
"\t\n",
"ln.track() # track a run for a notebook or script \n",
"artifact = ln.Artifact.get(\"3TNCsZZcnIBv2WGb0001\") # get an artifact record\n",
"artifact = ln.Artifact.get(\"3TNCsZZcnIBv2WGb0001\") # get an artifact record by uid\n",
"artifact.describe() # show metadata of artifact\n",
"df = artifact.load() # load artifact into memory, e.g., a DataFrame\n",
"df = artifact.load() # load the artifact into memory, e.g., a DataFrame\n",
"\n",
"# work with the dataset\n",
"# do your work\n",
"\n",
"ln.Artifact(\"./my_result_folder\", description=\"My result\").save() # save a folder\n",
"ln.finish() # mark the run as finished\n",
Expand All @@ -77,25 +77,29 @@
":::{tab-item} R\n",
"\n",
"```R\n",
"install.packages(\"laminr\") # install the R package\n",
"# laminr needs pip install 'lamindb[aws]'\n",
"install.packages(\"laminr\", dependencies = TRUE) # install the laminr package\n",
"library(laminr)\n",
"\n",
"ln <- connect()\n",
"# ln$track() # soon\n",
"artifact <- ln$Artifact$get(\"KBW89Mf7IGcekja2hADu\")\n",
"adata <- artifact$load() # load the dataset into memory\n",
"db <- connect() # connect to the instance you configured on the terminal\n",
"db$track(path = \"./my-analysis.Rmd\") # track a run of your notebook or script\n",
"artifact <- db$Artifact$get(\"3TNCsZZcnIBv2WGb0001\") # get an artifact record by uid\n",
"df <- artifact$load() # load the artifact into memory, e.g., a DataFrame\n",
"\n",
"# work with the dataset\n",
"# do your work\n",
"\n",
"# ln$Artifact(\"./my_result_folder\", description=\"My result\").save()\n",
"# ln$finish() # soon\n",
"db$Artifact(\"./my_result_folder\", description=\"My result\").save() # save a folder\n",
"db$finish() # mark the run finished\n",
"```\n",
"\n",
"Save an html export for `.qmd` or `.Rmd` file as a report.\n",
"\n",
"```shell\n",
"lamin save my-analysis.qmd\n",
"lamin save my-analysis.Rmd\n",
"```\n",
"\n",
"For more, see the [R docs](https://laminr.lamin.ai/).\n",
"\n",
":::\n",
"::::"
]
Expand Down Expand Up @@ -1244,7 +1248,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "lamindb",
"display_name": "py310",
"language": "python",
"name": "python3"
},
Expand All @@ -1258,7 +1262,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.10.15"
}
},
"nbformat": 4,
Expand Down

0 comments on commit b9a3939

Please sign in to comment.