Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
75d4745
Merge pull request #1 from USFWS/mc-dev
mccrea-cobb Sep 6, 2024
ccb6cba
Merge pull request #2 from USFWS/mc-dev
mccrea-cobb Oct 8, 2024
d55c0e1
Merge pull request #3 from USFWS/mc-dev
mccrea-cobb Oct 8, 2024
555f495
New script containing function for introducing errors into dataframe …
JonahWithers-USFWS Oct 9, 2024
632b2a7
Updated jonah's slides and added images
JonahWithers-USFWS Oct 16, 2024
55b342b
draft middle slides without formatting
eschillerstrom-usfws Oct 16, 2024
c821827
Updated file structure, r project, and git slides and added images
JonahWithers-USFWS Oct 17, 2024
b428158
Merge pull request #5 from USFWS/mc-dev
mccrea-cobb Oct 28, 2024
55e0f97
section 2 draft 2
eschillerstrom-usfws Oct 28, 2024
6de88fc
Section 2 draft 3
eschillerstrom-usfws Oct 29, 2024
86cddf3
Section 2 draft 3 changes before file name update
eschillerstrom-usfws Oct 29, 2024
4b79fb1
Added images and notes
JonahWithers-USFWS Oct 29, 2024
ded48b3
Merge pull request #6 from USFWS/Jonah_Dev
JonahWithers-USFWS Oct 29, 2024
8b5b938
Section 2 draft 4
eschillerstrom-usfws Oct 29, 2024
4dc8651
Merge pull request #7 from USFWS/main
JonahWithers-USFWS Oct 29, 2024
62967f3
Reordered slides
eschillerstrom-usfws Oct 30, 2024
e440f07
Final changes to section 2. Added notes.
eschillerstrom-usfws Oct 31, 2024
d83d671
Added embed pdf Quarto extension.
eschillerstrom-usfws Oct 31, 2024
8d75cc3
Section 2 images and pdf.
eschillerstrom-usfws Oct 31, 2024
f4bc326
Renamed section 2 qmd file.
eschillerstrom-usfws Oct 31, 2024
444c947
Added lua file for highlighting lines in code output.
eschillerstrom-usfws Oct 31, 2024
24086ad
Section 2 data inputs and outputs.
eschillerstrom-usfws Oct 31, 2024
c60ad86
Updated file paths.
eschillerstrom-usfws Oct 31, 2024
e7a4a70
Merge pull request #8 from USFWS/mc-dev
mccrea-cobb Oct 31, 2024
093e3f8
Section 2 css class additions.
eschillerstrom-usfws Oct 31, 2024
08b4582
Merge branch 'main' into emma-dev
eschillerstrom-usfws Oct 31, 2024
5926700
Updated style class for table to avoid conflicts
eschillerstrom-usfws Oct 31, 2024
589d152
Merge pull request #9 from USFWS/emma-dev
eschillerstrom-usfws Oct 31, 2024
ef282a5
Updated images and script
JonahWithers-USFWS Oct 31, 2024
d92803d
Updated images and code
JonahWithers-USFWS Oct 31, 2024
924d0b8
Merge branch 'main' into Jonah_Dev
JonahWithers-USFWS Oct 31, 2024
59bb54a
Merge pull request #10 from USFWS/Jonah_Dev
JonahWithers-USFWS Oct 31, 2024
95cef60
Merge pull request #11 from USFWS/mc-dev
mccrea-cobb Oct 31, 2024
abb748a
Added alt text and labels to photos. Renamed photo.
eschillerstrom-usfws Nov 1, 2024
9df45c2
Removed section 2 qmd YAML and R setup
eschillerstrom-usfws Nov 1, 2024
09611a9
Remove files to resolve merge request
eschillerstrom-usfws Nov 1, 2024
46af2c6
Merge pull request #12 from USFWS/emma-dev
eschillerstrom-usfws Nov 1, 2024
05ff1e6
Recommit changes in main
eschillerstrom-usfws Nov 1, 2024
ffe9b51
Merge pull request #13 from USFWS/emma-dev
eschillerstrom-usfws Nov 1, 2024
89ccbdb
Recreated deleted photos
eschillerstrom-usfws Nov 1, 2024
658805c
Merge pull request #14 from USFWS/emma-dev
eschillerstrom-usfws Nov 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions docs/R/intro_errors.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Create function that introduces errors into dataframe with numeric columns
intro_errors <- function(df,
neg_count = 5,
neg_min = -100,
non_numeric_count = 5,
non_numeric_value = "none",
large_count = 2,
large_mutliplier = 10) {



# introduce negative values
for (i in 1:neg_count) {
row <- sample(1:nrow(df), 1)
col <- sample(1:ncol(df), 1)
if (is.numeric(df[[col]])) {
df[row, col] <- runif(1, min = neg_min, max = 0) # Random negative value
}
}



# introduce non-numeric values
for (j in 1:non_numeric_count) {
row <- sample(1:nrow(df), 1)
col <- sample(1:ncol(df), 1)
if (is.integer(df[[col]])) {
df[row, col] <- non_numeric_value # Setting a string value
}

return(df)
}


# introduce large numbers
for (k in 1:large_count) {
row <- sample(1:nrow(df), 1)
col <- sample(1:ncol(df), 1)
if (is.numeric(df[[col]])) {
df[row, col] <- max(col) * large_mutliplier # Setting value to maximum value of column times multiplier
}

return(df)
}
}
Loading