Teradata Package for R Function Reference | 17.20 - td_nrow - Teradata Package for R - Look here for syntax, methods and examples for the functions included in the Teradata Package for R.

Teradata® Package for R Function Reference

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for R
Release Number
17.20
Published
March 2024
Language
English (United States)
Last Update
2024-05-03
dita:id
TeradataR_FxRef_Enterprise_1720
Product Category
Teradata Vantage
Number of rows in a data.frame or a tibble object

Description

This function retrieves number of rows in a tibble or data.frame object.

Usage

td_nrow(df)

Arguments

df

Required Argument
Specifies a data.frame or a tibble object.
Types: R data.frame OR tibble

Value

Returns the number of rows in a data.frame or a tibble object.

Examples


# Get remote data source connection
con <- td_get_context()$connection

# Create a dataframe.
df <- data.frame(column1 = c(1, 2, 3), column2 = c('teradata', 'vantage', 'release'), 
                 column3 = c(TRUE, FALSE, TRUE))
# Returns the number of rows for data.frame.
td_nrow(df)

# Create table from R dataframe "df".
copy_to(con, df, name = "test_table", analyze = TRUE, overwrite = TRUE)

# Create remote tibble object.
test_table <- tbl(con, "test_table")

# Returns the number of rows for tibble object.
td_nrow(test_table)