Commit 290fbc79 authored by Grelot Frederic's avatar Grelot Frederic :swimmer_tone5:
Browse files

geau Version 1.0.14.0

0 errors :heavy_check_mark: | 0 warnings :heavy_check_mark: | 0 notes :heavy_check_mark:

- ajout de la fonction format_presence
	- formattage en md d'un tableau de présence pour Mattermost !
Showing with 42 additions and 2 deletions
+42 -2
Package: geau
Title: Utilities very useful to share within geau-inondation team
Version: 1.0.14.0
Version: 1.0.15.0
Authors@R:
c(
person(given = "Frédéric",
......@@ -23,6 +23,7 @@ LazyData: true
Imports:
kableExtra,
knitr,
readODS,
rio,
scales,
sf,
......
......@@ -3,5 +3,6 @@
export(add.inset)
export(current_version)
export(estimate_catnat_freq)
export(format_presence)
export(kable_units)
export(map_so_ii)
#' @title Transform ods table presence in md table (for Mattermost)
#'
#' @param x character or data.frame, path of the ods table or the table itself
#'
#' @return character, md version of table behind x.
#'
#' @export
#'
#' @encoding UTF-8
#' @author Frédéric Grelot
format_presence = function(x) {
result = if (is.character(x)) readODS::read_ods(x[1]) else x
result[] = lapply(result, gsub, pattern = "B", replacement = "**B**")
result[] = lapply(result, gsub, pattern = "C", replacement = "*C*")
knitr::kable(result, align = c("l", rep("c", length(result) - 1)))
}
......@@ -122,7 +122,7 @@ map_so_ii = function(
## Init map
graphics::par(mai = c(.65, .60, .50, .15))
plot(geau::so_ii_limit, axes = TRUE)
plot(geau::so_ii_limit, axes = TRUE, main = list(...)[["main"]], cex.main = 3)
## Plot theme if any, return theme_legend
theme_legend = switch(
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/presence.R
\encoding{UTF-8}
\name{format_presence}
\alias{format_presence}
\title{Transform ods table presence in md table (for Mattermost)}
\usage{
format_presence(x)
}
\arguments{
\item{x}{character or data.frame, path of the ods table or the table itself}
}
\value{
character, md version of table behind x.
}
\description{
Transform ods table presence in md table (for Mattermost)
}
\author{
Frédéric Grelot
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment