This visual trace shows how R functions grep and grepl work. Given a vector of words and a pattern, each element is checked for the pattern. grep collects the positions of matching elements, while grepl returns TRUE or FALSE for each element depending on whether it matches. The execution table walks through each element, showing the pattern check, actions taken by grep and grepl, and the outputs. Variables track the growing list of indices and logical flags. Key moments clarify why grep returns numbers and grepl returns logical values, and what happens if no matches occur. The quiz tests understanding of variable values at specific steps and how changing the pattern affects results. This helps beginners see step-by-step how these functions behave.