Skip to content

Instantly share code, notes, and snippets.

View talegari's full-sized avatar

Srikanth K S talegari

View GitHub Profile
@talegari
talegari / read_dir.R
Created May 17, 2016 07:53
[R] Read files with specific extensions in the directory as dataframes
# read_dir
# description
#
# read files with specific extensions in the directory as dataframes
# args
#
# directory : directory should not end with "\"
# extensions : extensions of the files to be selected as a character
@talegari
talegari / store7z.R
Last active November 19, 2016 10:58
[R] Store and retrieve R objects from a password protected file on disk
# Store and retrieve R objects from password protected a file on disk
# ***************
# Purpose
# ***************
#
# Store R objects into password protected 7z file
# Read them into a R environment
# ***************
@talegari
talegari / Vignette_ csv_process (csv_disk_utils_R).Rmd
Last active July 27, 2016 13:11
[R] framework for processing large CSV files on disk with R's statistical functions optimized for low memory usage (unix based systems only)
---
title: "Vignette: `csv_process` (csv_disk_utils_R)"
author: "Srikanth KS"
date: "17 February 2016"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
@talegari
talegari / print both sides
Last active December 31, 2015 14:51
Page ranges to print multiple pages on both sides of a sheet -- an R script using shiny
# Page ranges to print on both sides of a sheet ----
# author : Srikanth KS (talegari)
# contact : gmail me at sri dot teach
# version : 1
# last updated : 31st Dec 2015
# purpose : If your printer prints on one side(you manually
# turn and feed the papers) and you need to print
# multiple pages per sheet
# load libraries ----
@talegari
talegari / channelPrediction.R
Last active December 10, 2015 11:06
Channel Prediction: predict next possible channel using previously used channels (quick hack)
# nextChannel ----
#
# predict next possible channel using previously used channels.
# This is more of a quick hack than a timeseries algorithm.
# It does not take care of seasonal changes or long-term changes,
# If you are looking for more, use Arima or ETS timeseries methods.
# idea | to predict channel preference based on few
# | previously used channels.
#
@talegari
talegari / clv.py
Last active November 26, 2015 11:18
customer lifecycle value calulation (CLV,LCV,LTV)
#----------------------------------------------------------
# customer lifecycle value calulation (CLV,LCV,LTV)
# python version : 2.7.10
#----------------------------------------------------------
# facilitate division
from __future__ import division
# clvBasic ----
# define clv for finite or infinite horizon(from geometric series)
@talegari
talegari / utilities.R
Last active January 30, 2017 08:42
misc R utilities
#######################################################################
# utilities
#######################################################################
# author : talegari (Srikanth KS)
# license : GNU AGPLv3 (http://choosealicense.com/licenses/agpl-3.0/)
#######################################################################
# intro ----
# This is a set of quick utilities(functions) written in R(3.2.2)