Below's a sample of my dataset, where I have GPS positions (`Latitude` and `Longitude`) and the date and time they were registered:

```
> head(datanet)
   Date & Time [Local]  Latitude Longitude
1:    18/06/2018 03:01 -2.434901  34.85359
2:    18/06/2018 03:06 -2.434598  34.85387
3:    18/06/2018 03:08 -2.434726  34.85382
4:    18/06/2018 03:12 -2.434816  34.85371
5:    18/06/2018 03:16 -2.434613  34.85372
6:    18/06/2018 03:20 -2.434511  34.85376

```

I would like to create a column `split` which will look at each row and will show `Night` if the time in the first column is in the interval [18h00:06h00] and `Day` if the time in the first column is [06h00:18h00]. Here how I've been approaching this although bear in mind I'm a beginner:

```
> datanet[, DateTime := dmy_hm(`Date & Time [Local]`)]
> head(datanet)
   Date & Time [Local]  Latitude Longitude            DateTime
1:    18/06/2018 03:01 -2.434901  34.85359 2018-06-18 03:01:00
2:    18/06/2018 03:06 -2.434598  34.85387 2018-06-18 03:06:00
3:    18/06/2018 03:08 -2.434726  34.85382 2018-06-18 03:08:00
4:    18/06/2018 03:12 -2.434816  34.85371 2018-06-18 03:12:00
5:    18/06/2018 03:16 -2.434613  34.85372 2018-06-18 03:16:00
6:    18/06/2018 03:20 -2.434511  34.85376 2018-06-18 03:20:00
> datanet$split<-if_else((hour(DateTime) >= 6) &
+                          (hour(DateTime) < 18), "Day", "Night")
Error in hour(DateTime) : object 'DateTime' not found

```

Am I on the right track and how can I fix this error?

Any input is appreciated