Data manipulation in R I have a long data frame having 96 consecutive observation belonging to same variable.
I have to two such variables. One variable is Energy denoted by "param2(kWh)" and another is demand denoted by "param2(kW)". So data frame is like--- 

first row has variables described as "Interval" and "param2(kWh)" and then 96 observations belonging to Energy variable, followed by 98th row having variables described a "Interval" and "param2(kW)" and then 96 observations belonging to Demand variable. 

Again after that there is row described as "Interval" and "param2(kWh)" and then 96 observations belonging to Energy variable. After that again there is row describing variables "Interval" and "param2(kW)" and 96 observations belonging to Demand variable and such intertwining of these two variables i.e. Energy and Demand continues for long.

The objective is to have two separate data frames one for Energy i.e. "param2(kWh)" and one for Demand i.e. "param2(kW)". 
How these two data frames be formed from the above single data frame?

I am attaching the internet site of the data frame.

https://1drv.ms/f/s!Apm2LEjQkhz3aNBBoUygHPMz2_E
Here is one way to generate two data frames based on the data.

# read data
dat &lt;- read.csv("sample csv1.csv", stringsAsFactors = FALSE, header = FALSE)

# find rows containing "Interval"
idx_int &lt;- dat[[1]] == "Interval"

# calculate groups
group &lt;- cumsum(idx_int) %% 2

# remove indices for "Interval" rows
group2 &lt;- group[!idx_int]

# split data frame into two data frames
dat_list &lt;- split(dat[!idx_int, ], group2)

# generate two separate data frames
dat_energy &lt;- dat_list[[2]]  # Energy
dat_demand &lt;- dat_list[[1]]  # Demand