data.table keep disappearing in RStudio

I have a windows 10 system. First when I installed the data.table packages, R studio can't find it. I performed the instruction of putting Rtool on path, which was indicated in the instruction: RTools: Toolchains for building R and R packages from source on Windows, it worked for a few days.
I ran a script today but in the middle of it, it crashed, once it restarted, all of my saved stuff is gone. Again.
I reinstalled data.table package, performed all previous procedures again, but it still gives me the following message:
Error in data.table(V1 = num_Vec, V2 = Log_Vec, V3 = Chr_Vec) :
could not find function "data.table"
Even though it seemed like installation was successful.

Does anyone know why Rstudio can't seem to find the package? Why does data.table keep disappearing? How can I fix this? Thank you!

You only need to install it once.

You have to load a package for each session, e.g. in this case library(data.table).

This applies for all packages, not just this example.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.