Skip to content

Instantly share code, notes, and snippets.

@program--
Last active December 20, 2020 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save program--/c826ea52673f92d5bfc819f668bd7845 to your computer and use it in GitHub Desktop.
Save program--/c826ea52673f92d5bfc819f668bd7845 to your computer and use it in GitHub Desktop.
R function for getting an organized tibble from Microsoft Planner data (exported Excel spreadsheet).
#' Also see: https://github.com/program--/plannr
#' importsFrom readxl read_excel
#' importsFrom tibble as_tibble
import_plan <- function(xlsx) {
plan_data <- readxl::read_excel(xlsx)
plan_name <- colnames(plan_data[[2]][2])
plan_date <- plan_data[[2]][2]
filtered_data <- setNames(plan_data, plan_data[4, ])
filtered_data <- filtered_data[-c(1,2,3,4), ]
# You can filter Buckets/Tasks out by using dplyr::filter()
#
# filtered_data <- filtered_data %>%
# dplyr::filter(
# `Bucket Name` != "Bucket 1",
# `Task Name` != "Task 1"
# )
tibble::as_tibble(filtered_data)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment