I have problem with ggplot2 in new version to R

I don't think that warning message is the cause of your problem, It seems you are running out of RAM memory. Try to clear some of your system memory and try again.

About the warning message, you can compile ggplot2 for your specific R version by installing it from source. You could also upgrade to R 4.2 and reinstall ggplot2 from the latest binary.