I had a R functions with name like "Apple", Banana", etc.., I would like to call this functions from a variable (declared in a web UI) called "fruit" in which I will pass those function name. So whatever function name, I provided, that corresponding function had to be executed. When I'm trying to execute the variable as function like Fruit <- Fruits(x,t,y) Then its is giving error "Fruit" function doesn't exist. I too know it doesn't exist. Point is, I would like to call the function who's name is inside the "Fruit" variable. moreover, When I check the "class" of fruit, it say it is "character", it's right, but fortunately, there is a function name, in this variable. Please help me how to resolve this.
Asked
Active
Viewed 61 times
0
-
2You need to make your question understandable by using a good formatting.Take a look at https://stackoverflow.com/editing-help – Elementary Sep 02 '18 at 12:17
-
4You may need `get`. Here is a example: `Fruit <- 'mean'; get(Fruit)(1:10) # 5.5` – mt1022 Sep 02 '18 at 12:18
-
2Or `match.fun`. – Axeman Sep 02 '18 at 12:40
-
Axeman, can u please spare 5 min with me thru webex, i still unable to make it done. plzzzzz – MSK Sep 02 '18 at 14:06
-
I tried Axeman, But thought there is a function, it is saying that the function doesn't exist. If possible, plz connect thru webex – MSK Sep 02 '18 at 14:40
-
I'm trying to trigger the model thru variable using "get" by setting the working directory to current folder, I able to trigger the model with its name, ,but when tried thru get, its stating error, object '
.r' not found, Please help me – MSK Sep 07 '18 at 20:56