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
# https://stackoverflow.com/questions/64476043/ | |
# https://stackoverflow.com/questions/1189759/ | |
convertDirectoryR.toWin = function(myDir = getwd()) # "R:/data/state-capitals/final/" | |
{ | |
cat( normalizePath(myDir) ); | |
writeClipboard( normalizePath(myDir) ); # R:\data\state-capitals\final\ | |
} | |
openDirectoryR.inWin = function(myDir = getwd()) # "R:/data/state-capitals/final/" |
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
#' Convert String Matrix to Numeric Matrix | |
#' | |
#' @param m string matrix | |
#' | |
#' @return numeric matrix | |
#' @export | |
numericMatrix = function(m) | |
{ |
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
# Blender v2.74 (sub 0) OBJ File: 'Hand.blend' | |
# www.blender.org | |
mtllib Hand.mtl | |
o ZBrushPolyMesh3D | |
v 0.614360 0.281365 -0.675872 | |
v 0.684894 0.445729 -0.634615 | |
v 1.294752 1.048795 -0.574309 | |
v 0.552541 0.233567 -0.579448 | |
v 0.631207 0.406862 -0.474761 | |
v 1.311582 1.012985 -0.257089 |
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
# helper class to interface between R and python using rpy2 | |
# © Monte J. Shaffer | |
# [email protected] | |
# MIT license | |
import numpy as np | |
import rpy2 | |
import rpy2.robjects as robjects | |
import rpy2.robjects.packages as rpackages | |
from rpy2.robjects.packages import importr |
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
# I wrote this in 2009 as part of my M.S. Stats - Statistical Computing Course | |
# Not all the bells and whistles, but should be understandable | |
# © Monte J. Shaffer | |
# [email protected] | |
# MIT license | |
myKmeans = function(data,clusters,maxIter=25) | |
{ | |
data = as.matrix(data); | |
n = nrow(data); |
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
# https://datasciencelab.wordpress.com/2014/01/15/improved-seeding-for-clustering-with-k-means/ | |
import numpy as np | |
import random | |
from numpy import zeros | |
import matplotlib | |
matplotlib.use("qt4agg") | |
from matplotlib import pyplot as plt |