Skip to content

Instantly share code, notes, and snippets.

View ernestguevarra's full-sized avatar

Ernest Guevarra ernestguevarra

View GitHub Profile
# Return of the BMI exercise - 28 November 2023 --------------------------------
## Load libraries ----
library(dplyr) ## for data manipulation
library(openxlsx) ## for reading XLSX files
library(zscorer) ## for calculating z-scores
## Load project-specific functions ----
source(list.files("R", full.names = TRUE))
sudo apt update
sudo apt ugrade
sudo apt-get install -y g++ gfortran libreadline6-dev libx11-dev libxt-dev libpng-dev libjpeg-dev libcairo2-dev xvfb libbz2-dev libzstd-dev liblzma-dev libcurl4-openssl-dev texinfo texlive texlive-fonts-extra screen wget libpcre2-dev zlib1g-dev libbz2-dev liblzma-dev libpcre2-dev libcurl4-openssl-dev openjdk-11-jdk make
cd /usr/local/src
sudo wget https://cran.rstudio.com/src/base/R-4/R-4.0.3.tar.gz
sudo su
tar zxvf R-4.0.3.tar.gz
cd R-4.0.3
./configure --enable-R-shlib
make
@ernestguevarra
ernestguevarra / package_review_checklist.md
Created November 26, 2020 22:49
R Package Review Checklist

Package Review

Please check off boxes as applicable, and elaborate in comments below. Your review is not limited to these topics, as described in the reviewer guide

  • Briefly describe any working relationship you have (had) with the package authors.
  • As the reviewer I confirm that there are no conflicts of interest for me to review this work (If you are unsure whether you are in conflict, please speak to your editor before starting your review).

Documentation

@ernestguevarra
ernestguevarra / devtools_check.R
Created November 26, 2020 09:46
devtools command for package check with installation of all requisite packages
devtools::check_rhub(env_vars=c(R_COMPILE_AND_INSTALL_PACKAGES = "always"))
download <- function(url, quiet = TRUE) {
"!DEBUG Downloading `url`"
path <- tempfile()
status <- utils::download.file(
url,
path,
method = download_method(),
quiet = quiet,
[![cran checks](https://cranchecks.info/badges/worst/sp)](https://cran.r-project.org/web/checks/check_results_sp.html)
var url = 'https://www.dfa.gov.ph/dfa-news/dfa-releasesupdate?start=1&end=2352';
var fs = require('fs');
var page = require('webpage').create();
page.open(url, function(status) {
if (status === 'success') {
var html = page.evaluate(function() {
return document.documentElement.outerHTML;
});
try {
fs.write("data-raw/dfaPressReleases.txt", html, 'w');
@ernestguevarra
ernestguevarra / keybase.md
Created April 22, 2019 10:01
Keybase identity

Keybase proof

I hereby claim:

  • I am ernestguevarra on github.
  • I am ernestguevarra (https://keybase.io/ernestguevarra) on keybase.
  • I have a public key ASCFyI8Wc9HTQtqwty5d2jqsjLLAmMupi_qQWphG83zzvAo

To claim this, I am signing this object:

library(dplyr)
library(sp)
library(rgdal)
library(tibble)
find_UTM_zone <- function(longitude, latitude) {
# Special zones for Svalbard and Norway
if (latitude >= 72.0 && latitude < 84.0 )
if (longitude >= 0.0 && longitude < 9.0)
@ernestguevarra
ernestguevarra / tableExample.html
Created August 20, 2018 05:53
Example of tables in HTML
<a id="FIG1"></a><strong>Figure 1:</strong> Schematic diagram of the proposed stepped wedge cluster-randomised controlled trial
<style>
th, tr, td {
text-align:center;
font-family:Helvetica;
font-size:10px;
border:1px solid black;
}
</style>