content large_stringlengths 0 6.46M | path large_stringlengths 3 331 | license_type large_stringclasses 2
values | repo_name large_stringlengths 5 125 | language large_stringclasses 1
value | is_vendor bool 2
classes | is_generated bool 2
classes | length_bytes int64 4 6.46M | extension large_stringclasses 75
values | text stringlengths 0 6.46M |
|---|---|---|---|---|---|---|---|---|---|
# Aux function for AUCell.assignCells
#' @importFrom stats sd
#' @importFrom stats ks.test
#' @importFrom stats rnorm
#' @importFrom stats qnorm
#' @importFrom stats dnorm
#' @importFrom stats density
#' @importFrom utils installed.packages
#' @importFrom utils capture.output
#' @importFrom graphics lines
#' @importFro... | /R/priv_auc.assignmnetThreshold_v6.R | no_license | alexander-7/AUCell | R | false | false | 12,438 | r | # Aux function for AUCell.assignCells
#' @importFrom stats sd
#' @importFrom stats ks.test
#' @importFrom stats rnorm
#' @importFrom stats qnorm
#' @importFrom stats dnorm
#' @importFrom stats density
#' @importFrom utils installed.packages
#' @importFrom utils capture.output
#' @importFrom graphics lines
#' @importFro... |
## Instructions for today:
- Part 1: Course Overview [10 mins]
- The big picture
- [Teaching Evaluations for Firas](https://canvas.ubc.ca/courses/45004/external_tools/4732)
- Part 2: Deploy the class app [30 mins]
- Install Heroku Command line interface
- Copy the required files to your repo
- Push the c... | /main.r | no_license | Farnaz1234/deployed_class_app | R | false | false | 578 | r | ## Instructions for today:
- Part 1: Course Overview [10 mins]
- The big picture
- [Teaching Evaluations for Firas](https://canvas.ubc.ca/courses/45004/external_tools/4732)
- Part 2: Deploy the class app [30 mins]
- Install Heroku Command line interface
- Copy the required files to your repo
- Push the c... |
# server.R
### Start Reactive Function ###
shinyServer(function(input, output, session) {
# Generate your plot using ggvis with reactive inputs
gv <- reactive({
# Change error message if no player is selected
validate(
need(input$player != "", "Please select a player from the dropdown.... | /NHLShotCharts/server.R | no_license | danmalter/nhl_shot_charts | R | false | false | 7,912 | r | # server.R
### Start Reactive Function ###
shinyServer(function(input, output, session) {
# Generate your plot using ggvis with reactive inputs
gv <- reactive({
# Change error message if no player is selected
validate(
need(input$player != "", "Please select a player from the dropdown.... |
# Course Project week1 Exploratory data analysis
require(lubridate) #work with date filtering
## Estimating the Size of a Table
## memory required = no. of column * no. of rows * 8 bytes/numeric
2075259*9*8/(10^6) #roughly estimate of size in MB
##downloading and reading the data
site<-"https://d396qusza40orc.cloudf... | /plot1.R | no_license | diego042/ExData_Plotting1 | R | false | false | 1,442 | r | # Course Project week1 Exploratory data analysis
require(lubridate) #work with date filtering
## Estimating the Size of a Table
## memory required = no. of column * no. of rows * 8 bytes/numeric
2075259*9*8/(10^6) #roughly estimate of size in MB
##downloading and reading the data
site<-"https://d396qusza40orc.cloudf... |
library(data.table)
library(genoPlotR)
dna_seg1 <- read_dna_seg_from_tab('pxr1_cluster.csv')
is.dna_seg(dna_seg1)
annot1 <- annotation(x1=middle(dna_seg1), text=dna_seg1$name, rot=45)
dna_seg4 <- read_dna_seg_from_tab('pxr_cluster.tab.csv')
is.dna_seg(dna_seg4)
annot4 <- annotation(x1=middle(dna_seg4), text=dn... | /figure_cluster.R | no_license | EmilyAmor/post_doc | R | false | false | 1,288 | r | library(data.table)
library(genoPlotR)
dna_seg1 <- read_dna_seg_from_tab('pxr1_cluster.csv')
is.dna_seg(dna_seg1)
annot1 <- annotation(x1=middle(dna_seg1), text=dna_seg1$name, rot=45)
dna_seg4 <- read_dna_seg_from_tab('pxr_cluster.tab.csv')
is.dna_seg(dna_seg4)
annot4 <- annotation(x1=middle(dna_seg4), text=dn... |
testlist <- list(Rs = numeric(0), atmp = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), relh = -1.72131968218895e+83, temp = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.80033518839696e+41, 2.68298522855314e-211, 1444042902784.06, 6.68889884134308e+51... | /meteor/inst/testfiles/ET0_Makkink/AFL_ET0_Makkink/ET0_Makkink_valgrind_files/1615846726-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 663 | r | testlist <- list(Rs = numeric(0), atmp = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), relh = -1.72131968218895e+83, temp = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.80033518839696e+41, 2.68298522855314e-211, 1444042902784.06, 6.68889884134308e+51... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/WorldClim_Clim.R
\docType{data}
\name{WorldClim_Clim}
\alias{WorldClim_Clim}
\title{WorldClim_Clim
\describe{
\item{STNID}{Unique station ID to link to GSOD data from \code{GSODR}}
\item{tmin1}{Mean Minimum Temperature for January}
\item{tmin... | /man/WorldClim_Clim.Rd | permissive | KevCaz/GSODRdata | R | false | true | 6,015 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/WorldClim_Clim.R
\docType{data}
\name{WorldClim_Clim}
\alias{WorldClim_Clim}
\title{WorldClim_Clim
\describe{
\item{STNID}{Unique station ID to link to GSOD data from \code{GSODR}}
\item{tmin1}{Mean Minimum Temperature for January}
\item{tmin... |
# Here are the data for the project:
#
# https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip
#
# You should create one R script called run_analysis.R that does the following.
#
# 1. Merges the training and the test sets to create one data set.
# 2. Extracts only the ... | /run_analysis.R | no_license | icound/G-and-Cleaning | R | false | false | 3,349 | r | # Here are the data for the project:
#
# https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip
#
# You should create one R script called run_analysis.R that does the following.
#
# 1. Merges the training and the test sets to create one data set.
# 2. Extracts only the ... |
## sqldf package needs to be installed and loaded for the code to work
power_consumption <- read.csv.sql("household_power_consumption.txt",
sql = "select * from file where Date in ('1/2/2007', '2/2/2007')",
sep = ";")
datetime <- as.POSIXct(strptime(paste(power_consump... | /plot3.R | no_license | Aquarella/ExData_Plotting1 | R | false | false | 1,407 | r | ## sqldf package needs to be installed and loaded for the code to work
power_consumption <- read.csv.sql("household_power_consumption.txt",
sql = "select * from file where Date in ('1/2/2007', '2/2/2007')",
sep = ";")
datetime <- as.POSIXct(strptime(paste(power_consump... |
#' @title Direct Adjusting in \pkg{popEpi} Using Weights
#' @author Joonas Miettinen
#' @name direct_standardization
#' @aliases direct_adjusting
#' @description
#'
#' Several functions in \pkg{popEpi} have support for direct standardization
#' of estimates. This document explains the usage of weighting ... | /popEpi/R/direct_adjusting.R | no_license | ingted/R-Examples | R | false | false | 6,046 | r |
#' @title Direct Adjusting in \pkg{popEpi} Using Weights
#' @author Joonas Miettinen
#' @name direct_standardization
#' @aliases direct_adjusting
#' @description
#'
#' Several functions in \pkg{popEpi} have support for direct standardization
#' of estimates. This document explains the usage of weighting ... |
library(tidyverse)
library(openxlsx)
library(xtable)
library(knitr)
participants <- read_csv('/home/labs/dnalab/share/lims/R/gcat-cohort/output/export/Participants/data.csv')
data <- read_csv('output/datasets/gcat/data.csv')
variables <-
read_csv('output/datasets/gcat/variables.csv') %>%
arrange(
category,
... | /R/datasets/gcat-heritability/data.R | no_license | xdurana/gcat-cleaning-data | R | false | false | 5,738 | r | library(tidyverse)
library(openxlsx)
library(xtable)
library(knitr)
participants <- read_csv('/home/labs/dnalab/share/lims/R/gcat-cohort/output/export/Participants/data.csv')
data <- read_csv('output/datasets/gcat/data.csv')
variables <-
read_csv('output/datasets/gcat/variables.csv') %>%
arrange(
category,
... |
# This has the results from Big1 and Big2.
# Big1 used UCB and gave bad results.
# Big2 used Greedy and seemed to work well.
# We fixed UCB while it was running, so UCB should work from now on.
x100 <- unname(as.matrix(read.csv("./scratch/redTime/redTimeData/ExpandedRanges2_LHS1L_n100_s0228_all_input.csv")[,-1]))
y100... | /scratch/redTime/lookatRedTimeResults_Big1.R | no_license | CollinErickson/CGGP | R | false | false | 22,149 | r | # This has the results from Big1 and Big2.
# Big1 used UCB and gave bad results.
# Big2 used Greedy and seemed to work well.
# We fixed UCB while it was running, so UCB should work from now on.
x100 <- unname(as.matrix(read.csv("./scratch/redTime/redTimeData/ExpandedRanges2_LHS1L_n100_s0228_all_input.csv")[,-1]))
y100... |
library(dplyr)
library(tidyr)
library(ggplot2)
################################################################################
# Import the daily demand for every start station and bind them into one
# long table
citi_files <- list.files()[grep("citi_", list.files(), fixed = TRUE)]
citi <- readRDS(citi_files[1])
f... | /citi_yoy.R | no_license | timradtke/stan_hierarchical_timeseries | R | false | false | 12,055 | r | library(dplyr)
library(tidyr)
library(ggplot2)
################################################################################
# Import the daily demand for every start station and bind them into one
# long table
citi_files <- list.files()[grep("citi_", list.files(), fixed = TRUE)]
citi <- readRDS(citi_files[1])
f... |
##################################################
# libraries
##################################################
library(psych)
library(caret)
library(rpart)
library(randomForest)
##################################################
# Linear Regression
##################################################
cars <- read.csv... | /final/6/final-6.R | no_license | rafid1970/is675 | R | false | false | 1,908 | r | ##################################################
# libraries
##################################################
library(psych)
library(caret)
library(rpart)
library(randomForest)
##################################################
# Linear Regression
##################################################
cars <- read.csv... |
## This function, in its entirety, caches the inverse of a matrix.
## The makeCacheMatrix function creates a matrix that is able to
## cache its inverse.
makeCacheMatrix <- function(x = matrix()) {
s <- NULL
set <- function(y){
x <<- y
s <<- NULL
}
get <- function() x
setsolve <- function(solve)... | /cachematrix.R | no_license | rachelleffel/ProgrammingAssignment2 | R | false | false | 773 | r | ## This function, in its entirety, caches the inverse of a matrix.
## The makeCacheMatrix function creates a matrix that is able to
## cache its inverse.
makeCacheMatrix <- function(x = matrix()) {
s <- NULL
set <- function(y){
x <<- y
s <<- NULL
}
get <- function() x
setsolve <- function(solve)... |
# Exercise 1: reading and querying a web API
# Load the httr and jsonlite libraries for accessing data
# You can also load `dplyr` if you wish to use it
library(httr)
library(jsonlite)
library(dplyr)
# Create a variable for the API's base URI (https://api.github.com)
base_uri <- "https://api.github.com"
# Under the ... | /exercise-1/exercise.R | permissive | tleung22/ch11-apis | R | false | false | 1,971 | r | # Exercise 1: reading and querying a web API
# Load the httr and jsonlite libraries for accessing data
# You can also load `dplyr` if you wish to use it
library(httr)
library(jsonlite)
library(dplyr)
# Create a variable for the API's base URI (https://api.github.com)
base_uri <- "https://api.github.com"
# Under the ... |
context("alvm.fit works for cars lm and boston lm across several argument permutations")
set.seed(234)
carslm <- lm(dist ~ speed, data = cars)
myalvms <- list(alvm.fit(carslm, model = "linear", varselect = "qgcv.linear"),
alvm.fit(carslm, model = "cluster", nclust = "elbow.mwd",
... | /tests/testthat/test-avm.ci.R | no_license | cran/skedastic | R | false | false | 3,906 | r | context("alvm.fit works for cars lm and boston lm across several argument permutations")
set.seed(234)
carslm <- lm(dist ~ speed, data = cars)
myalvms <- list(alvm.fit(carslm, model = "linear", varselect = "qgcv.linear"),
alvm.fit(carslm, model = "cluster", nclust = "elbow.mwd",
... |
plot3 <- function() {
####################### reading in data
## not reading entire txt file just to speed up loading
d<-read.table("household_power_consumption.txt",nrows=5000,skip=66000,sep=";")
## this is to read in the names of the columns
x<-read.table("household_power_consumption.txt",nrows=1,sep=";")
names(d... | /homework_expl_data_analysis_1/plot3.R | no_license | Cleokoz/ExData_Plotting1 | R | false | false | 1,047 | r | plot3 <- function() {
####################### reading in data
## not reading entire txt file just to speed up loading
d<-read.table("household_power_consumption.txt",nrows=5000,skip=66000,sep=";")
## this is to read in the names of the columns
x<-read.table("household_power_consumption.txt",nrows=1,sep=";")
names(d... |
context("twilight works")
test_that("arguments are valid", {
expect_error(tw_daylength(year = 2015, lon_deg = 80, lon_min = 26,
lat_deg = 25, lat_min = 5, tz = 5, state = "FL",
city = "Key Largo"),
"Must specify either a state/city or
geographi... | /tests/testthat/test-get.R | no_license | jsta/twilight | R | false | false | 781 | r | context("twilight works")
test_that("arguments are valid", {
expect_error(tw_daylength(year = 2015, lon_deg = 80, lon_min = 26,
lat_deg = 25, lat_min = 5, tz = 5, state = "FL",
city = "Key Largo"),
"Must specify either a state/city or
geographi... |
hitung <-function (num){
if(num >= 86){
sprintf("A")
}
else if(num >= 70){
sprintf("B")
}
else if(num >= 50){
sprintf("C")
}
} | /002_HitungABC.R | no_license | psychohaxer/praktikum-statistika-teknik | R | false | false | 148 | r | hitung <-function (num){
if(num >= 86){
sprintf("A")
}
else if(num >= 70){
sprintf("B")
}
else if(num >= 50){
sprintf("C")
}
} |
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/recognize.R
\name{recognize}
\alias{recognize}
\title{Recognize Image (Human Face)}
\usage{
recognize(x, y, rule = "simple f-share", display = TRUE)
}
\arguments{
\item{x}{string input; image file input to be recognize.}
\item{y}{mod... | /man/recognize.Rd | no_license | alstat/face | R | false | false | 1,104 | rd | % Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/recognize.R
\name{recognize}
\alias{recognize}
\title{Recognize Image (Human Face)}
\usage{
recognize(x, y, rule = "simple f-share", display = TRUE)
}
\arguments{
\item{x}{string input; image file input to be recognize.}
\item{y}{mod... |
#' @importFrom magrittr "%>%"
#' @title Weather by day, calendar month, or lunar month
#'
#' @description Summarize hourly weather data to either daily, monthly, or lunar monthly level.
#'
#' @param level specify 'monthly', 'daily', or 'newmoon'
#' @param fill specify if missing data should be filled, passed to \code{... | /R/Weather.R | permissive | emchristensen/portalr | R | false | false | 6,495 | r | #' @importFrom magrittr "%>%"
#' @title Weather by day, calendar month, or lunar month
#'
#' @description Summarize hourly weather data to either daily, monthly, or lunar monthly level.
#'
#' @param level specify 'monthly', 'daily', or 'newmoon'
#' @param fill specify if missing data should be filled, passed to \code{... |
install.packages("highcharter")
install.packages("plotly")
install.packages("gridExtra")
library(highcharter)
library(ggplot2)
library(dplyr)
library(xts)
library(plotly)
library(lubridate)
library(tidyr)
library(stringr)
library(readr)
library(gridExtra)
library(scales)
| /src/007_highcharter.R | permissive | HyeonjongPark/rds_blogger | R | false | false | 275 | r |
install.packages("highcharter")
install.packages("plotly")
install.packages("gridExtra")
library(highcharter)
library(ggplot2)
library(dplyr)
library(xts)
library(plotly)
library(lubridate)
library(tidyr)
library(stringr)
library(readr)
library(gridExtra)
library(scales)
|
readsOut <- function(reads, bam.out){
adp <- lapply(reads, function(x){
c(colSums(as.matrix(mcols(x)[,-(1:5)]), na.rm = TRUE), DP=length(x))
})
if(!missing(bam.out)){
reads <- lapply(reads, function(x){
F <- as.list(mcols(x)[,-c(1:5)])
for(i in 1:length(F)){
... | /R/GenomicFiles.R | no_license | hubentu/VarReviewer | R | false | false | 2,575 | r |
readsOut <- function(reads, bam.out){
adp <- lapply(reads, function(x){
c(colSums(as.matrix(mcols(x)[,-(1:5)]), na.rm = TRUE), DP=length(x))
})
if(!missing(bam.out)){
reads <- lapply(reads, function(x){
F <- as.list(mcols(x)[,-c(1:5)])
for(i in 1:length(F)){
... |
# Time Series
# Create Time Series data of Finance Sales
sales = c(18, 33, 41, 7, 34, 35, 24, 25, 24, 21, 25, 20,
22, 31, 40, 29, 25, 21, 22, 54, 31, 25, 26, 35)
length(sales)
sales ; class(sales) # vector of sales values
#put in TS without any dates : format of TS
?ts # help
#ts(data = NA, start = 1, end... | /timeseries1.R | no_license | harshilsumra/analytics | R | false | false | 3,929 | r | # Time Series
# Create Time Series data of Finance Sales
sales = c(18, 33, 41, 7, 34, 35, 24, 25, 24, 21, 25, 20,
22, 31, 40, 29, 25, 21, 22, 54, 31, 25, 26, 35)
length(sales)
sales ; class(sales) # vector of sales values
#put in TS without any dates : format of TS
?ts # help
#ts(data = NA, start = 1, end... |
makeForestClassModel <- function(pixelGroupMap,
cohortData,
rstLCC,
classTable = data.table(standLeading = c("pureCon_dense", "pureCon_open",
"pur... | /R/makeForestClassModel.R | no_license | tati-micheletti/caribouRSF_NT | R | false | false | 4,540 | r | makeForestClassModel <- function(pixelGroupMap,
cohortData,
rstLCC,
classTable = data.table(standLeading = c("pureCon_dense", "pureCon_open",
"pur... |
git_commute <- function(){
git_commute_location <- 'CleanData/commute.rds'
if(!file.exists(git_commute_location)){
source('R/funCensus.R')
dt.census <- funCensus()
dt_commute <- dt.census[, .(origin.tract = tract, commute.driving.n = car.n + carpool.n, commute.transit.n = bus.n, commute.... | /R/git_commute.R | no_license | erikbjohn/segregation | R | false | false | 880 | r | git_commute <- function(){
git_commute_location <- 'CleanData/commute.rds'
if(!file.exists(git_commute_location)){
source('R/funCensus.R')
dt.census <- funCensus()
dt_commute <- dt.census[, .(origin.tract = tract, commute.driving.n = car.n + carpool.n, commute.transit.n = bus.n, commute.... |
## Wrangling county-level election results
# Load data
library(here)
library(tidyverse)
votes <- read_csv(here("data", "countypres_2000-2020.csv"))
# Need to focus on 2020 and 2016
votes <- votes %>%
filter(year %in% c(2016, 2020))
# Getting the two-party vote formatted
votes2016 <- votes %>%
filter(year == 2016... | /data/election_wrangle.R | no_license | sheny2/stat340-notes-fa21 | R | false | false | 1,751 | r | ## Wrangling county-level election results
# Load data
library(here)
library(tidyverse)
votes <- read_csv(here("data", "countypres_2000-2020.csv"))
# Need to focus on 2020 and 2016
votes <- votes %>%
filter(year %in% c(2016, 2020))
# Getting the two-party vote formatted
votes2016 <- votes %>%
filter(year == 2016... |
% File src/library/utils/man/unix/COMPILE.Rd
% Part of the R package, https://www.R-project.org
% Copyright 1995-2014 R Core Team
% Distributed under GPL 2 or later
\name{COMPILE}
\alias{COMPILE}
\title{Compile Files for Use with R}
\description{
Compile given source files so that they can subsequently be collected
... | /bin/R-3.5.1/src/library/utils/man/unix/COMPILE.Rd | permissive | lifebit-ai/exomedepth | R | false | false | 2,410 | rd | % File src/library/utils/man/unix/COMPILE.Rd
% Part of the R package, https://www.R-project.org
% Copyright 1995-2014 R Core Team
% Distributed under GPL 2 or later
\name{COMPILE}
\alias{COMPILE}
\title{Compile Files for Use with R}
\description{
Compile given source files so that they can subsequently be collected
... |
library(swirl)
install_from_swirl("R Programming")
swirl()
#3. Sequences of Numbers
#:
1:20
pi:10
15:1
?`:`
#seq function
seq(1,20)
seq(0,10,by = 0.5)
my_seq <- seq(5,10,length=30)
length(my_seq)
1:length(my_seq)
seq(along.with=my_seq)
seq_along(my_seq)
#rep function
rep(0,times=40)
rep(c(0,1,2),times=10)
rep(c(0,1... | /Course2 R programming/swirl/3 Sequences of Numbers.R | no_license | Heloisej/datasciencecoursera | R | false | false | 333 | r | library(swirl)
install_from_swirl("R Programming")
swirl()
#3. Sequences of Numbers
#:
1:20
pi:10
15:1
?`:`
#seq function
seq(1,20)
seq(0,10,by = 0.5)
my_seq <- seq(5,10,length=30)
length(my_seq)
1:length(my_seq)
seq(along.with=my_seq)
seq_along(my_seq)
#rep function
rep(0,times=40)
rep(c(0,1,2),times=10)
rep(c(0,1... |
/old usb backup/on machine/bruce.rd | no_license | htbrdd/rdworks-files | R | false | false | 39,833 | rd | ||
# import
library(foreign)
fichierDBF <- read.dbf("../data/labo2/SR_Data.dbf")
| /labo/tests/test.R | permissive | giotta/EUR8217 | R | false | false | 79 | r | # import
library(foreign)
fichierDBF <- read.dbf("../data/labo2/SR_Data.dbf")
|
#' Match reviewers for a submitted article based on keywords
#'
#' \code{match_keywords} matches an article to potential reviewers through
#' first extract the keywords of the article (\code{get_article_keywords})
#' and then query the reviewer googlesheet for registered reviewers and their
#' interested reviewin... | /R/match.R | no_license | pridiltal/rj | R | false | false | 5,158 | r | #' Match reviewers for a submitted article based on keywords
#'
#' \code{match_keywords} matches an article to potential reviewers through
#' first extract the keywords of the article (\code{get_article_keywords})
#' and then query the reviewer googlesheet for registered reviewers and their
#' interested reviewin... |
#' Calculate the log-likelihood of the posterior predictive distribution
#'
#' @param x A dataframe of posterior predictions.
#' @param response The name of the response variable.
#' @param censored The name of the censoring indicator.
#' @param cens Logical. Is the response censored?
#' @param upper For interval censo... | /R/calc_ll.R | permissive | bentrueman/bgamcar1 | R | false | false | 2,086 | r | #' Calculate the log-likelihood of the posterior predictive distribution
#'
#' @param x A dataframe of posterior predictions.
#' @param response The name of the response variable.
#' @param censored The name of the censoring indicator.
#' @param cens Logical. Is the response censored?
#' @param upper For interval censo... |
# Read in entire File
power_consumption <- read.table("household_power_consumption.txt", sep=";", header =TRUE)
#subset the data with the 2 dates
power_Feb <- subset(power_consumption,Date == "1/2/2007" | Date =="2/2/2007")
# Check the distinct dates in the subset as a sanity check
unique(power_Feb$Date)
#d... | /plot2.R | no_license | klehabe/ExData_Plotting1 | R | false | false | 979 | r | # Read in entire File
power_consumption <- read.table("household_power_consumption.txt", sep=";", header =TRUE)
#subset the data with the 2 dates
power_Feb <- subset(power_consumption,Date == "1/2/2007" | Date =="2/2/2007")
# Check the distinct dates in the subset as a sanity check
unique(power_Feb$Date)
#d... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/iphc.R
\name{format_final_year_for_map_iphc}
\alias{format_final_year_for_map_iphc}
\title{Format the final year of IPHC data to use in the spatial map}
\usage{
format_final_year_for_map_iphc(set_counts, final_year)
}
\arguments{
\item{set_co... | /man/format_final_year_for_map_iphc.Rd | no_license | pbs-assess/gfsynopsis | R | false | true | 1,067 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/iphc.R
\name{format_final_year_for_map_iphc}
\alias{format_final_year_for_map_iphc}
\title{Format the final year of IPHC data to use in the spatial map}
\usage{
format_final_year_for_map_iphc(set_counts, final_year)
}
\arguments{
\item{set_co... |
library(ggplot2)
library(tmap)
drzavni_dolg <- ggplot(drzavni_dolg, aes(x=Leto, y= Dolg_bdp)) +
geom_line() +
ggtitle("Državni dolg Slovenije") + xlab("Leto") + ylab("Dolg")
bdp_graf <- ggplot(bdp, aes(x = Leto, y = Vrednost)) + geom_point(aes(colour = factor(Regija))) +
labs(title = "BDP slovenskih regi... | /vizualizacija/moja_v.R | permissive | tomrupnik/APPR-2019-20 | R | false | false | 1,315 | r | library(ggplot2)
library(tmap)
drzavni_dolg <- ggplot(drzavni_dolg, aes(x=Leto, y= Dolg_bdp)) +
geom_line() +
ggtitle("Državni dolg Slovenije") + xlab("Leto") + ylab("Dolg")
bdp_graf <- ggplot(bdp, aes(x = Leto, y = Vrednost)) + geom_point(aes(colour = factor(Regija))) +
labs(title = "BDP slovenskih regi... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/htl.R
\name{htl}
\alias{htl}
\title{FUNCTION_TITLE}
\usage{
htl(df, laenge = 2)
}
\arguments{
\item{df}{PARAM_DESCRIPTION}
\item{laenge}{PARAM_DESCRIPTION, Default: 2}
}
\value{
OUTPUT_DESCRIPTION
}
\description{
FUNCTION_DESCRIPTION
}
\deta... | /man/htl.Rd | no_license | holgerman/toolboxH | R | false | true | 393 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/htl.R
\name{htl}
\alias{htl}
\title{FUNCTION_TITLE}
\usage{
htl(df, laenge = 2)
}
\arguments{
\item{df}{PARAM_DESCRIPTION}
\item{laenge}{PARAM_DESCRIPTION, Default: 2}
}
\value{
OUTPUT_DESCRIPTION
}
\description{
FUNCTION_DESCRIPTION
}
\deta... |
\name{itc}
\alias{itc}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Prepares and fits an ITC Cox model
}
\description{
Calls treatinit() to prepare dataset
Calls itcadd() to create ITC intervals
Calls addtc() to create TC intervals
Calls itcfitter() to fit ITC model
}
\usage{
itc(... | /man/itc.Rd | no_license | trooper197/tccox | R | false | false | 3,213 | rd | \name{itc}
\alias{itc}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Prepares and fits an ITC Cox model
}
\description{
Calls treatinit() to prepare dataset
Calls itcadd() to create ITC intervals
Calls addtc() to create TC intervals
Calls itcfitter() to fit ITC model
}
\usage{
itc(... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mc_int.r
\name{plot.MCI}
\alias{plot.MCI}
\title{Plot MC integral}
\usage{
\method{plot}{MCI}(x, ...)
}
\description{
Explain what the function does
}
\author{
me!
}
| /man/plot.MCI.Rd | no_license | stephaneguerrier/inclassdemo | R | false | true | 244 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mc_int.r
\name{plot.MCI}
\alias{plot.MCI}
\title{Plot MC integral}
\usage{
\method{plot}{MCI}(x, ...)
}
\description{
Explain what the function does
}
\author{
me!
}
|
robust.factor<-function(data,q)
{
fac <- NULL
S <- huber.M(data)
means <- S$loc
datac <- sweep(data,2,means,"-")
# get matrix square root of S$cov:
apu <- eigen(S$cov)
L <- apu$values
P <- apu$vectors
z <- datac %*% P%*%(diag(L^(-1/2)))%*%t(P)
r <- sqr... | /R/robust.factor.R | no_license | cran/smatr | R | false | false | 1,029 | r | robust.factor<-function(data,q)
{
fac <- NULL
S <- huber.M(data)
means <- S$loc
datac <- sweep(data,2,means,"-")
# get matrix square root of S$cov:
apu <- eigen(S$cov)
L <- apu$values
P <- apu$vectors
z <- datac %*% P%*%(diag(L^(-1/2)))%*%t(P)
r <- sqr... |
# UI function for module example
# The UI for this app is very simple. It consists of a standard shiny fluidPage
# structure, with a titlePanel and a sidebarLayout. The sidebar and mainbody
# of the sidebarLayout are made into separate modules.
#' @import shiny
app_ui <- function() {
fluidPage(
# Application title... | /modules_interactions_example/app_ui.R | no_license | jhhughes256/shinyapps | R | false | false | 484 | r | # UI function for module example
# The UI for this app is very simple. It consists of a standard shiny fluidPage
# structure, with a titlePanel and a sidebarLayout. The sidebar and mainbody
# of the sidebarLayout are made into separate modules.
#' @import shiny
app_ui <- function() {
fluidPage(
# Application title... |
# This file is generated by make.paws. Please do not edit here.
#' @importFrom paws.common new_handlers new_service set_config
NULL
#' Managed Streaming for Kafka
#'
#'
#'
#' @param
#' config
#' Optional configuration of credentials, endpoint, and/or region.
#'
#' @section Service syntax:
#' ```
#' svc <- kafka(
#' ... | /paws/R/kafka_service.R | permissive | ryanb8/paws | R | false | false | 4,105 | r | # This file is generated by make.paws. Please do not edit here.
#' @importFrom paws.common new_handlers new_service set_config
NULL
#' Managed Streaming for Kafka
#'
#'
#'
#' @param
#' config
#' Optional configuration of credentials, endpoint, and/or region.
#'
#' @section Service syntax:
#' ```
#' svc <- kafka(
#' ... |
library("dplyr")
library("lubridate")
# read the data from file into a data frame tbl
power <- tbl_df(read.table('household_power_consumption.txt', sep = ';',
header = TRUE, na.strings = '?'))
# create a POSIX Datetime column instead of the raw Date and Time columns
# and filter based on... | /load_data.R | no_license | eztzachi/ExData_Plotting1 | R | false | false | 674 | r | library("dplyr")
library("lubridate")
# read the data from file into a data frame tbl
power <- tbl_df(read.table('household_power_consumption.txt', sep = ';',
header = TRUE, na.strings = '?'))
# create a POSIX Datetime column instead of the raw Date and Time columns
# and filter based on... |
#' Run a specified number of simulations with identical parameters
#' @author Joel Hellewell
#' @param n.sim number of simulations to run
#' @param num.initial.cases Initial number of cases in each initial cluster
#' @param num.initial.clusters Number of initial clusters
#' @param prop.ascertain Probability that cases ... | /R/scenario_sim.R | permissive | emmalouisedavis/ringbp | R | false | false | 2,903 | r | #' Run a specified number of simulations with identical parameters
#' @author Joel Hellewell
#' @param n.sim number of simulations to run
#' @param num.initial.cases Initial number of cases in each initial cluster
#' @param num.initial.clusters Number of initial clusters
#' @param prop.ascertain Probability that cases ... |
require(ggplot2)
require(reshape2)
require(quantmod)
require(PerformanceAnalytics)
require(xtsExtra)
data(edhec)
origin = 0
horizonscale = 100
#get 12 month rolling return of edhec indexes
roc <- as.xts(apply(cumprod(edhec+1),MARGIN=2,ROC,n=12,type="discrete"),order.by=index(edhec))
roc.df <- as.data.frame(cbind(ind... | /examples/temporal/wiki-revision/horizon_chart.R | no_license | yonghah/yonsei-workshop | R | false | false | 3,618 | r |
require(ggplot2)
require(reshape2)
require(quantmod)
require(PerformanceAnalytics)
require(xtsExtra)
data(edhec)
origin = 0
horizonscale = 100
#get 12 month rolling return of edhec indexes
roc <- as.xts(apply(cumprod(edhec+1),MARGIN=2,ROC,n=12,type="discrete"),order.by=index(edhec))
roc.df <- as.data.frame(cbind(ind... |
##Data Science - Johns Hopkins University
##coursera
## course 2 - R
##week2
count <- 0
while(count<10){
print(count)
count<- count+1
}
z<-5
while(z>=3 && z<=10){
print(paste("z: ",z))
coin <- rbinom(1,1,0.5) # gives 1 or 0 randomly like coin throw
print(paste("coin: ",coin))
if(coin==1) {... | /coursera/c2w2 - whileLoop.R | no_license | tmPolla/R | R | false | false | 384 | r | ##Data Science - Johns Hopkins University
##coursera
## course 2 - R
##week2
count <- 0
while(count<10){
print(count)
count<- count+1
}
z<-5
while(z>=3 && z<=10){
print(paste("z: ",z))
coin <- rbinom(1,1,0.5) # gives 1 or 0 randomly like coin throw
print(paste("coin: ",coin))
if(coin==1) {... |
pacman::p_load(sf, fst, ggplot2, data.table, dplyr, RColorBrewer, viridis)
source("figures/theme_map.R")
windowsFonts(Times = windowsFont("Times New Roman")) # For windows computer LM Roman 10
default_font_family = "Times"
# **************** Read in shape files ****************
crs_use = "+proj=laea +lat_0=35 +l... | /Journal submission/Aim 3 - Journal of the American Statistical Association/Figures/Map_JASA_Aim3_ping.R | no_license | caimiao0714/MiaoPhDDissertation | R | false | false | 5,805 | r | pacman::p_load(sf, fst, ggplot2, data.table, dplyr, RColorBrewer, viridis)
source("figures/theme_map.R")
windowsFonts(Times = windowsFont("Times New Roman")) # For windows computer LM Roman 10
default_font_family = "Times"
# **************** Read in shape files ****************
crs_use = "+proj=laea +lat_0=35 +l... |
library(DiceKriging)
d <- 2; n <- 16
design.fact <- expand.grid(x1=seq(0,1,length=4), x2=seq(0,1,length=4))
Xtest <- as.data.frame(matrix(runif(100*2),100,2))
colnames(Xtest) <- colnames(design.fact)
y <- apply(design.fact, 1, branin)
m1 <- km(formula=~1,design=design.fact, response=y, covtype="gauss")
cc.theta <- m1@c... | /bindings/R/Rcpp/test.R | permissive | libKriging/libKriging | R | false | false | 706 | r | library(DiceKriging)
d <- 2; n <- 16
design.fact <- expand.grid(x1=seq(0,1,length=4), x2=seq(0,1,length=4))
Xtest <- as.data.frame(matrix(runif(100*2),100,2))
colnames(Xtest) <- colnames(design.fact)
y <- apply(design.fact, 1, branin)
m1 <- km(formula=~1,design=design.fact, response=y, covtype="gauss")
cc.theta <- m1@c... |
estimate_bandwidth <- function(data,method="silverman")
{
# remove missing cases
data <- na.omit(data)
npoints = nrow(data)
ndim <- ncol(data)
if (method=="silverman")
{
stdev = apply(data,2,sd)
normal_silverman_bw = 1.06 * stdev * npoints ^ (-1/5)
# scale to box width
rect_bw =... | /hypervolume/R/estimate_bandwidth.R | no_license | ingted/R-Examples | R | false | false | 1,286 | r | estimate_bandwidth <- function(data,method="silverman")
{
# remove missing cases
data <- na.omit(data)
npoints = nrow(data)
ndim <- ncol(data)
if (method=="silverman")
{
stdev = apply(data,2,sd)
normal_silverman_bw = 1.06 * stdev * npoints ^ (-1/5)
# scale to box width
rect_bw =... |
numf <- function(s) {
strsplit(gsub("[^-. 0123456789]", "", s), " ")[[1]]
}
cat(sapply(lapply(readLines(tail(commandArgs(), n=1)), numf), function(s) {
t <- as.double(s)
t <- t[!is.na(t)]
x <- t[4]-t[1]
y <- t[5]-t[2]
if (x*x + y*y <= t[3]*t[3]) {
"true"
} else {
"false"
}
}), sep="\n")
| /moderate/point_in_circle.r | permissive | shortthirdman/code-eval-challenges | R | false | false | 312 | r | numf <- function(s) {
strsplit(gsub("[^-. 0123456789]", "", s), " ")[[1]]
}
cat(sapply(lapply(readLines(tail(commandArgs(), n=1)), numf), function(s) {
t <- as.double(s)
t <- t[!is.na(t)]
x <- t[4]-t[1]
y <- t[5]-t[2]
if (x*x + y*y <= t[3]*t[3]) {
"true"
} else {
"false"
}
}), sep="\n")
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/met.process.R
\name{met.process}
\alias{met.process}
\title{met.process}
\usage{
met.process(
site,
input_met,
start_date,
end_date,
model,
host = "localhost",
dbparms,
dir,
browndog = NULL,
spin = NULL,
overwrite = FALS... | /modules/data.atmosphere/man/met.process.Rd | permissive | PecanProject/pecan | R | false | true | 1,673 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/met.process.R
\name{met.process}
\alias{met.process}
\title{met.process}
\usage{
met.process(
site,
input_met,
start_date,
end_date,
model,
host = "localhost",
dbparms,
dir,
browndog = NULL,
spin = NULL,
overwrite = FALS... |
\name{createTexreg}
\alias{createTexreg}
\title{Create a texreg object}
\description{Create a texreg object with coefficients and GOF statistics.}
\usage{
createTexreg(coef.names, coef, se, pvalues = numeric(0), ci.low = numeric(0),
ci.up = numeric(0), gof.names = character(0), gof = numeric(0),
gof.decimal =... | /man/createTexreg.Rd | no_license | nfultz/texreg | R | false | false | 3,460 | rd | \name{createTexreg}
\alias{createTexreg}
\title{Create a texreg object}
\description{Create a texreg object with coefficients and GOF statistics.}
\usage{
createTexreg(coef.names, coef, se, pvalues = numeric(0), ci.low = numeric(0),
ci.up = numeric(0), gof.names = character(0), gof = numeric(0),
gof.decimal =... |
#-----------------------------------------------------------------#
# Exploratory Data Analysis Assignmant 1
#
# Data : Household power consumption
#
# Target -> make some plots
#
# plot3
#
#-----------------------------------------------------------------#
library(jpeg)
library(readr)
library(dplyr)
HPCdata... | /plot3.R | no_license | cwerneck/ExData-032 | R | false | false | 1,072 | r | #-----------------------------------------------------------------#
# Exploratory Data Analysis Assignmant 1
#
# Data : Household power consumption
#
# Target -> make some plots
#
# plot3
#
#-----------------------------------------------------------------#
library(jpeg)
library(readr)
library(dplyr)
HPCdata... |
## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
## A Special matrix that caches its inverse
makeCacheMatrix <- function(m = matrix()) {
## Initialized inverse i
i <- NULL
set <- function(y) {
... | /cachematrix.R | no_license | bkch/ProgrammingAssignment2 | R | false | false | 1,164 | r | ## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
## A Special matrix that caches its inverse
makeCacheMatrix <- function(m = matrix()) {
## Initialized inverse i
i <- NULL
set <- function(y) {
... |
# Acknowledgement: This file is modified from gWQS.
# functtion to define the objective function
objfn <- function(initp, Q, y, family, covrts, b1_constr){
b0 = initp[1]
b1 = initp[2]
w = initp[3:(dim(Q)[2]+2)]
cvrt_coeff = initp[(dim(Q)[2]+3):length(initp)]
if(dim(covrts)[2] == 0) term = b0 + b1*Q%*%w
... | /R/wqs-helpers.R | permissive | ck37/tlmixture | R | false | false | 5,861 | r | # Acknowledgement: This file is modified from gWQS.
# functtion to define the objective function
objfn <- function(initp, Q, y, family, covrts, b1_constr){
b0 = initp[1]
b1 = initp[2]
w = initp[3:(dim(Q)[2]+2)]
cvrt_coeff = initp[(dim(Q)[2]+3):length(initp)]
if(dim(covrts)[2] == 0) term = b0 + b1*Q%*%w
... |
library(tidyverse)
library(dslabs)
data(murders)
murder_rate <- murders$total / murders$population * 100000
index <- murder_rate < 0.71
index <- murder_rate <= 0.71
index
murders$state[index]
west <- murders$region == "West"
safe <- murder_rate <= 1
index <- safe & west
murders$state[index]
# to determine the mur... | /RIndexing.r | no_license | mspalione/R | R | false | false | 817 | r | library(tidyverse)
library(dslabs)
data(murders)
murder_rate <- murders$total / murders$population * 100000
index <- murder_rate < 0.71
index <- murder_rate <= 0.71
index
murders$state[index]
west <- murders$region == "West"
safe <- murder_rate <= 1
index <- safe & west
murders$state[index]
# to determine the mur... |
c DCNF-Autarky [version 0.0.1].
c Copyright (c) 2018-2019 Swansea University.
c
c Input Clause Count: 16321
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 13653
c
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 13653
c
c Input Parameter (command line, ... | /code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Experiments/Kronegger-Pfandler-Pichler/bomb/p20-1.pddl_planlen=41/p20-1.pddl_planlen=41.R | no_license | arey0pushpa/dcnf-autarky | R | false | false | 13,409 | r | c DCNF-Autarky [version 0.0.1].
c Copyright (c) 2018-2019 Swansea University.
c
c Input Clause Count: 16321
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 13653
c
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 13653
c
c Input Parameter (command line, ... |
# BioLink API
#
# API integration layer for linked biological objects. __Source:__ https://github.com/biolink/biolink-api/
#
# OpenAPI spec version: 0.1.1
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' @title Owlontology operations
#' @description swagger.Owlontology
#'
#' @field path Store... | /R/OwlontologyApi.r | permissive | charlieccarey/monarchr.biolink | R | false | false | 3,339 | r | # BioLink API
#
# API integration layer for linked biological objects. __Source:__ https://github.com/biolink/biolink-api/
#
# OpenAPI spec version: 0.1.1
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' @title Owlontology operations
#' @description swagger.Owlontology
#'
#' @field path Store... |
# make_ggbagplots.R
# uses ggplot to make bagplots
# first source code/make_tables_figures.R
library(aplpack)
# gets bagplots for SSB/SSBmsy vs catch/MSY in short and long term
get_td4_bagdata <- function(mytib){
myscenlabs <- sort(unique(mytib$Scenlab))
nscenlabs <- length(myscenlabs)
myibmlabs <- so... | /demonstrations/chris/demo_plots/make_ggbagplots.R | no_license | cmlegault/IBMWG | R | false | false | 5,305 | r | # make_ggbagplots.R
# uses ggplot to make bagplots
# first source code/make_tables_figures.R
library(aplpack)
# gets bagplots for SSB/SSBmsy vs catch/MSY in short and long term
get_td4_bagdata <- function(mytib){
myscenlabs <- sort(unique(mytib$Scenlab))
nscenlabs <- length(myscenlabs)
myibmlabs <- so... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utility_functions.R
\name{lowerUpper}
\alias{lowerUpper}
\title{Plotting Range Function}
\usage{
lowerUpper(int, dat)
}
\arguments{
\item{int}{the desired sub-interval over the range.}
\item{dat}{the vector of values over which to determine ... | /man/lowerUpper.Rd | permissive | rettopnivek/utilityf | R | false | true | 762 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utility_functions.R
\name{lowerUpper}
\alias{lowerUpper}
\title{Plotting Range Function}
\usage{
lowerUpper(int, dat)
}
\arguments{
\item{int}{the desired sub-interval over the range.}
\item{dat}{the vector of values over which to determine ... |
#' Calculates the equilibrium saturation concentration of oxygen in water at the
#' supplied conditions
#'
#' @param temp.water a numeric vector of water temperature in degrees Celsius,
#' or a \linkS4class{unitted} object of water temperatures.
#' @param pressure.air barometric pressure in millibars, or a
#' \l... | /R/calc_DO_at_sat.R | permissive | cyack/streamMetabolizer | R | false | false | 2,078 | r | #' Calculates the equilibrium saturation concentration of oxygen in water at the
#' supplied conditions
#'
#' @param temp.water a numeric vector of water temperature in degrees Celsius,
#' or a \linkS4class{unitted} object of water temperatures.
#' @param pressure.air barometric pressure in millibars, or a
#' \l... |
##########
##########
# This main file calls and runs all subsequent R files in this analysis
##########
##########
# AUTHOR: Cole B. Brookson
# DATE OF CREATION: 2021-05-20
##########
##########
# set-up =======================================================================
library(ggplot2)
library(re... | /src/visualization.R | no_license | colebrookson/reproducibility-tutorial-repo | R | false | false | 993 | r | ##########
##########
# This main file calls and runs all subsequent R files in this analysis
##########
##########
# AUTHOR: Cole B. Brookson
# DATE OF CREATION: 2021-05-20
##########
##########
# set-up =======================================================================
library(ggplot2)
library(re... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/profiles.R
\name{vj_profile}
\alias{vj_profile}
\title{Vertical Jump Profile}
\usage{
vj_profile(external_load = c(-40, -20, 0, 20, 40, 60, 80, 100), mass = 75, ...)
}
\arguments{
\item{external_load}{Numeric vector. Default is \code{c(-40, ... | /man/vj_profile.Rd | permissive | ouzlim/vjsim | R | false | true | 928 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/profiles.R
\name{vj_profile}
\alias{vj_profile}
\title{Vertical Jump Profile}
\usage{
vj_profile(external_load = c(-40, -20, 0, 20, 40, 60, 80, 100), mass = 75, ...)
}
\arguments{
\item{external_load}{Numeric vector. Default is \code{c(-40, ... |
# helper functions
# Takes in data and a list of vars in the format
# c("var1", "var2", "var3", "var4") and spits out
# the sum of the row ignoring missing values
comp_score <- function(data, vars) {
rowSums(data[vars], na.rm = TRUE)
}
| /R/functions/helper_functions.R | no_license | nzfarhad/AFG_MSNA_19_Analysis | R | false | false | 246 | r | # helper functions
# Takes in data and a list of vars in the format
# c("var1", "var2", "var3", "var4") and spits out
# the sum of the row ignoring missing values
comp_score <- function(data, vars) {
rowSums(data[vars], na.rm = TRUE)
}
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/abund_rel_vec.R
\name{abund_rel_vec}
\alias{abund_rel_vec}
\title{Calculate relative abundance (possibly depracated)}
\usage{
abund_rel_vec(traj.list, K = NA, years.vec = 10)
}
\arguments{
\item{traj.list}{a list of simulation outputs (high.l... | /man/abund_rel_vec.Rd | no_license | mcsiple/ltbycatch | R | false | true | 677 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/abund_rel_vec.R
\name{abund_rel_vec}
\alias{abund_rel_vec}
\title{Calculate relative abundance (possibly depracated)}
\usage{
abund_rel_vec(traj.list, K = NA, years.vec = 10)
}
\arguments{
\item{traj.list}{a list of simulation outputs (high.l... |
# This tests that correctExperiments() does its job.
# library(testthat); library(batchelor); source("test-correct-exps.R")
library(scuttle)
sce1 <- mockSCE(ngenes=100)
sce2 <- mockSCE(ngenes=100)
sce1 <- logNormCounts(sce1)
sce2 <- logNormCounts(sce2)
test_that("correctExperiments works properly", {
merged <- co... | /tests/testthat/test-correct-exps.R | no_license | LTLA/batchelor | R | false | false | 9,185 | r | # This tests that correctExperiments() does its job.
# library(testthat); library(batchelor); source("test-correct-exps.R")
library(scuttle)
sce1 <- mockSCE(ngenes=100)
sce2 <- mockSCE(ngenes=100)
sce1 <- logNormCounts(sce1)
sce2 <- logNormCounts(sce2)
test_that("correctExperiments works properly", {
merged <- co... |
library(ISLR)
library(boot)
boot.fn <- function(data, index) {
return(coef(lm(mpg~horsepower
, data = data, subset = index)
)
)
}
boot.fn(Auto, 1:392)
set.seed(1)
boot.fn(Auto, sample(392,392, replace = TRUE))
boot(Auto,boot.fn,1000)
boot.fn2 <- function(data, index) {
ret... | /ISLR_4d.R | no_license | YenMuHsin/Statistical_Learning_Basics | R | false | false | 550 | r | library(ISLR)
library(boot)
boot.fn <- function(data, index) {
return(coef(lm(mpg~horsepower
, data = data, subset = index)
)
)
}
boot.fn(Auto, 1:392)
set.seed(1)
boot.fn(Auto, sample(392,392, replace = TRUE))
boot(Auto,boot.fn,1000)
boot.fn2 <- function(data, index) {
ret... |
sampleMeta[match(rownames(m),sampleMeta$fileName),]
compareind = c(6,7)
maind2 = m[compareind,]
colsanysig = which(sapply(1:ncol(maind2), function(x) any(as.matrix(maind2)[,x]>0))==T)
maind2 = maind2[,colsanysig]
pm2 = phenoMeta[!is.na(match(phenoMeta$phenotype,colnames(maind2))),] #same order as columns
## seperate... | /flowtype_flowcap_pipeline-master/201704/04_dist_match.R | no_license | aya49/flowGraph_experiments | R | false | false | 1,871 | r | sampleMeta[match(rownames(m),sampleMeta$fileName),]
compareind = c(6,7)
maind2 = m[compareind,]
colsanysig = which(sapply(1:ncol(maind2), function(x) any(as.matrix(maind2)[,x]>0))==T)
maind2 = maind2[,colsanysig]
pm2 = phenoMeta[!is.na(match(phenoMeta$phenotype,colnames(maind2))),] #same order as columns
## seperate... |
library(shiny)
library(shinydashboard)
library(tidymodels)
library(tidyverse)
model <- readRDS("./models/concrete_xgb_model.rds")
#the calculated specific volumes (m3/kg) for each ingredient
spec_vol <- readRDS("./models/concrete_spec_vol.rds")
# For testing prediction with given values
# test <- tibble("cement" = 2... | /concrete-dash.R | no_license | datadavidz/shiny-concrete | R | false | false | 5,665 | r | library(shiny)
library(shinydashboard)
library(tidymodels)
library(tidyverse)
model <- readRDS("./models/concrete_xgb_model.rds")
#the calculated specific volumes (m3/kg) for each ingredient
spec_vol <- readRDS("./models/concrete_spec_vol.rds")
# For testing prediction with given values
# test <- tibble("cement" = 2... |
#' Create a new droplet.
#'
#' There are defaults for each of size, image, and region so that a quick one-liner with one
#' parameter is possible: simply specify the name of the droplet and your'e up and running.
#'
#' @export
#' @param name (character) Name of the droplet. Default: picks a random name
#' from \code{... | /R/droplet-actions.R | no_license | Smaraki11/analogsea | R | false | false | 14,611 | r | #' Create a new droplet.
#'
#' There are defaults for each of size, image, and region so that a quick one-liner with one
#' parameter is possible: simply specify the name of the droplet and your'e up and running.
#'
#' @export
#' @param name (character) Name of the droplet. Default: picks a random name
#' from \code{... |
# ========= #
# GLOBAL ####
# ========= #
library(leaflet)
library(shiny)
library(jsonlite)
library(curl)
library(shinyWidgets)
# Jasmin's packages...
library(tidyverse)
library(lubridate)
library(leaflet)
library(ggplot2)
library(sf)
library(sp)
library(tmap) # for static and interactive maps
library(stplanr)
libra... | /scripts/app-dev.R | no_license | Emelieh21/Gefahrradtour | R | false | false | 15,059 | r | # ========= #
# GLOBAL ####
# ========= #
library(leaflet)
library(shiny)
library(jsonlite)
library(curl)
library(shinyWidgets)
# Jasmin's packages...
library(tidyverse)
library(lubridate)
library(leaflet)
library(ggplot2)
library(sf)
library(sp)
library(tmap) # for static and interactive maps
library(stplanr)
libra... |
\name{Termplot}
\alias{Termplot}
\title{
A wrapper for \code{termplot} that optionally (but by default)
exponentiates terms, and plot them on a common log-scale. Also scales
x-axes to the same physical scale.
}
\description{
The function uses \code{\link{termplot}} to extract terms from a model
with, say, spl... | /man/Termplot.Rd | no_license | cran/Epi | R | false | false | 3,358 | rd | \name{Termplot}
\alias{Termplot}
\title{
A wrapper for \code{termplot} that optionally (but by default)
exponentiates terms, and plot them on a common log-scale. Also scales
x-axes to the same physical scale.
}
\description{
The function uses \code{\link{termplot}} to extract terms from a model
with, say, spl... |
\name{plot_net.BipartiteEvol}
\alias{plot_net.BipartiteEvol}
\title{
Plot the output of BipartiteEvol
}
\description{
Plot the genealogies, phylogenies and interaction network simulated with BipartiteEvol
}
\usage{
plot_net.BipartiteEvol(gen, spec, trait.id, link,
out, lwdgen = 1, lwdsp = lwdgen, scale = NULL,
... | /man/plot_net.BipartiteEvol.Rd | no_license | hherhold/PANDA | R | false | false | 3,097 | rd | \name{plot_net.BipartiteEvol}
\alias{plot_net.BipartiteEvol}
\title{
Plot the output of BipartiteEvol
}
\description{
Plot the genealogies, phylogenies and interaction network simulated with BipartiteEvol
}
\usage{
plot_net.BipartiteEvol(gen, spec, trait.id, link,
out, lwdgen = 1, lwdsp = lwdgen, scale = NULL,
... |
## This function creates a special "matrix" object that can cache its inverse
makeCacheMatrix <- function(x = matrix()) {
i <- NULL
set <- function(y) {
x <<- y
i <<- NULL
}
get <- function() x
setinverse <- function(inverse) i <<- inverse
getinverse <- function() i
list(set... | /cachematrix.R | no_license | paba/ProgrammingAssignment2 | R | false | false | 1,022 | r | ## This function creates a special "matrix" object that can cache its inverse
makeCacheMatrix <- function(x = matrix()) {
i <- NULL
set <- function(y) {
x <<- y
i <<- NULL
}
get <- function() x
setinverse <- function(inverse) i <<- inverse
getinverse <- function() i
list(set... |
# question 1
# read data
data <- read.csv("getdata-data-ss06hid.csv")
agricultureLogical <- data$AGS == 6 && data$ACR == 3
which(agricultureLogical)
| /quiz 3/question 1.R | no_license | huangguanyu/cleanning-data | R | false | false | 153 | r | # question 1
# read data
data <- read.csv("getdata-data-ss06hid.csv")
agricultureLogical <- data$AGS == 6 && data$ACR == 3
which(agricultureLogical)
|
######## SCRIPT MODEL SSE Fit Data and Create dataframes #######-
# Author: Erwan Rahis (erwan.rahis@axa.com), GRM Life, Longevity Team
# Version 1.0
# Last update: 12/05/2020
# Script to fit a Sums Of Smooth Exponential model according to the paper "Sum Of Smooth Exponentials to decompose complex series of counts"
#... | /Scripts_/01_Model_Fit_AveragedData.R | no_license | erwanrh/SSE-model-Longevity | R | false | false | 4,579 | r | ######## SCRIPT MODEL SSE Fit Data and Create dataframes #######-
# Author: Erwan Rahis (erwan.rahis@axa.com), GRM Life, Longevity Team
# Version 1.0
# Last update: 12/05/2020
# Script to fit a Sums Of Smooth Exponential model according to the paper "Sum Of Smooth Exponentials to decompose complex series of counts"
#... |
#' scl_ahulls
#'
#' Calculate alpha hulls around clusters via the \pkg{alphahull} package
#'
#' @param tree Spanning tree obtained from \link{scl_redcap}
#' @param xy Matrix of spatial coordinates of points indexed by \code{tree}.
#' @param alpha Parameter used to create alpha hulls
#' @return tibble of (id, x, y), whe... | /R/plot-fns.R | no_license | mpadge/spatialcluster | R | false | false | 6,592 | r | #' scl_ahulls
#'
#' Calculate alpha hulls around clusters via the \pkg{alphahull} package
#'
#' @param tree Spanning tree obtained from \link{scl_redcap}
#' @param xy Matrix of spatial coordinates of points indexed by \code{tree}.
#' @param alpha Parameter used to create alpha hulls
#' @return tibble of (id, x, y), whe... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/apollo_insertScaling.R
\name{apollo_insertScaling}
\alias{apollo_insertScaling}
\title{Scales variables inside a function}
\usage{
apollo_insertScaling(e, sca)
}
\arguments{
\item{e}{Function, expression, call or symbol to alter.}
\item{sca}... | /man/apollo_insertScaling.Rd | no_license | cran/apollo | R | false | true | 742 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/apollo_insertScaling.R
\name{apollo_insertScaling}
\alias{apollo_insertScaling}
\title{Scales variables inside a function}
\usage{
apollo_insertScaling(e, sca)
}
\arguments{
\item{e}{Function, expression, call or symbol to alter.}
\item{sca}... |
#' ExtractMotifFromModel allow the user to extract motifs who are activated by the sequences in our model.
#'
#' @param X An object of class character,list or DNAStringSet/DNAStringSetList with DNA sequences.
#' @param Y a numeric vector of 1 and 0 values (default to NULL).
#' @param lower.case boolean. Set to \code{TR... | /scripts/imports/DeepG4/R/ExtractMotifFromModel.R | no_license | raphaelmourad/DeepG4ToolsComparison | R | false | false | 6,660 | r | #' ExtractMotifFromModel allow the user to extract motifs who are activated by the sequences in our model.
#'
#' @param X An object of class character,list or DNAStringSet/DNAStringSetList with DNA sequences.
#' @param Y a numeric vector of 1 and 0 values (default to NULL).
#' @param lower.case boolean. Set to \code{TR... |
#
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
library(videoplayR)
options(shiny.maxRequestSize=30*1024^2)
# Define UI fo... | /inst/shiny/ui.R | no_license | dtavern/grainsizeR | R | false | false | 2,748 | r | #
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
library(videoplayR)
options(shiny.maxRequestSize=30*1024^2)
# Define UI fo... |
##PROJECT:IoT Analytics Domain Research and Exploratory Data Analysis
##NAME:Francesca Prata
##SCRIPT:Preprocessing - Creating DateTime & Lubridate
##DATE:11-02-2019
##VERSION:2
##Combine Date and Time attribute values in a new attribute column
newDF <-cbind(newDF,
paste(newDF$Date,newDF$Time),
... | /Unused_Scripts/3.Preprocessing_v2.R | no_license | francescaprata/Energy-Consumption | R | false | false | 1,950 | r | ##PROJECT:IoT Analytics Domain Research and Exploratory Data Analysis
##NAME:Francesca Prata
##SCRIPT:Preprocessing - Creating DateTime & Lubridate
##DATE:11-02-2019
##VERSION:2
##Combine Date and Time attribute values in a new attribute column
newDF <-cbind(newDF,
paste(newDF$Date,newDF$Time),
... |
library(tidyverse)
library(lubridate)
library(mice)
library(geosphere)
train_df = read.csv("train_cab/train_cab.csv", header = TRUE)
test_df = read.csv("test/test.csv", header = TRUE)
str(train_df)
str(test_df)
# Exploratory Data Analysis
train_df$fare_amount = as.numeric(train_df$fare_amount)
train_df$passenger_cou... | /.ipynb_checkpoints/Fare_Prediction-checkpoint.R | no_license | gautampaids/CabFarePrediction | R | false | false | 3,163 | r | library(tidyverse)
library(lubridate)
library(mice)
library(geosphere)
train_df = read.csv("train_cab/train_cab.csv", header = TRUE)
test_df = read.csv("test/test.csv", header = TRUE)
str(train_df)
str(test_df)
# Exploratory Data Analysis
train_df$fare_amount = as.numeric(train_df$fare_amount)
train_df$passenger_cou... |
pdf("widths-tests.pdf", compress=FALSE)
library(vwline)
grid.offsetBezier(c(.2, .4, .6, .8), c(.1, .3, .3, .1),
w=c(0, .1, .1, 0))
grid.offsetBezier(c(.2, .4, .6, .8), c(.1, .3, .3, .1) + .3,
w=widthSpline(c(0, .1, .1, 0)))
grid.offsetBezier(c(.2, .4, .6, .8), c(.1, .3, .3, .1) + ... | /pkg/inst/regression-tests/widths.R | no_license | pmur002/vwline | R | false | false | 1,137 | r |
pdf("widths-tests.pdf", compress=FALSE)
library(vwline)
grid.offsetBezier(c(.2, .4, .6, .8), c(.1, .3, .3, .1),
w=c(0, .1, .1, 0))
grid.offsetBezier(c(.2, .4, .6, .8), c(.1, .3, .3, .1) + .3,
w=widthSpline(c(0, .1, .1, 0)))
grid.offsetBezier(c(.2, .4, .6, .8), c(.1, .3, .3, .1) + ... |
nu de mult am auzit pe cineva acuzind guvernul ca nu face nimic pentru a - l ajuta pe Ioan Alexandru . Ioan Alexandru , unul dintre marii poeti ai literaturii romane .
din convingere si dintr - o teribila dorinta de a incepe in Romania o viata democratica , Ioan Alexandru s - a inscris la taranisti .
el este cel care... | /data/Newspapers/2000.06.29.editorial.30211.0376.r | no_license | narcis96/decrypting-alpha | R | false | false | 4,402 | r | nu de mult am auzit pe cineva acuzind guvernul ca nu face nimic pentru a - l ajuta pe Ioan Alexandru . Ioan Alexandru , unul dintre marii poeti ai literaturii romane .
din convingere si dintr - o teribila dorinta de a incepe in Romania o viata democratica , Ioan Alexandru s - a inscris la taranisti .
el este cel care... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RecipeSteps.R
\name{prep.step_dbscan_fpc}
\alias{prep.step_dbscan_fpc}
\title{prep for step_dbscan_fpc}
\usage{
\method{prep}{step_dbscan_fpc}(x, training, info = NULL, ...)
}
\description{
prep for step_dbscan_fpc
}
| /man/prep.step_dbscan_fpc.Rd | permissive | TatsumotoH/addstepr | R | false | true | 295 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RecipeSteps.R
\name{prep.step_dbscan_fpc}
\alias{prep.step_dbscan_fpc}
\title{prep for step_dbscan_fpc}
\usage{
\method{prep}{step_dbscan_fpc}(x, training, info = NULL, ...)
}
\description{
prep for step_dbscan_fpc
}
|
# Libraries ---------------------------------------------------------------
library(tidyverse)
library(ggthemes)
library(glue)
# Helpers -----------------------------------------------------------------
binom_ci <- function(y, n, side) {
ci <- binom.test(x = y, n = n)$conf.int
switch(side,
left = ci[1],
... | /tests/simulations/04_plot-conditional-coverage.R | permissive | adviksh/winference | R | false | false | 2,389 | r | # Libraries ---------------------------------------------------------------
library(tidyverse)
library(ggthemes)
library(glue)
# Helpers -----------------------------------------------------------------
binom_ci <- function(y, n, side) {
ci <- binom.test(x = y, n = n)$conf.int
switch(side,
left = ci[1],
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/date_Input.R
\name{date_Input}
\alias{date_Input}
\title{Date Input Function}
\usage{
date_Input(
inputId,
label,
hint_label = NULL,
error = FALSE,
error_message = NULL,
day = NULL,
month = NULL,
year = NULL
)
}
\arguments{
\i... | /man/date_Input.Rd | no_license | moj-analytical-services/shinyGovstyle | R | false | true | 2,343 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/date_Input.R
\name{date_Input}
\alias{date_Input}
\title{Date Input Function}
\usage{
date_Input(
inputId,
label,
hint_label = NULL,
error = FALSE,
error_message = NULL,
day = NULL,
month = NULL,
year = NULL
)
}
\arguments{
\i... |
library(rtweet)
library(tidytext)
library(tidyverse)
library(gridExtra)
# get tweets with the #allstars4 hashtag
tweets <- search_tweets(
"#AllStars4", n = 18000, include_rts = FALSE
)
# Or read in the data file if you want to reproduce exactly
tweets <- read_csv("#AllStars4 tweets 2019-01-02.csv") %>%
select(... | /#allstars4.R | no_license | emilynordmann/rtweet | R | false | false | 7,060 | r | library(rtweet)
library(tidytext)
library(tidyverse)
library(gridExtra)
# get tweets with the #allstars4 hashtag
tweets <- search_tweets(
"#AllStars4", n = 18000, include_rts = FALSE
)
# Or read in the data file if you want to reproduce exactly
tweets <- read_csv("#AllStars4 tweets 2019-01-02.csv") %>%
select(... |
# Install and load relevant packages
library(ggplot2)
library(plyr)
library(dplyr)
library(tibble)
library(nvmix)
library(readxl)
library(pracma)
library(fit.models)
library(sqldf)
library(writexl)
library(tidyverse) # data manipulation
library(cluster) # clustering algorithms
library(factoextra) # clu... | /Codice/code_thesis_trial1.R | no_license | lollypop96/Master-thesis | R | false | false | 9,134 | r | # Install and load relevant packages
library(ggplot2)
library(plyr)
library(dplyr)
library(tibble)
library(nvmix)
library(readxl)
library(pracma)
library(fit.models)
library(sqldf)
library(writexl)
library(tidyverse) # data manipulation
library(cluster) # clustering algorithms
library(factoextra) # clu... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/many_peaks.R
\docType{data}
\name{many_peaks}
\alias{many_peaks}
\title{Artificial data set with many peaks}
\format{
A data frame with 493 observations on the following 2 variables.
\describe{
\item{t}{a numeric vector}
\item{F}{fluorescence... | /man/many_peaks.Rd | no_license | michbur/dpcR | R | false | true | 575 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/many_peaks.R
\docType{data}
\name{many_peaks}
\alias{many_peaks}
\title{Artificial data set with many peaks}
\format{
A data frame with 493 observations on the following 2 variables.
\describe{
\item{t}{a numeric vector}
\item{F}{fluorescence... |
context("hbm")
test_that("erros correctly with 0 matrix", {
m <- matrix(0,5,5)
expect_error(hbm(m), 'Failed to find any clusters')
})
test_that("works correctly with 1 matrix", {
m <- matrix(1,5,5)
res <- hbm(m)
expect_equal(res$hm, matrix(1,5,5) - diag(1,5,5))
})
test_that("works correctly with -1 matrix"... | /tests/testthat/test-hbm.R | no_license | maxconway/hbm | R | false | false | 2,656 | r | context("hbm")
test_that("erros correctly with 0 matrix", {
m <- matrix(0,5,5)
expect_error(hbm(m), 'Failed to find any clusters')
})
test_that("works correctly with 1 matrix", {
m <- matrix(1,5,5)
res <- hbm(m)
expect_equal(res$hm, matrix(1,5,5) - diag(1,5,5))
})
test_that("works correctly with -1 matrix"... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/paws.swf_operations.R
\name{poll_for_activity_task}
\alias{poll_for_activity_task}
\title{Used by workers to get an ActivityTask from the specified activity taskList}
\usage{
poll_for_activity_task(domain, taskList, identity = NULL)
}
\argume... | /service/paws.swf/man/poll_for_activity_task.Rd | permissive | CR-Mercado/paws | R | false | true | 2,911 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/paws.swf_operations.R
\name{poll_for_activity_task}
\alias{poll_for_activity_task}
\title{Used by workers to get an ActivityTask from the specified activity taskList}
\usage{
poll_for_activity_task(domain, taskList, identity = NULL)
}
\argume... |
exampleData <- EnsBagg::datagenPaper(J=1,n=1000,frac.train = .8,simulation = 1,scenario=1)
exampleData
| /data-raw/exampleData.R | permissive | pablogonzalezginestet/stackBagg | R | false | false | 104 | r |
exampleData <- EnsBagg::datagenPaper(J=1,n=1000,frac.train = .8,simulation = 1,scenario=1)
exampleData
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generateScripts.R
\name{createShellScripts}
\alias{createShellScripts}
\title{Create Shell Scripts}
\usage{
createShellScripts(shell.dir, code.dir, runname, filename)
}
\arguments{
\item{shell.dir}{string containing directory of where shell s... | /memorymigration/man/createShellScripts.Rd | no_license | EliGurarie/memorymigration | R | false | true | 827 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generateScripts.R
\name{createShellScripts}
\alias{createShellScripts}
\title{Create Shell Scripts}
\usage{
createShellScripts(shell.dir, code.dir, runname, filename)
}
\arguments{
\item{shell.dir}{string containing directory of where shell s... |
#!/home/statsadmin/R/bin/Rscript
source('Step_0_init.R')
args <- commandArgs()
idx <- as.numeric(args[length(args)])
.libPaths('ysidi/lib')
dt.full.X <- readRDS(file = sprintf('dtfullwaldxm30_%d.rds',idx))
set.seed(81762+idx+98)
#generate mar6 for 5-25% by 5% DO
dt.mar6 <- miss.apply.do(dt.full.X, b.trt=-2, b.y=0... | /Step3_1_impose_miss/wald/step_3_1_type_waldxm30_missing_mar6_percent_15.R | no_license | yuliasidi/Binomial_PE_Progs | R | false | false | 523 | r | #!/home/statsadmin/R/bin/Rscript
source('Step_0_init.R')
args <- commandArgs()
idx <- as.numeric(args[length(args)])
.libPaths('ysidi/lib')
dt.full.X <- readRDS(file = sprintf('dtfullwaldxm30_%d.rds',idx))
set.seed(81762+idx+98)
#generate mar6 for 5-25% by 5% DO
dt.mar6 <- miss.apply.do(dt.full.X, b.trt=-2, b.y=0... |
rm(list = ls(all = TRUE)) #clear environment
#### get data
DataUrl<-file.path(getwd(),"household_power_consumption.txt")
library(data.table)
#### read data
#define data type in file
#forcing colums to numeric will produce N/A if '?' present
DataClasses<-c('character','character','numeric','numeric','numeric','numer... | /Plot1.R | no_license | DfAC/ExData_Plotting1 | R | false | false | 1,142 | r | rm(list = ls(all = TRUE)) #clear environment
#### get data
DataUrl<-file.path(getwd(),"household_power_consumption.txt")
library(data.table)
#### read data
#define data type in file
#forcing colums to numeric will produce N/A if '?' present
DataClasses<-c('character','character','numeric','numeric','numeric','numer... |
# Script to process MODIS data for Ireland.
# This version imports preprocessed CORINE data that
# gives the fraction of a MODIS pixels that is pasture
# This version processes all of Ireland, not just the 21 10 km squares
#
# This script performs these tasks
# 1. read in MODIS data (ndvi, evi, quality and day of ac... | /Archive/RemoteSensing/phenograss_process_MODIS_allIreland.R | no_license | DrJonYearsley/Phenograss | R | false | false | 7,117 | r | # Script to process MODIS data for Ireland.
# This version imports preprocessed CORINE data that
# gives the fraction of a MODIS pixels that is pasture
# This version processes all of Ireland, not just the 21 10 km squares
#
# This script performs these tasks
# 1. read in MODIS data (ndvi, evi, quality and day of ac... |
#' Syncs packages across your computers
#'
#' Prerequisites: you must keep your R packages listed
#' in a synced folder, such as Dropbox or SpiderOak Hive.
#' The packages themselves, that is, are in you \code{lib}
#' folder. What you keep in the synced folder is only
#' an \code{.RData} file that lists them by name.
... | /R/syncPacks.r | no_license | KuldeepSJadon/syncR | R | false | false | 4,518 | r | #' Syncs packages across your computers
#'
#' Prerequisites: you must keep your R packages listed
#' in a synced folder, such as Dropbox or SpiderOak Hive.
#' The packages themselves, that is, are in you \code{lib}
#' folder. What you keep in the synced folder is only
#' an \code{.RData} file that lists them by name.
... |
# Assignment 3
outcome <- read.csv("outcome-of-care-measures.csv", colClasses ="character")
head(outcome)
ncol(outcome)
nrow(outcome)
names(outcome)
listOfStates <- unique(outcome$State)
outcome[,11] <- as.numeric(outcome[,11])
outcome[,17] <- as.numeric(outcome[,17])
noNA <- outcome[!is.na(outcome[,11]),]
orderHA <- ... | /Rprogramming/assignment3/part3.R | no_license | carolcoder/datasciencecoursera | R | false | false | 3,256 | r | # Assignment 3
outcome <- read.csv("outcome-of-care-measures.csv", colClasses ="character")
head(outcome)
ncol(outcome)
nrow(outcome)
names(outcome)
listOfStates <- unique(outcome$State)
outcome[,11] <- as.numeric(outcome[,11])
outcome[,17] <- as.numeric(outcome[,17])
noNA <- outcome[!is.na(outcome[,11]),]
orderHA <- ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.