calculate_density: Calculate density of active cells

Description Usage Arguments Examples

View source: R/high_density.R

Description

Wrapper around kde() function from the ks package to calculate the density of a brain area across samples. It saves each sample separately in a specified folder.

Usage

1
calculate_density(cells_df, n_slice = 10)

Arguments

cells_df

dataframe with xyz coordinates ("xPos", "yPos", "zPos") of the brain area of interest. Each row corresponds to a different cell that belongs to a sample ("sample_id")

n_slice

integer which specifies in how many parts to slice the estimate. Default = 10.

Examples

1
2
3
4
5
6
7
x <- data.frame(
sample_id = rep(c(1:3), each = 100),
xPos = c(rnorm(100), rpois(100, 2), sample(100),
yPos = c(rnorm(100), rpois(100, 2), sample(100),
zPos = c(rnorm(100), rpois(100, 2), sample(100)
)
y <- calculate_density(x)

valeriabonapersona/abc4d documentation built on Dec. 23, 2021, 2:09 p.m.