This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' @export | |
#' | |
true_round <- function(number, digits) { | |
number <- as.numeric(number) | |
posneg <- sign(number) | |
number <- abs(number) * 10^digits | |
number <- number + 0.5 + sqrt(.Machine$double.eps) | |
number <- trunc(number) | |
number <- number / 10 ^ digits | |
number * posneg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' @export | |
#' | |
true_round <- function(number, digits) { | |
number <- as.numeric(number) | |
posneg <- sign(number) | |
number <- abs(number) * 10^digits | |
number <- number + 0.5 + sqrt(.Machine$double.eps) | |
number <- trunc(number) | |
number <- number / 10 ^ digits | |
number * posneg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Loading Libraries ---- | |
library(reactable) | |
library(yaml) | |
library(shiny) | |
# Generate Reactable Function ---- | |
generate_reactable <- function(data, | |
table_type, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(reactable) | |
library(dplyr) | |
ui <- fluidPage( | |
actionButton(inputId = "edit", | |
label = "Edit"), | |
reactableOutput("table") | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Imports | |
import requests | |
import re | |
import pandas as pd | |
import numpy as np | |
# Initialising Variables | |
names = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import OrderedDict | |
import numpy as np | |
import spacy | |
from spacy.lang.en.stop_words import STOP_WORDS | |
nlp = spacy.load('en_core_web_sm') | |
class TextRank4Keyword(): | |
"""Extract keywords from text""" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script will let you choose R packages. There's a mechanism to check whether the package is already installed, and it will print a # statement with the package name if it is installed. | |
# This can also serve as a handy list for the | |
# Linux Dependencies: libssl-dev, libcurl4-openssl-dev and libxml2-dev, unixodbc-dev | |
wrangling <- c("tidyverse", "gsubfn", "googlesheets", "stringr", "stringi", "readr", "data.table", "lubridate") | |
analysis <- c("MASS", "caret", "CARS", "sqldf") | |
graphics <- c("ggmap", "gridExtra", "RColorBrewer", "scales", "plotly") #ggplot2 is done in tidyverse | |
sql <- c("RSQLite", "odbc") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @dependency ggmap for the geocode function | |
# @dependency plyr for ldply | |
# | |
# | |
# @param lat - The latitude value or column using $ notation | |
# @param long - The longitude value or column using $ notation | |
# @param api.key - Your Google Geocoding API key. | |
# You'll need to get one here: https://developers.google.com/maps/documentation/geocoding/start | |
# The Geocoding API requires you to sign up with payment details. You may get charged for using it in huge volumes. | |
# Please refer to the official documentation provided by Google on their pages. |