Skip to content

Instantly share code, notes, and snippets.

@al00014
al00014 / dict_to_df.R
Created February 7, 2020 17:28 — forked from erinshellman/dict_to_df.R
Convert Python dictionary to R data.frame
py_dict = readLines('python_dictionary.txt')
# e.g.
#{"cat_name": "Ella", "dwell_status": "tree_dweller", "coat_color": "gray, white, orange", "is_from_hell": "Y"}
#{"cat_name": "Billie", "dwell_status": "bush_dweller", "coat_color": "gray, white", "is_from_hell": "N"}
dict_to_df = function(dict) {
require(plyr)
df = data.frame()
df_temp = list()
@al00014
al00014 / DIC.R
Created January 28, 2018 10:14 — forked from Gedevan-Aleksizde/DIC.R
# --------------------------------
# calculate DIC* from stanfit
#
# * Spiegelhalter et al. (2002)
# --------------------------------
DIC <- function(stanfit, df.input, dev ){
# stanfit: stanfit object
# df.input: input data.frame
# dev: function that calculate the dev. of post.mean;

解决 Git 在 windows 下中文乱码的问题

原因

中文乱码的根源在于 windows 基于一些历史原因无法全面支持 utf-8 编码格式,并且也无法通过有效手段令其全面支持。

解决方案

  1. 安装