Displaying 1 result from an estimated 1 matches for "tp4504199p4506155".
2012 Mar 25
2
Simple question regarding domain restrictions/piecewise functions in R
I am a novice R user.
I would like to be able to graph some simple piecewise functions/functions
with domain restrictions in R, but I'm having trouble defining such
functions. For example, I would like to define the following function:
f(x)={x^2 if -1<x<x; 1 if 2<x<3}
Notably, the function is undefined outside of domain (-1,1)U(2,3). My best
attempt in R is something like