Learn R Programming

rcosmo (version 1.1.6)

sampleCMB: Take a simple random sample from a CMBDataFrame

Description

This function returns a CMBDataFrame which size equals to sample.size, whose rows comprise a simple random sample of the rows from the input CMBDataFrame.

Usage

sampleCMB(cmbdf, sample.size)

Value

A CMBDataFrame which size equals to sample.size, whose rows comprise a simple random sample of the rows from the input CMBDataFrame.

Arguments

cmbdf

a CMBDataFrame.

sample.size

the desired sample size.

Examples

Run this code

df <- CMBDataFrame(nside = 16, I = rnorm(12 * 16 ^ 2), ordering = "nested")
df.sample <- sampleCMB(df, sample.size = 100)
df.sample

Run the code above in your browser using DataLab