• Register
0 votes
231 views

Problem :

My R code is giving me following error
promise already under evaluation: recursive default argument reference or earlier problems?
6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

Formal arguments of the form x=x are causing this issue. So eliminating them we get the updated and working code as follows:

f <- function(x, T) {
   10 * sin(0.3 * x) * sin(1.3 * x^2) + 0.001 * x^3 + 0.2 * x + 80 
}

g <- function(x, T, f. = f) {## 1.just note f.
   exp(-f.(x)/T) 
}

test<- function(g. = g, T = 1) {## 2.just note g.
   g.(1,T) 
}

9 7 4
38,600 points

Related questions

0 votes
1 answer 19 views
19 views
Problem: Can someone PLEASE help me figure out why I can't create a legend in R? I have been trying for DAYS. Googling and watching videos. And I KNOW this code works for other people, but not for me. I am using a CSV file. Cannot use TXT file, it won't import correctly. (I have a Mac OS) It keeps ... 45 5.5 1 M2E 42 5.25 2 M2W 25 1.5 2 M3E 20 2.25 2 M3W 43 8.75 2 M4E 35 1.25 1 M4W 30 0.5 1
asked Apr 26 Moumita Bhowmick 12.9k points
0 votes
1 answer 38 views
38 views
Problem: i don&rsquo;t understand about this problem please help? error in aperm.default(map, c(2, 1, 3)) : invalid first argument, must be an array
asked Apr 1 Rohit kr 17.5k points
0 votes
1 answer 98 views
98 views
Problem: error in sort(y) : argument "y" is missing, with no default.
asked Feb 16 charles mathews 5.5k points
0 votes
1 answer 80 views
1 vote
1 answer 1.7K views
1.7K views
Problem : Currently I am learning the r programming. I am unable to find the answer to below error but I am unable to do so. Currently I have one dataframe it has a column of strings. My task is to count the exact number of characters present in each entry of ... , with no default Error in match.fun(FUN): argument "FUN" is missing, with no default Can someone guide me in fixing above error?
asked Mar 30, 2020 morrisBson 3.2k points
0 votes
1 answer 2 views
2 views
Problem: What is wrong here? >Error in bind_rows_(x, .id) : argument 1 must have names
asked 2 days ago Chi Omega 13.7k points
0 votes
1 answer 3 views
3 views
Problem: I am unable to find a solution for this > The first argument to input must be a character vector.
asked 2 days ago Junia Phoebe 15.3k points
0 votes
1 answer 3 views
3 views
Problem: How do I solve this issue? >Invalid mutex directory in argument file:${apache_lock_dir}.
asked 5 days ago Ashok Dileep 5.3k points
0 votes
1 answer 5 views
5 views
Problem: I am trying to perform a logit regression on a dummy variable. The variable y was a chr and I have converted it in numbers with the following code. myData$y <- as.numeric(as.character(myData$y)) myData$x19 <- as.numeric(as.character(myData$x19)) The result is ... (link="logit")) Error in weights * y : non-numeric argument to binary operator Can you please help me fix this? Thank you
asked May 4 anika11 32.2k points
0 votes
1 answer 47 views
47 views
Problem: How to fix this error:confusionMatrix - Error in !all.equal(nrow(data), ncol(data)) : invalid argument type?
asked May 3 sumaiya simi 43.9k points