Skip to content

Commit

Permalink
🚸 Add setup vignette to website navbar (#132)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Wolf <[email protected]>
  • Loading branch information
lazappi and falexwolf authored Jan 20, 2025
1 parent 3ebf151 commit f296549
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
2 changes: 2 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ navbar:
text: Articles
menu:
- text: Introduction
- text: Setting up laminr
href: articles/setup.html
- text: Concepts and features
href: articles/concepts_features.html
- text: Package Architecture
Expand Down
43 changes: 31 additions & 12 deletions vignettes/setup.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ install.packages("laminr", dependencies = TRUE)

If you choose not to install all additional packages you will be prompted to do so as needed.

## Installing the development version

The current development version of **{laminr}** can be installed from GitHub using:

```r
if (!requireNamespace("laminr", quietly = TRUE)) {
install.packages("remotes")
}
remotes::install_github("laminlabs/laminr")
```

This version may have bug fixes and new features but could also be unstable so is not recommended for most users.

# Installing Python **lamindb**

Using **{laminr}** requires that the Python **lamindb** package is available.
Expand Down Expand Up @@ -78,12 +91,28 @@ Other Python packages you may want to install:

Installing additional Python packages also be useful if you want to use another R package which expects a particular Python module to be installed.

## Using another environment
### Adding **lamindb** to another environment

To install **lamindb** into another environment, set the `envname` argument:

```r
laminr::install_lamindb(envname = "your-env")
```

Be aware that there may be dependency conflicts with packages already installed in the environment and installing **lamindb** may cause package versions to change.

## Setting the Python environment

Running `library(laminr)` will tell **{reticulate}** to use the included `r-lamindb` environment (if it has not already connected to another environment).

If you prefer to not load the whole package, and instead call functions using `laminr::`, you should tell **{reticulate}** which environment to use by running `reticulate::use_virtualenv("r-lamindb")`.

### Using another environment

In some cases you may prefer to use another Python environment.
This may be the case if you use another R package which requires a Python module or if you are managing your own Python environment.

Specifying another Python environment to use should be done ***before*** loading **{laminr}** using one of these methods:
Specifying another Python environment to use should be done ***before*** loading **{laminr}** (or **{reticulate}**) using one of these methods:

- Loading another R package that sets the Python environment
- Using `reticulate::use_virtualenv()`, `reticulate::use_condaenv()` or `reticulate::use_python()`
Expand All @@ -92,16 +121,6 @@ Specifying another Python environment to use should be done ***before*** loading
Details of the current Python environment can be viewed using `reticulate::py_config()`.
For more information about setting the active Python environment see `vignette("versions", package = "reticulate")` (also [available here](https://rstudio.github.io/reticulate/articles/versions.html)).

### Adding **lamindb** to another environment

To install **lamindb** into another environment, set the `envname` argument:

```r
laminr::install_lamindb(envname = "your-env")
```

Be aware that there may be dependency conflicts with packages already installed in the environment and installing **lamindb** may cause package versions to change.

# Logging in to LaminDB

If you have not used LaminDB before you will need to login to access public instances.
Expand Down

0 comments on commit f296549

Please sign in to comment.