USEPA/EPATADA

Address devtools check notes

Opened this issue · 2 comments

Describe the issue

Address the following devtools::check() note regarding Rd line widths. To reproduce, run devtools::check() on TADA package.

If there is an easy bulk solution, add it to Maintenance.R and/or TADA Cheat Sheet so it can be easily replicated in the future if needed.

N  checking Rd line widths (916ms)
   Rd file 'TADA_AggregateMeasurements.Rd':
     \examples lines wider than 100 characters:
        # Select maximum value per day, site, comparable data identifier, result detection condition, and activity type code. Clean all non-max ... [TRUNCATED]
        Data_6Tribes_5y_agg <- TADA_AggregateMeasurements(Data_6Tribes_5y, grouping_cols = c("ActivityStartDate", "MonitoringLocationIdentifier ... [TRUNCATED]
        # Calculate a mean value per day, site, comparable data identifier, result detection condition, and activity type code. Keep all measur ... [TRUNCATED]
        Data_6Tribes_5y_agg <- TADA_AggregateMeasurements(Data_6Tribes_5y, grouping_cols = c("ActivityStartDate", "MonitoringLocationIdentifier ... [TRUNCATED]
   
   Rd file 'TADA_AnalysisDataFilter.Rd':
     \examples lines wider than 100 characters:
        Data_6Tribes_Assessment1 <- TADA_AnalysisDataFilter(Data_6Tribes_5y_Harmonized, clean = TRUE, surface_water = TRUE, ground_water = FALS ... [TRUNCATED]
        # Returns data frame with ONLY surface water results identified as usable and adds TADA.UseForAnalysis.Flag column.
        Data_6Tribes_Assessment2 <- TADA_AnalysisDataFilter(Data_6Tribes_5y_Harmonized, clean = FALSE, surface_water = TRUE, ground_water = FAL ... [TRUNCATED]
   
   Rd file 'TADA_AutoClean.Rd':
     \examples lines wider than 100 characters:
        # Example WQP URL: https://www.waterqualitydata.us/#statecode=US%3A09&characteristicType=Nutrient&startDateLo=04-01-2023&startDateHi=11 ... [TRUNCATED]
        stationProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Station/search?statecode=US%3A09&characteristicType=Nut ... [TRUNCATED]
        physchemProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Result/search?statecode=US%3A09&characteristicType=Nut ... [TRUNCATED]
        projectProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Project/search?statecode=US%3A09&characteristicType=Nut ... [TRUNCATED]
        TADAProfile <- TADA_JoinWQPProfiles(FullPhysChem = physchemProfile, Sites = stationProfile, Projects = projectProfile)
   
   Rd file 'TADA_BigDataRetrieval.Rd':
     \examples lines wider than 100 characters:
        tada1 <- TADA_BigDataRetrieval(startDate = "2019-01-01", endDate = "2021-12-31", characteristicName = "Temperature, water", statecode = ... [TRUNCATED]
   
   Rd file 'TADA_Boxplot.Rd':
     \examples lines wider than 100 characters:
        df <- dplyr::filter(Data_6Tribes_5y_Harmonized, TADA.ComparableDataIdentifier == "TOTAL PHOSPHORUS, MIXED FORMS_UNFILTERED_AS P_UG/L")
        Boxplots_TPbyOrg <- TADA_Boxplot(df, id_cols = c("TADA.ComparableDataIdentifier", "OrganizationIdentifier"))
        Boxplot_output <- TADA_Boxplot(Data_Nutrients_UT, id_cols = c("TADA.ComparableDataIdentifier", "MonitoringLocationTypeName"))
   
   Rd file 'TADA_CheckRequiredFields.Rd':
     \examples lines wider than 100 characters:
        # Example WQP URL: https://www.waterqualitydata.us/#statecode=US%3A09&characteristicType=Nutrient&startDateLo=04-01-2023&startDateHi=11 ... [TRUNCATED]
        stationProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Station/search?statecode=US%3A09&characteristicType=Nut ... [TRUNCATED]
        physchemProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Result/search?statecode=US%3A09&characteristicType=Nut ... [TRUNCATED]
        projectProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Project/search?statecode=US%3A09&characteristicType=Nut ... [TRUNCATED]
        TADAProfile <- TADA_JoinWQPProfiles(FullPhysChem = physchemProfile, Sites = stationProfile, Projects = projectProfile)
   
   Rd file 'TADA_ConvertDepthUnits.Rd':
     \examples lines wider than 100 characters:
        # are harmonized to "TADA.ActivityDepthHeightMeasure.MeasureUnitCode" and "TADA.ActivityDepthHeightMeasure.MeasureValue"
   
   Rd file 'TADA_ConvertResultUnits.Rd':
     \examples lines wider than 100 characters:
        # "TADA.WQXUnitConversionFactor", "TADA.WQXUnitConversionCoefficient", "TADA.WQXTargetUnit", and "TADA.SpeciationUnitConversion":
   
   Rd file 'TADA_ConvertSpecialChars.Rd':
     \examples lines wider than 100 characters:
        HandleSpecialChars_ResultMeasureValue <- TADA_ConvertSpecialChars(Data_Nutrients_UT, "ResultMeasureValue")
        HandleSpecialChars_DetLimMeasureValue <- TADA_ConvertSpecialChars(Data_Nutrients_UT, "TADA.DetectionQuantitationLimitMeasure.MeasureVal ... [TRUNCATED]
        unique(HandleSpecialChars_DetLimMeasureValue$TADA.DetectionQuantitationLimitMeasure.MeasureValueDataTypes.Flag)
   
   Rd file 'TADA_DataRetrieval.Rd':
     \examples lines wider than 100 characters:
        tada1 <- TADA_DataRetrieval(statecode = "WI", countycode = "Dane", characteristicName = "Phosphorus")
        tada2 <- TADA_DataRetrieval(statecode = "UT", characteristicName = c("Ammonia", "Nitrate", "Nitrogen"))
   
   Rd file 'TADA_DepthProfilePlot.Rd':
     \examples lines wider than 100 characters:
        # Create a depth profile figure with two parameters for a single monitoring location and date without displaying depth categories
   
   Rd file 'TADA_FieldCounts.Rd':
     \examples lines wider than 100 characters:
        fieldCountUTAmmonia <- TADA_FieldCounts(Data_Nutrients_UT, display = "most", characteristicName = "AMMONIA")
   
   Rd file 'TADA_FindPotentialDuplicatesMultipleOrgs.Rd':
     \examples lines wider than 100 characters:
        dat <- TADA_DataRetrieval(startDate = "2022-09-01", endDate = "2023-05-01", statecode = "PA", sampleMedia = "Water")
        dat1 <- TADA_FindPotentialDuplicatesMultipleOrgs(dat, dist_buffer = 100, org_hierarchy = c("21PA_WQX"))
   
   Rd file 'TADA_FlagAboveThreshold.Rd':
     \examples lines wider than 100 characters:
        WQXUpperThreshold_flagsonly <- TADA_FlagAboveThreshold(Data_Nutrients_UT, clean = FALSE, flaggedonly = TRUE)
   
   Rd file 'TADA_FlagBelowThreshold.Rd':
     \examples lines wider than 100 characters:
        WQXLowerThreshold_flagsonly <- TADA_FlagBelowThreshold(Data_Nutrients_UT, clean = FALSE, flaggedonly = TRUE)
   
   Rd file 'TADA_FlagContinuousData.Rd':
     \examples lines wider than 100 characters:
        all_data <- TADA_DataRetrieval(project = c("Continuous LC1", "MA_Continuous", "Anchorage Bacteria 20-21"))
        # Remove continuous data in dataframe (note that this dataframe will have 0 results because all are flagged in the example)
        Data_Nutrients_UT_flaggedonly <- TADA_FlagContinuousData(Data_Nutrients_UT, clean = FALSE, flaggedonly = TRUE)
        Data_R5_TADAPackageDemo_flaggedonly <- TADA_FlagContinuousData(Data_R5_TADAPackageDemo, clean = FALSE, flaggedonly = TRUE)
   
   Rd file 'TADA_FlagCoordinates.Rd':
     \examples lines wider than 100 characters:
        InvalidCoord_removed <- TADA_FlagCoordinates(Data_Nutrients_UT, clean_outsideUSA = "remove", clean_imprecise = TRUE)
   
   Rd file 'TADA_FlagDepthCategory.Rd':
     \examples lines wider than 100 characters:
        # assign TADA.DepthCategory.Flag and determine average values by depth category and returning only aggregate values
        Data_6Tribs_5y_Mean <- TADA_FlagDepthCategory(Data_6Tribes_5y, bycategory = "all", dailyagg = "avg", aggregatedonly = FALSE)
   
   Rd file 'TADA_FlagFraction.Rd':
     \examples lines wider than 100 characters:
        InvalidFraction_flaggedonly <- TADA_FlagFraction(Data_Nutrients_UT, clean = FALSE, flaggedonly = TRUE)
   
   Rd file 'TADA_FlagMeasureQualifierCode.Rd':
     \examples lines wider than 100 characters:
        MeasureQualifierCode_flags_only <- TADA_FlagMeasureQualifierCode(Data_6Tribes_5y, flaggedonly = TRUE)
        MeasureQualifierCode_clean_nodefs <- TADA_FlagMeasureQualifierCode(Data_6Tribes_5y, clean = TRUE, define = FALSE)
   
   Rd file 'TADA_FlagMethod.Rd':
     \examples lines wider than 100 characters:
        InvalidMethod_flaggedonly <- TADA_FlagMethod(Data_NCTCShepherdstown_HUC12, clean = FALSE, flaggedonly = TRUE)
   
   Rd file 'TADA_FlagResultUnit.Rd':
     \examples lines wider than 100 characters:
        InvalidUnit_flaggedonly <- TADA_FlagResultUnit(Data_Nutrients_UT, clean = "nonstandardized_only", flaggedonly = TRUE)
        NonstandardUnit_flaggedonly <- TADA_FlagResultUnit(Data_Nutrients_UT, clean = "invalid_only", flaggedonly = TRUE)
   
   Rd file 'TADA_FlagSpeciation.Rd':
     \examples lines wider than 100 characters:
        NonstandardSpeciation_clean <- TADA_FlagSpeciation(Data_Nutrients_UT, clean = "nonstandardized_only")
        InvalidSpeciation_flaggedonly <- TADA_FlagSpeciation(Data_Nutrients_UT, clean = "nonstandardized_only", flaggedonly = TRUE)
        NonstandardSpeciation_flaggedonly <- TADA_FlagSpeciation(Data_Nutrients_UT, clean = "invalid_only", flaggedonly = TRUE)
   
   Rd file 'TADA_HarmonizeSynonyms.Rd':
     \examples lines wider than 100 characters:
        Data_6Tribes_5yClean_Harmonized <- TADA_HarmonizeSynonyms(Data_6Tribes_5yClean, ref = CreateRefTable)
   
   Rd file 'TADA_Histogram.Rd':
     \examples lines wider than 100 characters:
        df <- dplyr::filter(Data_6Tribes_5y_Harmonized, TADA.ComparableDataIdentifier == "TOTAL PHOSPHORUS, MIXED FORMS_UNFILTERED_AS P_UG/L")
        Histogram_output <- TADA_Histogram(Data_Nutrients_UT, id_cols = c("TADA.ComparableDataIdentifier", "MonitoringLocationTypeName"))
   
   Rd file 'TADA_JoinWQPProfiles.Rd':
     \examples lines wider than 100 characters:
        # WQP URL: https://www.waterqualitydata.us/#statecode=US%3A09&characteristicType=Nutrient&startDateLo=04-01-2023&startDateHi=11-01-2023 ... [TRUNCATED]
        stationProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Station/search?statecode=US%3A09&characteristicType=Nut ... [TRUNCATED]
        physchemProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Result/search?statecode=US%3A09&characteristicType=Nut ... [TRUNCATED]
        projectProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Project/search?statecode=US%3A09&characteristicType=Nut ... [TRUNCATED]
        TADAProfile <- TADA_JoinWQPProfiles(FullPhysChem = physchemProfile, Sites = stationProfile, Projects = projectProfile)
   
   Rd file 'TADA_OrderCols.Rd':
     \examples lines wider than 100 characters:
        # Example WQP URL: https://www.waterqualitydata.us/#statecode=US%3A09&characteristicType=Nutrient&startDateLo=04-01-2023&startDateHi=11 ... [TRUNCATED]
        stationProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Station/search?statecode=US%3A09&characteristicType=Nut ... [TRUNCATED]
        physchemProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Result/search?statecode=US%3A09&characteristicType=Nut ... [TRUNCATED]
        projectProfile <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Project/search?statecode=US%3A09&characteristicType=Nut ... [TRUNCATED]
        TADAProfile <- TADA_JoinWQPProfiles(FullPhysChem = physchemProfile, Sites = stationProfile, Projects = projectProfile)
   
   Rd file 'TADA_ReadWQPWebServices.Rd':
     \examples lines wider than 100 characters:
        physchemresults1 <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Result/search?statecode=US%3A09&sampleMedia=water&sam ... [TRUNCATED]
        sites1 <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Station/search?statecode=US%3A09&sampleMedia=water&sampleMedia= ... [TRUNCATED]
        projects1 <- TADA_ReadWQPWebServices("https://www.waterqualitydata.us/data/Project/search?statecode=US%3A09&sampleMedia=water&sampleMed ... [TRUNCATED]
   
   Rd file 'TADA_Scatterplot.Rd':
     \examples lines wider than 100 characters:
        df <- dplyr::filter(Data_6Tribes_5y_Harmonized, TADA.ComparableDataIdentifier == "TOTAL PHOSPHORUS, MIXED FORMS_UNFILTERED_AS P_UG/L")
        Scatterplot_output <- TADA_Scatterplot(Data_Nutrients_UT, id_cols = c("TADA.ComparableDataIdentifier", "MonitoringLocationTypeName"))
   
   Rd file 'TADA_SimpleCensoredMethods.Rd':
     \examples lines wider than 100 characters:
        Data_Nutrients_UT_CensoredFlag <- TADA_SimpleCensoredMethods(Data_Nutrients_UT, nd_method = "multiplier", nd_multiplier = 0.5, od_metho ... [TRUNCATED]
        # Check for agreement between detection condition and detection limit type, and in instances where the measurement is non-detect, set t ... [TRUNCATED]
        Data_Nutrients_UT_CensoredFlag <- TADA_SimpleCensoredMethods(Data_Nutrients_UT, nd_method = "randombelowlimit", nd_multiplier = "null", ... [TRUNCATED]
   
   Rd file 'TADA_SubstituteDeprecatedChars.Rd':
     \examples lines wider than 100 characters:
        df <- TADA_DataRetrieval(startDate = "2022-01-01", endDate = "2022-12-31", characteristicType = "Nutrient", statecode = "MT", applyauto ... [TRUNCATED]
        # deprecated and "Phosphate-phosphorus***retired***use Total Phosphorus, mixed forms" is a deprecated WQX
        df3 <- TADA_DataRetrieval(startDate = "2022-01-01", endDate = "2022-12-31", characteristicType = "Nutrient", statecode = "WY", applyaut ... [TRUNCATED]
   
   Rd file 'TADA_TwoCharacteristicScatterplot.Rd':
     \examples lines wider than 100 characters:
        TADA_TwoCharacteristicScatterplot(Data_Nutrients_UT, id_cols = "TADA.ComparableDataIdentifier", groups = c("AMMONIA_UNFILTERED_NA_MG/L" ... [TRUNCATED]
        df <- dplyr::filter(Data_6Tribes_5y_Harmonized, TADA.ComparableDataIdentifier == "TOTAL PHOSPHORUS, MIXED FORMS_UNFILTERED_AS P_UG/L")
        TADA_TwoCharacteristicScatterplot(df, id_cols = "MonitoringLocationName", groups = c("Upper Red Lake: West", "Upper Red Lake: West-Cent ... [TRUNCATED]
   
   Rd file 'TADA_addPoints.Rd':
     \examples lines wider than 100 characters:
        lmap <- TADA_addPoints(lmap, "extdata/VATribe.shp", "Tribes", "Virginia Federally Recognized Tribes")
   
   Rd file 'getBboxJson.Rd':
     \examples lines wider than 100 characters:
        bbox <- sf::st_bbox(c(xmin = min(Data_6Tribes_5y$TADA.LongitudeMeasure), ymin = min(Data_6Tribes_5y$TADA.LatitudeMeasure), xmax = max(D ... [TRUNCATED]
   
   Rd file 'getLayer.Rd':
     \examples lines wider than 100 characters:
        bbox <- sf::st_bbox(c(xmin = min(Data_6Tribes_5y_Harmonized$TADA.LongitudeMeasure), ymin = min(Data_6Tribes_5y_Harmonized$TADA.Latitude ... [TRUNCATED]
        # Get the American Indian Reservations feature layer, filtered by the bounding box for the Data_6Tribes_5y_Harmonized example dataset
   
   Rd file 'writeLayer.Rd':
     \examples lines wider than 100 characters:
        # Get the Oklahoma Tribal Statistical Areas feature layer and write local file to inst/extdata/OKTribe.shp
   
   These lines will be truncated in the PDF manual.
``'

Quite a few of these are related to long urls. One way to fix them is to create shorter strings and paste them together to create the urls. I am not yet aware of other work arounds for this.

Do functions exist to format 100 char lines?