changeColType: Change Column Types

View source: R/changeColTypes.R

changeColTypeR Documentation

Change Column Types

Description

[Stable]

Changes column types based on vectors of column names and readr types

Usage

changeColType(df, cols, types)

Arguments

df

data.frame/tibble

cols

Character vector of columns in df to change

types

Character vector of new column types (readr-like)

Value

A data.frame/tibble

Creation notes

First created in 2020-12-11 while working in the MARC-KC/CovidDataEntry Repository

Examples

## Not run: 
class(iris[['Species']])

irisNew <- changeColType(iris, cols = c("Species"), types=c('c'))
class(irisNew[['Species']])

## End(Not run)


MARC-KC/marcR documentation built on June 2, 2022, 9:31 p.m.