error for installing packages

I have a problem with installing packages. Plz help me TT

> install.packages("ggplot2")
also installing the dependencies ‘backports’, ‘ellipsis’, ‘zeallot’, ‘glue’, ‘magrittr’, ‘stringi’, ‘colorspace’, ‘assertthat’, ‘utf8’, ‘vctrs’, ‘plyr’, ‘Rcpp’, ‘stringr’, ‘labeling’, ‘munsell’, ‘R6’, ‘RColorBrewer’, ‘cli’, ‘crayon’, ‘fansi’, ‘pillar’, ‘pkgconfig’, ‘digest’, ‘gtable’, ‘lazyeval’, ‘reshape2’, ‘rlang’, ‘scales’, ‘tibble’, ‘viridisLite’, ‘withr’

Warning in install.packages :
  cannot create dir 'C:\Users\Á¤Áö¿î\AppData\Local\Temp\RtmpqObIQ7\downloaded_packages', reason 'No such file or directory'
Error in install.packages : unable to create temporary directory ‘C:\Users\Á¤Áö¿î\AppData\Local\Temp\RtmpqObIQ7\downloaded_packages’

install.packages() has problems with non ASCII characters in your path, try installing on a different package library, like for example

# Change accordingly to your R version
install.packages("ggplot2", lib ="C:/Program Files/R/R-3.6.1/library" )

Or change your windows username to something safer

it still makes error... TT

install.packages("ggplot2", lib ="C:/Program Files/R/R-3.6.1/library" )
Warning in install.packages :
'lib = "C:/Program Files/R/R-3.6.1/library"' is not writable
Warning in install.packages :
cannot create dir 'C:\Users???', reason 'Invalid argument'
Error in install.packages : unable to create ‘C:/Users/???/Documents/R/win-library/3.6’

You have to run Rstudio as administrator to install in that path, also make sure the path is correct, it is different for different R versions

how can i check the path is correct?

The path in my example is for R 3.6.1, I don't know what R version you are using, so It could be different for you (each R version gets installed on its own folder).

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