sampleCMB: Take a simple random sample from a 'CMBDataFrame'

Description Usage Arguments Value Examples

View source: R/Statistics.R

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

1
sampleCMB(cmbdf, sample.size)

Arguments

cmbdf

a CMBDataFrame.

sample.size

the desired 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.

Examples

1
2
3
4
5
6
7
8
## Download the map first
# downloadCMBMap(foreground = "smica", nside = 1024)
# df <- CMBDataFrame("CMB_map_smica1024.fits")
# plot(sampleCMB(df, sample.size = 800000))

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

rcosmo documentation built on Feb. 14, 2020, 5:06 p.m.