I am trying to create an immutable data-frame in R. Something like
df = iris
df = make_immutable(df)
df = df[1:100,] #gives error because df is now immutable
Is there any such function in R, like make_immutable
, which can restrict an R object from further modifications during the session?
Context:
I have a machine learning pipeline which has a component written by a fellow developer who is modifying a data-frame in-place at multiple places. I want to restrict the modification of this data frame after some point. Any help is highly appreciated.