Skip to content

Instantly share code, notes, and snippets.

View harryprince's full-sized avatar
💭
I may be slow to respond.

HarryZhu harryprince

💭
I may be slow to respond.
  • Mobike
  • Jilin University of Finance and Economics
View GitHub Profile
@javierluraschi
javierluraschi / analysing-twitter-stream-using-spark-and-r.md
Last active April 14, 2021 15:49
Analyzing Twitter Stream using Spark and R
https://kafka.apache.org/quickstart

wget http://apache.claz.org/kafka/2.1.0/kafka_2.12-2.1.0.tgz
tar -xzf kafka_2.12-2.1.0.tgz

bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
@javierluraschi
javierluraschi / building-arrow-r-bindings-in-windows.md
Created December 17, 2018 21:11
Building Arrow R Bindings in Windows

Building Arrow R Bindings in Windows

This doc captures results from investigating how to build the Arrow R bindings in Windows. The following options were explored:

  • Building Arrow in MSys and bindings in RTools.
  • Building Arrow and bindings in RTools.

The most promising long-term solution is to write a CMake generator that can be run from RTools; short term, we can continue making progress compiling Arrow from MSys.

This document explains other approaches considered and provides additional details.

@javierluraschi
javierluraschi / using-tensorflow-in-emr-with-sparklyr.md
Last active January 20, 2020 16:53
Using TensorFlow in EMR with sparklyr

A script to demonstrate using TensorFlow in Spark with Amazon EMR and sparklyr.

  1. Create an EMR cluster for sparklyr, connect to EMR and install required tools:
install.packages(tensorflow)
devtools::install_github("rstudio/tfdeploy")
  1. Connect to Spark using sparklyr, copy some data and the mtcars TensorFlow model:
@dgrapov
dgrapov / plotly_select_DT.R
Last active September 10, 2020 01:25
ggplot2 to plotly to shiny to box/lasso select to DT
#plotly box or lasso select linked to
# DT data table
# using Wage data
# the out group: is sex:Male, region:Middle Atlantic +
library(ggplot2)
library(plotly)
library(dplyr)
library(ISLR)
@Vessy
Vessy / RCy3_example1.R
Last active April 8, 2018 00:13
Network visualization and R - An example how to plot a network and customize its appearance in Cytoscape directly from R using the RCy3 package
############################################################################################
############################################################################################
# Plotting networks in R - an example how to plot a network and
# customize its appearance in Cytoscape directly from R using
# the RCy3 package
############################################################################################
############################################################################################
# Clear workspace
# rm(list = ls())
############################################################################################
@expersso
expersso / trigonometry.R
Created July 28, 2016 08:44
Trigonometry with magick, gganimate, and purrr
## Purpose: illustrate use of magick, gganimate, and purrr
## Inspiration:
## https://rud.is/b/2016/07/27/u-s-drought-animations-with-the-witchs-brew-purrr-broom-magick/
## and subsequent discussion on magick vs gganimate:
## https://twitter.com/hrbrmstr/status/758304420224466944
library(purrr)
library(ggplot2)
library(gganimate)
library(animation)
library(magick)
@torgeir
torgeir / installing-ubuntu-snappy-core-on-the-raspberry-pi-2-from-os-x.md
Last active July 27, 2018 07:47
Installing ubuntu snappy core on the raspberry pi 2 from os x
@yihui
yihui / README.md
Last active March 15, 2017 18:35
A Shiny app based on annyang that responds to voice input
#!/usr/bin/r
library(inline)
library(rbenchmark)
## openMPCode example from Rcpp/examples/OpenMP/ by Dirk E.
openMPCode <- '
// assign to C++ vector
std::vector<double> x = Rcpp::as<std::vector< double > >(xs);
@thertrader
thertrader / ShinyForTradingStrategy.txt
Last active June 17, 2023 15:59
A Simple Shiny App for Monitoring Trading Strategies
This Shiny application is designed to help analysing trading strategies. It is an ongoing project that I improve when time allows. Feel free to get in touch should you have any suggestion.
*How to use the App as it is?
The App uses as input several csv files (one for each strategy). Each file has two columns: date and daily return. There is an example of such a file in the Github repository. The code is essentially made of 3 files.
-ui.R: controls the layout and appearance of the app
-server.R: contains the instructions needed to build the app. You can load as much strategies as you want as long as the corresponding csv file has the right format (see below).
-shinyStrategyGeneral.R: loads the required packages and launches the app
put ui.R and server.R file in a separate directory
In the server.R file change the inputPath, inputFile and keepColumns parameters to match your setting. The first two are self explanatory the third one is a list of column names within the csv file. Keep only date and daily return