omnipath_cache_load {OmnipathR} | R Documentation

## Loads an R object from the cache

### Description

Loads the object from RDS format.

### Usage

    omnipath_cache_load(
      key = NULL,
      version = NULL,
      url = NULL,
      post = NULL,
      payload = NULL
    )

### Arguments

`key` | Key of the cache item
`version` | Version of the cache item. If does not exist or NULL, the latest version will be retrieved
`url` | URL of the downloaded resource
`post` | HTTP POST parameters as a list
`payload` | HTTP data payload

### Value

Object loaded from the cache RDS file.

### See Also

`omnipath_cache_save`

### Examples

    # works only if you have already this item in the cache
    intercell_data <- omnipath_cache_load(url = paste0(
        'https://omnipathdb.org/intercell?resources=Adhesome,Almen2009,',
        'Baccin2019,CSPA,CellChatDB&license=academic'
    ))
    class(intercell_data)
    # [1] "data.frame"
    nrow(intercell_data)
    # [1] 16622
    attr(intercell_data, 'origin')
    # [1] "cache"

    # basic example of saving and loading to and from the cache:
    bioc_url <- 'https://bioconductor.org/'
    bioc_html <- readChar(url(bioc_url), nchars = 99999)
    omnipath_cache_save(bioc_html, url = bioc_url)
    bioc_html <- omnipath_cache_load(url = bioc_url)

[Package OmnipathR version 3.0.0 Index]