-2

I am completely a beginner to R and just completed the beginner course that is provided by my university. There is a dataset of road crashes in the UK with longitude and latitude. It would be really helpful if someone could explain to me what to do, but not share code to solve the task in the title.

Sevgi
  • 1
  • 2
    Hi Sevgi, welcome to Stack Overflow. This site focuses on *specific* **programming** questions. It is not a homework tutoring site. To increase the likelihood of an answer, I recommend providing starting data, the code you have tried thus far, and note specifically what isn't working or that you don't understand. See [How to make a reproducible example](https://stackoverflow.com/questions/5963269/) for more info. – Ian Campbell May 19 '20 at 16:22

1 Answers1

1

It seems like you want to subset your data based on the location. What does it mean that a car crash happened within that zone? That means that the crash's x coordinate is between x1 and x2 and it's y coordinate is between y1 and y2. So you need to look at those rows of your data which satisfy these conditions.

NiklasvMoers
  • 309
  • 2
  • 13
  • Thank you for your help. I also don't get the task fully. I wanted to ask here, since the only code that I could come up with is this: cases <-crashes18[c(1:5),] – Sevgi May 20 '20 at 08:05
  • Could you solve the task with my hints? If not, it would help if you provided some code. Also, the function `c()` concatenates elements (or other vectors) to a vector. `1:5` is already a vector so the `c()` around it is redundant. – NiklasvMoers May 20 '20 at 08:16