I have the function 

```
function1 <- function(df1, df2, int1, int2, char1)
{
...
return(newDataFrame)
}

```

which has 5 inputs: the first 2 are data frames, then I have two integers and a string. 
The function returns a new data frame. 

So far I am running this function 8 times sequentially: 

```
newDataFrame1 <- function1(df1, df2, 1, 1, "someString")
newDataFrame2 <- function1(df1, df2, 2, 0, "someString")
newDataFrame3 <- function1(df1, df2, 3, 0, "someString")
newDataFrame4 <- function1(df1, df2, 4, 0, "someString")
newDataFrame5 <- function1(df1, df2, 5, 0, "someString")
newDataFrame6 <- function1(df1, df2, 6, 0, "someString")
newDataFrame7 <- function1(df1, df2, 7, 0, "someString")
newDataFrame8 <- function1(df1, df2, 8, 0, "someString")

```

and at the end I am combining results using rbind():

```
newDataFrameTot <-  rbind(newDataFrame1, newDataFrame2, newDataFrame3, newDataFrame4, newDataFrame5, newDataFrame6, newDataFrame7, newDataFrame8)

```

I wanted to run this in parallel using library(parallel) but I'm not able to figure out how to make this work. I am trying: 

```
cluster <- makeCluster(detectCores())
result <- clusterApply(cluster,1:8,function1)
newDataFrameTot <- do.call(rbind,result)

```

but this don't work unless my function function1() has only one parameter that I loop from 1 to 8. But this is not my case since I need to pass 5 inputs. 
How can I make this work in parallel?