Last Update: May 13, 2019
Offline Version
This file contains hidden or 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
printname c.entry file line_no | |
- do_arith R-4.0.3\src\main\arithmetic.c 411 | |
! do_logic R-4.0.3\src\main\logic.c 40 | |
!= do_relop R-4.0.3\src\main\relop.c 51 | |
$ do_subset3 R-4.0.3\src\main\subset.c 1206 | |
$<- do_subassign3 R-4.0.3\src\main\subassign.c 2081 | |
%% do_arith R-4.0.3\src\main\arithmetic.c 411 | |
%*% do_matprod R-4.0.3\src\main\array.c 1228 | |
%/% do_arith R-4.0.3\src\main\arithmetic.c 411 | |
& do_logic R-4.0.3\src\main\logic.c 40 |
This file contains hidden or 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
tanimoto <- function(x, similarity=F) { | |
res<-sapply(x, function(x1){ | |
sapply(x, function(x2) {i=length(which(x1 & x2)) / length(which(x1 | x2)); ifelse(is.na(i), 0, i)}) | |
}) | |
if(similarity==T) return(res) | |
else return(1-res) | |
} | |
x <- data.frame(Samp1=c(0,0,0,1,1,1,0,0,1), Samp2=c(1,1,1,1,1,1,0,0,1), Samp3=c(1,0,0,1,0,0,0,0,0), Samp4=c(1,1,1,1,1,1,1,1,1)) | |
tanimoto(x) |
This file contains hidden or 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
import sys | |
import numpy as np | |
import networkx as nx | |
import matplotlib.pyplot as plt | |
def plot(data,filename,degreetype): | |
""" Plot Distribution """ | |
plt.plot(range(len(data)),data,'bo') | |
plt.yscale('log') | |
plt.xscale('log') |
This file contains hidden or 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
## Empty list -- just use the empty environment for this. | |
nil <- function() { | |
emptyenv() | |
} | |
## Test if a list is the empty list: | |
is_empty <- function(lis) { | |
identical(lis, nil()) | |
} |
This file contains hidden or 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
These code snippets have been tested on R 3.1.0 and Mac OS 10.9.3. They presumably do *not* work on R 2.X! | |
## Enter these commands in the Mac OS Terminal | |
# use faster vecLib library | |
cd /Library/Frameworks/R.framework/Resources/lib | |
ln -sf /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/Current/libBLAS.dylib libRblas.dylib | |
# return to default settings | |
cd /Library/Frameworks/R.framework/Resources/lib |
This file contains hidden or 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) | |
shinyServer(function(input, output, session) { | |
# The number of iterations to perform | |
maxIter <- 50 | |
# Track the start and elapsed time | |
startTime <- Sys.time() | |
output$elapsed <- renderText({ |
This file contains hidden or 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
#=============================================================================== | |
# Filename: boost.sh | |
# Author: Pete Goodliffe | |
# Copyright: (c) Copyright 2009 Pete Goodliffe | |
# Licence: Please feel free to use this, with attribution | |
# Modified version | |
#=============================================================================== | |
# | |
# Builds a Boost framework for the iPhone. | |
# Creates a set of universal libraries that can be used on an iPhone and in the |
This file contains hidden or 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
#include <Rcpp.h> | |
using namespace Rcpp ; | |
template <typename T> | |
inline void set_item_impl( List& target, int i, const T& obj, CharacterVector& names, traits::true_type ){ | |
target[i] = obj.object ; | |
names[i] = obj.name ; | |
} | |
template <typename T> |
This file contains hidden or 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
#include <Rcpp.h> | |
using namespace Rcpp ; | |
template <typename T> | |
inline void set_item_impl( List& target, int i, const T& obj, CharacterVector& names, traits::true_type ){ | |
target[i] = obj.object ; | |
names[i] = obj.name ; | |
} | |
template <typename T> |