Hi,
I have a dataset of a training program where we want to know when school teachers have started using a particular pedagogic method. There are three blocks- circle time, language and numeracy. The response is a categorical variable (1 or 0). But the challenge I am facing is that the variable "teacherid" has duplicates. I want to get a bar chart in such a way that the X-axis has the "week_no_p" variable. But this variable "week_no_p" has to be mutated depending on the "day_no_block". So if the it is day 1 to 5, then week 1, day 6 to 10, then week 2 and so on.
The Y-axis will show the number of teachers taking the class (i.e, if response is 1 it means the teacher is participating). So basically the Bar chart has to show the number of number of teachers adopting the teaching practices. To sum up, there are 2 issues here:
- Create the "week_no_p" variable depending on the "day number" variable.
- Get a bar chart of number of teachers participating week-wise.
library(tidyverse)
library(janitor)
#>
#> Attaching package: 'janitor'
#> The following objects are masked from 'package:stats':
#>
#> chisq.test, fisher.test
data<-tibble::tribble(
~starttime, ~mastertraid, ~en_name, ~schoolid, ~teacherid, ~day_no_block, ~week_no_p, ~circle_time, ~language, ~numeracy,
"2022-09-25 20:19:14 UTC", "Nagma", "Sushmita Bankapur", "SCH303-KPS SCHOOL BIDNAL-29090201101", "Premalata karibhimagol", 14L, "week 3", 1L, 0L, 1L,
"2022-09-25 20:24:21 UTC", "Nagma", "Sushmita Bankapur", "SCH303-KPS SCHOOL BIDNAL-29090201101", "Premalata karibhimagol", 15L, "week 3", 0L, 0L, 0L,
"2022-09-25 20:37:20 UTC", "Nagma", "Sushmita Bankapur", "SCH303-KPS SCHOOL BIDNAL-29090201101", "Shashikala Kulkarni", 14L, "week 3", 1L, 1L, 0L,
"2022-09-25 20:44:15 UTC", "Nagma", "Sushmita Bankapur", "SCH303-KPS SCHOOL BIDNAL-29090201101", "Shashikala Kulkarni", 15L, "week 3", 0L, 0L, 0L,
"2022-09-26 20:18:21 UTC", "Nagma", "Shruthi Annigeri", "SCH076-GHPS MALLIGWAD-29090606102", "Hanamvva Talawar", 1L, "week 1", 1L, 0L, 0L,
"2022-09-26 20:40:30 UTC", "Madhumathi", "Pushpalatha Chinagudi", "SCH004-GLPS S.M.KRISHNA NAGAR HUBLI-29090606704", "Jayashree S Shiraguppi", 1L, "week 1", 0L, 0L, 1L,
"2022-09-27 13:58:07 UTC", "Nagma", "Shruthi Annigeri", "SCH076-GHPS MALLIGWAD-29090606102", "Hanamvva Talawar", 2L, "week 1", 0L, 1L, 0L,
"2022-09-27 14:07:37 UTC", "Nagma", "Shruthi Annigeri", "SCH076-GHPS MALLIGWAD-29090606102", "Hanamvva Talawar", 3L, "week 1", 1L, 0L, 0L,
"2022-09-27 14:12:42 UTC", "Nagma", "Shruthi Annigeri", "SCH076-GHPS MALLIGWAD-29090606102", "Hanamvva Talawar", 4L, "week 1", 1L, 0L, 1L,
"2022-09-27 14:17:00 UTC", "Nagma", "Shruthi Annigeri", "SCH076-GHPS MALLIGWAD-29090606102", "Hanamvva Talawar", 5L, "week 1", 0L, 1L, 0L
)
Created on 2022-10-14 by the reprex package (v2.0.1)