0

I hope this has not been answered, but when I search for a solution to my problem I am not getting any results.

I have a data.frame of 2000+ observations and 20+ columns. Each row represents a different observation and each column represents a different facet of data for that observation. My objective is to iterate through the data.frames and select observations which match criteria (eg. I am trying to pick out observations that are in certain states). After this, I need to subtract or add time to convert it to its appropriate time zone (all of the times are in CST). What I have so far is an exorbitant amount of subsetting commands that pick out the rows that are of the state being checked against. When I try to write a for loop I can only get one value returned, not the whole row.

I was wondering if anyone had any suggestions or knew of any functions that could help me. I've tried just about everything, but I really don't want to have to go through each state of observations and modify the time. I would prefer a loop that could easily go through the data, select rows based on their state, subtract or add time, and then place the row back into its original data.frame (replacing the old value).

I appreciate any help.

Xaldwyn
  • 7
  • 4
  • 1
    Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610). This will make it much easier for others to help you. – Jaap Jul 22 '16 at 17:07
  • 1
    Please give us an example input and a desired output from the same. Generally, go for `dplyr`, `reshape`, `reshape2`, `tidyr`, `data.table` and few more similar packages for data manipulations. – Sowmya S. Manian Jul 22 '16 at 17:09

0 Answers0