Вы можете преобразовать свои строки с помощью as.POSIXct
для сравнения даты и времени.
subset(df1,
Date >= as.POSIXct("2018-03-05 09:00:00") & Date <= as.POSIXct("2018-03-05 14:15:00"))
Результат:
Date Price
1 2018-03-05 09:00:00 125.9
2 2018-03-05 09:00:00 125.9
3 2018-03-05 09:00:00 125.9
4 2018-03-05 10:00:01 125.9
5 2018-03-05 10:00:30 125.9
6 2018-03-05 11:03:00 125.9
7 2018-03-05 12:00:01 125.9
9 2018-03-05 14:15:00 125.9
Из документации здесь:
PDO::PARAM_BOOL (integer) Represents a boolean data type. PDO::PARAM_NULL (integer) Represents the SQL NULL data type. PDO::PARAM_INT (integer) Represents the SQL INTEGER data type. PDO::PARAM_STR (integer) Represents the SQL CHAR, VARCHAR, or other string data type. PDO::PARAM_LOB (integer) Represents the SQL large object data type. PDO::PARAM_STMT (integer) Represents a recordset type. Not currently supported by any drivers. PDO::PARAM_INPUT_OUTPUT (integer) Specifies that the parameter is an INOUT parameter for a stored procedure. You must bitwise-OR this value with an explicit PDO::PARAM_* data type.