# Sample

Sample n rows from the data frame (Sample N Rows) or sample n fraction of rows from the data frame (Sample Fraction)

## How to Access This Feature

![](https://2850417076-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4HLCK3olgduYoe3RVS%2F-M4oMvCUDQwHTJ0eWi_f%2F-M4oMybAya6nOrelRU0h%2Fcommand-sample-menu.png?generation=1586795452176036\&alt=media)

### Sample (N Rows)

* Click "+" button and select "Others ..." -> "Sample ..." -> N Rows

### Sample (Fraction)

* Click "+" button and select "Others ..." -> "Sample ..." -> Fraction

## Sample (N Rows)

![](https://2850417076-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4HLCK3olgduYoe3RVS%2F-M4oMvCUDQwHTJ0eWi_f%2F-M4oMybGP0upyRxK_Kj9%2Fsample-nrows.png?generation=1586795452258658\&alt=media)

1. Enter Sample Number - Number of rows you want to sample the data. (e.g. 10000)
2. Select `Weight Colulmn` (Optional) - Sampling weight. The ratio of probability the row should be chosen. This should be non-negative numeric vector whose size is the number of rows. It's normalized so that the sum of the probability will be 1.
3. Replace Sampled Rows (Options) - The default is FALSE. If it's TRUE, replacement will be executed when sampling.
4. Click "Run" to Sample data frame.

## Sample (Fraction)

![](https://2850417076-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4HLCK3olgduYoe3RVS%2F-M4oMvCUDQwHTJ0eWi_f%2F-M4oMybIBYdCaf0rPrJi%2Fsample-frac.png?generation=1586795452108339\&alt=media)

1. Enter Sample Fraction ratio. It should be a numeric value between 0 and 1. (e.g. 0.4)
2. Select `Weight Colulmn` (Optional) - Sampling weight. The ratio of probability the row should be chosen. This should be non-negative numeric vector whose size is the number of rows. It's normalized so that the sum of the probability will be 1.
3. Replace Sampled Rows (Options) - The default is FALSE. If it's TRUE, replacement will be executed when sampling.
4. Click "Run" to Sample data frame.
