Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
Date/Time: 2020-05-01 18:29:02 -0700
End time: 2020-05-01 18:37:21 -0700
OS Version: Mac OS X 10.15.4 (Build 19E287)
Architecture: x86_64h
Report Version: 29
Data Source: Stackshots
Shared Cache: 0x5753000 397AAAC6-1F11-3E99-B86A-5F8C9F2518F4
Command: R
library(agricolae)
library(tidyverse)
mtcars2 <-
mtcars %>%
#move rownames to new column called Model
rownames_to_column(var = "Model")
# how does cyl predict displacment
aov_cars <- aov(disp ~ cyl, data = mtcars2)
data <- dget("example_data.dput")
data_summary <-
function(df, V1, V2, V3, V4, value) {
V1_var <- enquo(V1)
V2_var <- enquo(V2)
V3_var <- enquo(V3)
V4_var <- enquo(V4)
layer_1 <- enquos(V1, V2, V3, V4)
layer_2 <- enquos(V1, V2, V4)
library(tidyverse)
not_the_fucking_same <- function(x, y, keepNAs = "all") {
if (keepNAs == "all") {
x != y | is.na(x) | is.na(y)
} else if (keepNAs == "x") {
x != y | is.na(x)
} else if (keepNAs == "y") {
x != y | is.na(y)
@bhive01
bhive01 / gardentrix.R
Created July 18, 2018 00:24
RHelp_gardenTrix
library(openxlsx)
library(readxl)
library(Hmisc)
library(tidyverse)
#write out the iris dataset
# write.xlsx(iris, "iris.xlsx") just to show you how
# read in a dataset from excel
iris2 <- read_excel("iris.xlsx") # this assumes it's in R's working directory (the one it boots up with)
---
title: "Untitled"
author: "Brandon Hurr"
date: "4/18/2018"
output:
beamer_presentation:
latex_engine: xelatex
---
```{r setup, include=FALSE}
@bhive01
bhive01 / see3cam_good_np_slicing.py
Created April 16, 2018 02:49
CU40 with Numpy Slicing (efficient for video on Raspberry Pi)
# TESTING HARDWARE
# see3CAM_CU40
# raspberry Pi 3 bf8
# Raspbian Stretch 13-03-2018
# Python 3.5.3
# OpenCV 3.4.1
# load required libraries
import math
import numpy as np
# TESTING HARDWARE
# see3CAM_CU40
# raspberry Pi 3 bf8
# Raspbian Stretch 13-03-2018
# Python 3.5.3
# OpenCV 3.4.1
# load required libraries
import math
import numpy as np
@bhive01
bhive01 / see3cam_test.py
Last active March 22, 2018 22:28
Using numpy scaling instead of openCV
import math
import numpy as np
import cv2
cam = cv2.VideoCapture(0)
cam.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cam.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
cam.set(cv2.CAP_PROP_CONVERT_RGB, False) # turn off RGB conversion
# cam.set(cv2.CAP_PROP_FOURCC('Y', '1', '6', ''))
@bhive01
bhive01 / see3cam_test.py
Last active December 17, 2018 16:30
reading images from a see3cam CU40
import math
import numpy as np
import cv2
cam = cv2.VideoCapture(0)
cam.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cam.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
cam.set(cv2.CAP_PROP_CONVERT_RGB, False) # turn off RGB conversion
# cam.set(cv2.CAP_PROP_FOURCC('Y', '1', '6', ''))