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 is just the reactable function; you might have to include this somewhere in a larger R file. | |
# `::` is used a splitting separator because the data uses a paste() statement to collapse several columns into one. | |
# This is a _hack_ to have multiple values in one cell of reactable. | |
reactable( | |
data = student_data, | |
searchable = TRUE, | |
pagination = FALSE, | |
borderless = TRUE, | |
details = function(index) { |
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
# @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. |