add_row_from_list: add_row_from_list Add one row of data to a data frame from a...

Description Usage Arguments Details Examples

View source: R/add_row_from_list.R

Description

Easily add one row to a data frame when columns are not all of one class. Data should be in a list format, one row only, in same order as columns in the original data frame. Any missing values must be explicitly included as NAs. Similar to SQL INSERT INTO. Maintains same class as original data frame.

Usage

1
add_row_from_list(mydf, mylist)

Arguments

mydf

A data frame to which you'd like to add a row

mylist

A list holding a single row of data, in the exact order of columns in the original data frame.

Details

WARNING: THIS IS STILL A WORK IN PROGRESS!!!

Examples

1
2
# Idea from Jennifer Bryan
add_row_from_list(iris, list(5.1, 3.5, 1.4, 0.2, "setosa"))

smach/rmiscutils documentation built on Dec. 15, 2021, 1:49 a.m.