# agridatasets - A Comprehensive Collection of Agricultural and Agronomic Datasets # Version 0.1.1 # Copyright (C) 2026 Renzo Caceres Rossi # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # bamboo_growth library(testthat) # Test 1: Check that the object is a data.frame and has 5 columns test_that("bamboo_growth is a data.frame with 5 columns", { expect_s3_class(bamboo_growth, "data.frame") expect_equal(ncol(bamboo_growth), 5) expect_equal(length(bamboo_growth), 5) }) # Test 2: Check the number of rows test_that("bamboo_growth has 595 rows", { expect_equal(nrow(bamboo_growth), 595) }) # Test 3: Validate column names test_that("bamboo_growth has correct column names", { expect_named( bamboo_growth, c("Compartment", "Locality_Block", "Transect_Number", "Old_Shoots", "New_Shoots") ) }) # Test 4: Check data types test_that("bamboo_growth has correct data types", { expect_type(bamboo_growth$Compartment, "integer") expect_type(bamboo_growth$Locality_Block, "integer") expect_type(bamboo_growth$Transect_Number, "integer") expect_type(bamboo_growth$Old_Shoots, "integer") expect_type(bamboo_growth$New_Shoots, "integer") })