An object in the global environment is not found when used in a code chunk

I am getting a message "Error: object 'all_trips_V2' not found" even though it is defined in the global environement. Hiw can I reference this object in my code without incurring a error?

when you knit a markdown document you are doing so in a seperate environment (i.e. not global), therefore you would need to take steps in your markdown document to export required data into the local environment created when initiating the knit.
Apologies if I misunderstood your scenario, i'm reading between the lines.