Graphics error: Plot rendering error Error in gzfile(file, "wb") :cannot open the connection

Does your Windows account name contain multibyte, or non-ASCII, characters? Unfortunately, there is an issue with RStudio on Windows where attempts to plot can fail in that case.