export_worksheet: #***********************Label Top #' Group By List #' #'...

View source: R/Standardization.R

export_worksheetR Documentation

#***********************Label Top #' Group By List #' #' @param df the data frame to be checked #' @param label_col The column from which to pull top entries #' @param value_col The column used to determine what counts as top #' @param n=7 The number of top #' #' @return Group_By using a list of quoted names. #' #' @details Replacement for group_by_ now that it has been depricated. #' #' @export

Description

colnames(platpscintldef)[colnames(platpscintldef)=="Action_Obligation_Then_Year_Then_Year"]<- "Action_Obligation_Then_Year"

Usage

export_worksheet(
  df,
  xlsx,
  sheet,
  path = "..\\output",
  second_path = NA,
  startRow = 1,
  startCol = 1
)

Arguments

df

the underlying data

xlsx

the excel file to output to

sheet

the sheet to use in excel, typically shorter than the name

path="..\output\"

what directory for the output

second_path=NA

for saving to a second location to automatically

startRow=1

Start row for excel output

startCol=NA

Start column for excel output

Details

topplat<-platpscintldef summarise(Action_Obligation_OMB24_GDP22=sum(Action_Obligation_OMB24_GDP22), Action_Obligation_2020=sum(if_else(Fiscal_Year==2020,Action_Obligation_OMB24_GDP22,0))) group_by (PlatformPortfolio) mutate(rank_total=rank(desc(Action_Obligation_OMB24_GDP22)), rank_2020=rank(desc(Action_Obligation_2020))) topplat

topplat$TopProject<- if_else(topplat$rank_2020<=7 | topplat$rank_total<=7,topplat$Project.Name,NA)

platpscintldef<-left_join(platpscintldef,topplat by=c("Project.Name","PlatformPortfolio"))

platpscintldef$TopProject[is.na(platpscintldef$TopProject) & !is.na(platpscintldef$Project.Name)]<- "Other Labeled Project"

summary(factor(platpscintldef$TopProject)) Save a copy of the plot, a current dollars csv, and an excel copy

Value

no value


CSISdefense/csis360 documentation built on April 29, 2024, 5:30 p.m.