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
ScaleBarR <- function( | |
start_x=NA, | |
start_y=NA, | |
dist=NA, | |
source_prj=NA, | |
scale_prj=32610 | |
){ | |
dd <- data.frame(x=start_x, y=start_y, id=1) | |
coordinates(dd) <- ~x+y |
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
RastObjAlign <- function( | |
h_aling=TRUE, | |
bg_rast=NA, | |
orig_width_in=11, | |
orig_height_in=8.5, | |
insert_img=NA, | |
x_pos_cent_set=NA, | |
y_pos_bottom_set=NA | |
# Get Dimensions in Inkscape with Ctrl+Shift+E export png image | |
){ |
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
################################################ | |
# Match two strings in any order: | |
'hi jack here is james' | |
'hi james here is jack' | |
^(?=.*\bjack\b)(?=.*\bjames\b).*$ | |
################################################ | |
# Match two strings with anything in between: | |
'hi jack here is james' |
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
install.packages("R2admb") | |
install.packages("glmmADMB", | |
repos=c("http://glmmadmb.r-forge.r-project.org/repos", | |
getOption("repos")), | |
type="source") | |
# does this works! | |
# R 3.3.1 & R 3.0.0 | |
library(glmmADMB) |
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
#' Find the occurence and count of occurence for a text string across php files. | |
#' | |
#' @param path A path directory to search in containing php files of interest. | |
#' @param files A list of files to search within. | |
#' @param search_for A text string to search for within php files. | |
#' @return The count of \code{search_for} occurences across php \code{files}. | |
#' @examples | |
#' # Define main root directories to search within | |
#' foldergroup <- "C:/Users/me/Desktop" | |
#' # Specify the phrase to search for |
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
#' Replace multiple strings across multiple files with original values and replacement values. | |
#' | |
#' files - A character string of file names to work through. | |
#' f - A character string of original values that you want to replace. | |
#' r - A character string of replacement values (f->r). | |
multi_replace <- function(files="", f="", r=""){ | |
file_line = data.frame() # (optional) tracking table | |
#loop through each file separately | |
for(j in 1:length(files)){ | |
nl <- suppressWarnings(readLines(files[j])) # read file line by line |