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]
table_signif_round_x100(mytable)
# same as this:
table_signif(
  table_round(
    table_x100(
      mytable, names_pct_as_fraction_ejamit
    )
  )
)

 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)
 table_x100(y, names_pct_as_fraction_blockgroupstats)
 table_x100(y, names_pct_as_fraction_ejamit)
 cat("\n\n")
 names_pct_as_fraction_ejscreenit
 names_pct_as_fraction_blockgroupstats
 names_pct_as_fraction_ejamit
 cat("\n\n")
 ytable = data.table(pctlowinc = 1:2, pctpre1960 = 1:2, avg.pctunemployed = 1:2, avg.pctpre1960 = 1:2)
 
 table_x100(ytable, names_pct_as_fraction_blockgroupstats) 
 table_x100(ytable, names_pct_as_fraction_ejamit)
 cat("\n\n")
 y
 ytable