I defined a function called "parseJson".
My function takes 3 parameters i.e. df, id and json.
parseJson <- function(df,id,json) {...}
When calling my function, I specify the 3 parameters
dfFinal <- parseJson(df=dfChoices,id="id",json="choices_temp")
which crashes, resulting in this error showing up here :
> dfFinal <- parseJson(df=dfChoices,id="id",json="choices_temp")
Error in (function(x, i, exact) if (is.matrix(i)) as.matrix(x)[[i]] else .subset2(x, :
object 'json' not found
Called from: (function(x, i, exact) if (is.matrix(i)) as.matrix(x)[[i]] else .subset2(x,
i, exact = exact))(x, ..., exact = exact)
Though, if I re-assign the values of the 3 parameters of my function before calling the function, there is no problem :
df=dfChoices
id="id"
json="choices_temp"
dfFinal <- parseJson(df=dfChoices,id="id",json="choices_temp")
I dont have any error, the dataframe dfFinal is produced and is correct.
Any one can help me understand that ?
Thanks