Skip to content

Instantly share code, notes, and snippets.

@bhive01
bhive01 / Install_proc.txt
Last active March 21, 2018 18:10
see3cam_test.py
Building Opencv to add custom format support:
###############################################
Prerequisites:
--------------
opencv source - Download the required opencv version for Linux with the
following link. (http://opencv.org/downloads.html)
Dependencies :
RGB2All<-function (data=RGB, R="R", G="G", B="B", name.ext="", deg.obs=2, illum="C"){
#Setting up variables in dataframe
data[[paste("X", name.ext, sep="")]]<-NA
data[[paste("Y", name.ext, sep="")]]<-NA
data[[paste("Z", name.ext, sep="")]]<-NA
data[[paste("L", name.ext, sep="")]]<-NA
data[[paste("a", name.ext, sep="")]]<-NA
data[[paste("b", name.ext, sep="")]]<-NA
Lab2All<-function(data=Lab, L="L", a="a", b="b", name.ext="", deg.obs=2, illum="C"){
#Setting up variables in dataframe
data[[paste("C", name.ext, sep="")]]<-NA
data[[paste("H", name.ext, sep="")]]<-NA
data[[paste("X", name.ext, sep="")]]<-NA
data[[paste("Y", name.ext, sep="")]]<-NA
data[[paste("Z", name.ext, sep="")]]<-NA
data[[paste("R", name.ext, sep="")]]<-NA
data[[paste("G", name.ext, sep="")]]<-NA
library(tidyverse)
project_two <- readr::read_csv(
'ID, GROUP, value1, value2
1 , 1, 1, 1
1 , 1, 1, 2
2 , 1, 2, 1
2 , 1, 2, 2
1 , 2, 3, 1
1 , 2, 3, 2
library(tidyverse)
#-----------------------------------------------------------------------------
# Some complicated function to calculate things.
#-----------------------------------------------------------------------------
complex_func <- function(df) {
cat("processing: ", first(df[['ID']]), "\n")
# 100 lines of code go here.
################################################
#Correlation matrix plot
raw.data <- raw.data[complete.cases(raw.data),]
c<-cor(raw.data[colstart:colend])
#Correlation p-value tests
cor.pvalues <- function(X){
library(tidyverse)
lagshow <-
data.frame(x= rep(1:10, 14),
y = rep(1:10, 14),
color = rep(rep(c("A", "B"), each = 10), 7),
lag = rep(-3:3, each=20)
) %>%
mutate(x = if_else(color == "A", x-lag, x))
ggplot(lagshow, aes(x = x, y = y, colour = color, shape = color)) +
library(tidyverse)
library(animation)
library(tweenr)
library(gtools)
income <- read_csv("income.csv")
income_levels <- mixedsort(unique(income$income_level))
income_levels <- c(income_levels[16], income_levels[1:15])
income <- income %>% mutate(income_level=factor(income_level,
library(tidyverse)
# This is the example I used to show pwalk iterating and printing out things
#perhaps this is a horrible example and I'm using it incorrectly?
# if you substitute pmap for pwalk, you get exactly the same output.
# make a simple plotting function
plot_points <- function(t) ggplot(t, aes(mpg, wt)) + geom_point()
#function that prints cylinder info, ggplot, and table
library(tidyverse)
library(GGally)
nba = read.csv("http://datasets.flowingdata.com/ppg2008.csv")
nba1 <-
sample_n(nba, 40) %>%
as_tibble() %>%
mutate(league = 1)