Skip to contents

multiplies some data to rescale percentages stored as 0 to 1, into 0-100

Usage

table_x100(df, cnames = names_pct_as_fraction_ejamit)

Arguments

df

data.frame but can be data.table

cnames

colnames in df of indicators to multiply by 100, like those in

names_pct_as_fraction_ejamit,

names_pct_as_fraction_blockgroupstats, or

names_pct_as_fraction_ejscreenit

Value

df with data in specified columns multiplied by 100

Examples

out <- testoutput_ejamit_10pts_1miles
mytable <- out$results_bysite[1:2, ..names_these]
#> Error: object '..names_these' not found
table_signif_round_x100(mytable)
#> Error in table_signif_round_x100(mytable): could not find function "table_signif_round_x100"
# same as this:
table_signif(
  table_round(
    table_x100(
      mytable, names_pct_as_fraction_ejamit
    )
  )
)
#> Error in table_signif(table_round(table_x100(mytable, names_pct_as_fraction_ejamit))): could not find function "table_signif"

 y = data.frame(pctlowinc = 1:2, pctpre1960 = 1:2, avg.pctunemployed = 1:2, avg.pctpre1960 = 1:2)
 
 table_x100(y, names_pct_as_fraction_ejscreenit)
#> Error in table_x100(y, names_pct_as_fraction_ejscreenit): could not find function "table_x100"
 table_x100(y, names_pct_as_fraction_blockgroupstats)
#> Error in table_x100(y, names_pct_as_fraction_blockgroupstats): could not find function "table_x100"
 table_x100(y, names_pct_as_fraction_ejamit)
#> Error in table_x100(y, names_pct_as_fraction_ejamit): could not find function "table_x100"
 cat("\n\n")
#> 
#> 
 names_pct_as_fraction_ejscreenit
#>  [1] "pctnhaiana"        "pctnhnhpia"        "pctba"            
#>  [4] "pctaa"             "pctaiana"          "pctnhpia"         
#>  [7] "pctotheralone"     "pctmulti"          "pctwa"            
#> [10] "pctlan_ie"         "pctlan_api"        "pctlan_nonenglish"
#> [13] "pctpoor"          
#> attr(,"ejam_package_version")
#>  Version 
#> "2.32.4" 
#> attr(,"ejscreen_version")
#> EJScreenVersion 
#>          "2.32" 
#> attr(,"ejscreen_releasedate")
#> EJScreenReleaseDate 
#>        "2024-08-12" 
#> attr(,"acs_releasedate")
#> ACSReleaseDate 
#>   "2023-12-07" 
#> attr(,"acs_version")
#>  ACSVersion 
#> "2018-2022" 
#> attr(,"census_version")
#> CensusVersion 
#>        "2020" 
#> attr(,"date_saved_in_package")
#> [1] "2025-05-06"
 names_pct_as_fraction_blockgroupstats
#>  [1] "pctlowinc"            "pctlingiso"           "pctunemployed"       
#>  [4] "pctlths"              "pctunder5"            "pctover64"           
#>  [7] "pctmin"               "pcthisp"              "pctnhba"             
#> [10] "pctnhaa"              "pctnhaiana"           "pctnhnhpia"          
#> [13] "pctnhotheralone"      "pctnhmulti"           "pctnhwa"             
#> [16] "pctba"                "pctaa"                "pctaiana"            
#> [19] "pctnhpia"             "pctotheralone"        "pctmulti"            
#> [22] "pctwa"                "pctlan_ie"            "pctlan_api"          
#> [25] "pctlan_other"         "pctlan_english"       "pctlan_spanish"      
#> [28] "pctlan_french"        "pctlan_rus_pol_slav"  "pctlan_other_ie"     
#> [31] "pctlan_vietnamese"    "pctlan_other_asian"   "pctlan_arabic"       
#> [34] "pctlan_nonenglish"    "pctspanish_li"        "pctie_li"            
#> [37] "pctapi_li"            "pctother_li"          "pctpoor"             
#> [40] "pctdisability"        "lowlifex"             "pctnobroadband"      
#> [43] "pctnohealthinsurance" "pctpre1960"           "pctfire30"           
#> [46] "pctflood30"           "pctunder18"           "pctover17"           
#> [49] "pctmale"              "pctfemale"            "pctownedunits"       
#> attr(,"ejam_package_version")
#>  Version 
#> "2.32.4" 
#> attr(,"ejscreen_version")
#> EJScreenVersion 
#>          "2.32" 
#> attr(,"ejscreen_releasedate")
#> EJScreenReleaseDate 
#>        "2024-08-12" 
#> attr(,"acs_releasedate")
#> ACSReleaseDate 
#>   "2023-12-07" 
#> attr(,"acs_version")
#>  ACSVersion 
#> "2018-2022" 
#> attr(,"census_version")
#> CensusVersion 
#>        "2020" 
#> attr(,"date_saved_in_package")
#> [1] "2025-05-06"
 names_pct_as_fraction_ejamit
#>  [1] "pctlowinc"                 "pctlingiso"               
#>  [3] "pctunemployed"             "pctlths"                  
#>  [5] "pctunder5"                 "pctover64"                
#>  [7] "pctmin"                    "avg.pctlowinc"            
#>  [9] "avg.pctlingiso"            "avg.pctunemployed"        
#> [11] "avg.pctlths"               "avg.pctunder5"            
#> [13] "avg.pctover64"             "avg.pctmin"               
#> [15] "state.avg.pctlowinc"       "state.avg.pctlingiso"     
#> [17] "state.avg.pctunemployed"   "state.avg.pctlths"        
#> [19] "state.avg.pctunder5"       "state.avg.pctover64"      
#> [21] "state.avg.pctmin"          "pcthisp"                  
#> [23] "pctnhba"                   "pctnhaa"                  
#> [25] "pctnhaiana"                "pctnhnhpia"               
#> [27] "pctnhotheralone"           "pctnhmulti"               
#> [29] "pctnhwa"                   "avg.pcthisp"              
#> [31] "avg.pctnhba"               "avg.pctnhaa"              
#> [33] "avg.pctnhaiana"            "avg.pctnhnhpia"           
#> [35] "avg.pctnhotheralone"       "avg.pctnhmulti"           
#> [37] "avg.pctnhwa"               "state.avg.pcthisp"        
#> [39] "state.avg.pctnhba"         "state.avg.pctnhaa"        
#> [41] "state.avg.pctnhaiana"      "state.avg.pctnhnhpia"     
#> [43] "state.avg.pctnhotheralone" "state.avg.pctnhmulti"     
#> [45] "state.avg.pctnhwa"         "pctba"                    
#> [47] "pctaa"                     "pctaiana"                 
#> [49] "pctnhpia"                  "pctotheralone"            
#> [51] "pctmulti"                  "pctwa"                    
#> [53] "pctlan_ie"                 "pctlan_api"               
#> [55] "pctlan_other"              "pctlan_spanish"           
#> [57] "pctlan_nonenglish"         "pctspanish_li"            
#> [59] "pctie_li"                  "pctapi_li"                
#> [61] "pctother_li"               "pctpoor"                  
#> [63] "pctdisability"             "lowlifex"                 
#> [65] "avg.pctdisability"         "avg.lowlifex"             
#> [67] "avg.lifexyears_synonym"    "state.avg.pctdisability"  
#> [69] "state.avg.lowlifex"        "pctnobroadband"           
#> [71] "pctnohealthinsurance"      "pctpre1960"               
#> [73] "pctflood"                  "pctfire"                  
#> [75] "pctfire30"                 "pctflood30"               
#> [77] "pctunder18"                "pctover17"                
#> [79] "pctmale"                   "pctfemale"                
#> [81] "pctownedunits"             "pctfemale1849"            
#> attr(,"ejam_package_version")
#>  Version 
#> "2.32.4" 
#> attr(,"ejscreen_version")
#> EJScreenVersion 
#>          "2.32" 
#> attr(,"ejscreen_releasedate")
#> EJScreenReleaseDate 
#>        "2024-08-12" 
#> attr(,"acs_releasedate")
#> ACSReleaseDate 
#>   "2023-12-07" 
#> attr(,"acs_version")
#>  ACSVersion 
#> "2018-2022" 
#> attr(,"census_version")
#> CensusVersion 
#>        "2020" 
#> attr(,"date_saved_in_package")
#> [1] "2025-05-06"
 cat("\n\n")
#> 
#> 
 ytable = data.table(pctlowinc = 1:2, pctpre1960 = 1:2,
                     avg.pctunemployed = 1:2, 
                     avg.pctpre1960 = 1:2)
#> Error in data.table(pctlowinc = 1:2, pctpre1960 = 1:2, avg.pctunemployed = 1:2,     avg.pctpre1960 = 1:2): could not find function "data.table"
 
 table_x100(ytable, names_pct_as_fraction_blockgroupstats) 
#> Error in table_x100(ytable, names_pct_as_fraction_blockgroupstats): could not find function "table_x100"
 table_x100(ytable, names_pct_as_fraction_ejamit)
#> Error in table_x100(ytable, names_pct_as_fraction_ejamit): could not find function "table_x100"
 cat("\n\n")
#> 
#> 
 y
#>   pctlowinc pctpre1960 avg.pctunemployed avg.pctpre1960
#> 1         1          1                 1              1
#> 2         2          2                 2              2
 ytable
#> Error: object 'ytable' not found