nums: Select the numeric columns of a given dataset

Description Usage Arguments Value Author(s) Examples

View source: R/nums.R

Description

Extract and return a data frame with the columns that include only numeric values

Usage

1

Arguments

data

A numeric vector, matrix or data frame.

Value

This function returns a data frame with the numeric columns of the input dataset.

Author(s)

Kleanthis Koupidis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# with data frame as input
nums(iris)

# with vector as input
vec <- as.vector(iris$Sepal.Width)
nums(vec)

# with matrix as input
Matrix <- cbind(
  Uni05 = (1:200) / 21, Norm = rnorm(200),
  `5T` = rt(200, df = 5), Gam2 = rgamma(200, shape = 2)
)
nums(Matrix)

# OpenBudgets.eu Dataset Example:
head(nums(Wuppertal_df))

okgreece/DescriptiveStats.OBeu documentation built on Sept. 7, 2021, 6:32 p.m.