library(knitr) # the default output hook hook_output = knitr::knit_hooks$get('output') knitr::knit_hooks$set(output = function(x, options) { if (!is.null(n <- options$out.lines)) { x <- unlist(strsplit(x, '\n', fixed = TRUE)) if (length(x) > n) { # truncate the output x <- c(head(x, n), '....', '') } else { x <- c(x, "") } x <- paste(x, collapse = '\n') # paste first n lines together } hook_output(x, options) }) knitr::opts_knit$set(root.dir = tempdir()) knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" ) # Make sure the date is shown in English format not Chinese. invisible(Sys.setlocale(category = "LC_TIME", locale = "en_US.UTF-8"))
A collection of useful functions to work with eplusr.
Currently eplusbuidr is not on CRAN yet. You can install the development version from GitHub.
# install.packages("remotes") remotes::install_github("hongyuanjia/eplusbuildr")
library(eplusr) library(eplusbuildr) # read model idf <- read_idf(file.path(eplus_config(8.8)$dir, "ExampleFiles", "RefBldgLargeHotelNew2004_Chicago.idf")) # Remove not-used objects purge_object(idf, "Material") # Merge same objects into one merge_object(idf, "Schedule:Compact") # Rename objects using function # purrr-like function definition supported idf$object_name("ZoneHVAC:FourPipeFanCoil") rename_per_fun(idf, "ZoneHVAC:FourPipeFanCoil", ~gsub("fan coil", "four-pipe fan coil", .x) ) idf$object_name("ZoneHVAC:FourPipeFanCoil") # Rename objects based on class and fielf values idf$object_name("People") rename_per_field(idf, "People", "Zone or ZoneList Name") idf$object_name("People")
Hongyuan Jia
The project is released under the terms of MIT License.
Copyright © 2019 Hongyuan Jia
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.