Skip to content

Commit

Permalink
Update 07_workshop.R
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyfraser authored Oct 10, 2024
1 parent 83087f5 commit cc32691
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion code/07_workshop.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,28 @@ crosstab2(x = hours, binsize = 100,



# I went on to update this and have provided a helper function under
# functions/function_crosstab.R
# Try it out!
source("functions/functions_crosstab.R")


# Product Times to Failure
hours = c(1,2,2,3,4,5,7,8,9,10,
11,13,15,16,17,17,18,18,18,20,
20,21,21,24,27,29,30,37,40,40,
40,41,46,47,48,52,54,54, 55,55,
64,65,65,65,67,76,76,79,80,80,
82,86,87,89,94,96,100,101,102,104,
105,109,109,120,123,141,150,156,156,161,
164,167,170,178,181,191,193,206,211,212,
214,236,238,240,265,304,317,328,355,363,
365,369,389,404,427,435,500,522,547,889)


# By default, it applies no cutoff.
crosstab(x = hours, binsize = 100)
# But if you add a cutoff, it will aggregate categories past that cutoff
crosstab(x = hours, binsize = 100, cutoff = 450)



Expand Down

0 comments on commit cc32691

Please sign in to comment.