• Register
0 votes
98 views

Problem :

My R code is giving me following error
promise already under evaluation: recursive default argument reference or earlier problems?
6.9k points

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) 
}

36.1k points

Related questions

1 vote
1 answer 237 views
237 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 morrisBson 3.2k points
1 vote
2 answers 97 views
97 views
Problem : I am very new to R. I am facing a issue while entering CurrentDay. I had previously created it as below : Transaction <- function(PnL, Day)   results <- list(a = PnL, b = Day)  return(results) The above PnL and Day are both numeric values. Day ... /MA  return(MAValue) } Please guide me why am I receiving below error? Error in fun(left, right) : non-numeric argument to binary operator.
asked Apr 14 morrisBson 3.2k points
0 votes
2 answers 515 views
515 views
Problem : I am looking for the function with the parameters such as data name as (mydata), factor as (myfactor) and variable names such as (myvar) to dynamically generate the histograms as I have to use them in lattice. I tried to do as mentioned above but error appears ... of type 'character'. I think the program doesn't know where to look for this myf` string. How should I fix this issue?
asked Dec 23, 2019 alecxe 7.5k points
0 votes
1 answer 256 views
256 views
Problem : I want to use the neural net for predictions. I am trying to create some X as follows : x <- cbind(seq(1, 50, 1), seq(51, 100, 1)) I am trying to create some Y as follows : y <- x[,1]*x[,2] Give them the names as follows colnames(x) ... =0.01) error in terms.formula(formula) : '.' in formula and no 'data' argument Does anybody have any idea regarding the error I am facing? Any solution?
asked Dec 11, 2019 alecxe 7.5k points
0 votes
1 answer 19 views
19 views
Problem: I have descent knowledge in R and plot. I have gained this knowledge by attending the online tutorials. Now I have the very simple and only single data file test.txt which contains the data as shown below for your reference: 1  5  7  9  11 Now I am ... : invalid plotting method. Can some expert point out what I am doing wrong here or try to suggest the better solution for above error?
asked Jul 27 Raphael Pacheco 2.7k points