Skip to content
Prev 366734 / 398502 Next

Subset()

Hi Elise,
If I create a CSV file like your example and read it into a data frame:

eldf<-read.csv("el.csv")

Then convert the first field to POSIXt dates:

eldf$DateTime<-strptime(eldf$DateTime,"%Y-%m-%d %H:%M:%S")
class(eldf$DateTime)
[1] "POSIXlt" "POSIXt"

I can subset the file like this:

time_after<-strptime("2017-01-09 18:00:00","%Y-%m-%d %H:%M:%S")
[1] "2017-01-09 18:00:00 AEDT"
DateTime RECORD PTemp PPFD_Avg Air_Temp_Avg RH_avg Soil_Temp
7  2017-01-09 18:00:00      6 21.26   -48.83       -38.49 -0.415        79
8  2017-01-09 18:15:00      7 21.21   -52.23       -39.00 -0.642        79
9  2017-01-09 18:30:00      8 21.12   -54.68       -39.41 -0.805        79
10 2017-01-09 18:45:00      9 21.04   -56.44       .39.74 -0.939        79
11 2017-01-09 19:00:00     10 20.99   -57.71       -40.01 -1.046        79
12 2017-01-09 19:15:00     11 20.91   -58.66       -40.25 -1.137        79
13 2017-01-09 19:30:00     12 21.83   -59.39       -40.46 -1.208        79

Perhaps this will do what you want.

No need to apologize for your English, I could not make myself
understood in French.

Jim

On Sun, Jan 22, 2017 at 4:15 AM, Elise LIKILIKI
<elise.likiliki at gmail.com> wrote:
Message-ID: <CA+8X3fUKCndpCdWAkEWRK0tRNhUO0RM0hZdmV2im8xJ-WuRvKQ@mail.gmail.com>
In-Reply-To: <CAFjJzakQpiJpFUTcM2YJKqdDCT6LAEE7HX0BqOSPc2RexeuGEQ@mail.gmail.com>