You can use the by()
function:
by(dataFrame, seq_len(nrow(dataFrame)), function(row) dostuff)
But iterating over the rows directly like this is rarely what you want to; you should try to vectorize instead. Can I ask what the actual work in the loop is doing?
More Related Contents:
- Compare two data.frames to find the rows in data.frame 1 that are not present in data.frame 2
- Repeat rows of a data.frame [duplicate]
- How to append rows to an R data frame
- Removing specific rows from a dataframe
- Deleting every n-th row in a dataframe
- Drop unused factor levels in a subsetted data frame
- Why is it not advisable to use attach() in R, and what should I use instead?
- Subset data frame based on multiple conditions [duplicate]
- R – Concatenate two dataframes?
- Remove columns with zero values from a dataframe
- How to convert dataframe into time series?
- Identifying duplicate columns in a dataframe
- Replace all occurrences of a string in a data frame
- Convert Named Character Vector to data.frame
- How to add a cumulative column to an R dataframe using dplyr?
- Add extra level to factors in dataframe
- Dataframe create new column based on other columns
- What is about the first column in R’s dataset mtcars?
- Determine the data types of a data frame’s columns
- finding close match from data frame 1 in data fame 2
- Combine several data frames in the global environment by row (rbind)
- Changing Million/Billion abbreviations into actual numbers? ie. 5.12M -> 5,120,000 [duplicate]
- Extract text after “/” in a data frame column
- use multiple columns as variables with sapply
- Deleting specific rows from a data frame
- Reshape a dataframe to long format with multiple sets of measure columns [duplicate]
- Count number of non-NA values for every column in a dataframe [duplicate]
- How can I merge more than 2 dataframes in R by rownames?
- Shifting a column down by one
- Identifying where value changes in R data.frame column