关于在R环境中安装devtools包出现错误的技术咨询
Hey there, let's sort out that devtools installation issue you ran into! Based on your error log, here's what's going on and how to fix it:
First, let's break down the problem:
- The devtools package downloaded successfully but ended up "incomplete" — this almost always happens if the download got interrupted mid-way, leaving a corrupted zip file that couldn't unpack fully.
- There's an updated source version of the
withrdependency available (2.1.2 vs the 2.1.1 binary), which might be causing a version mismatch that's blocking the full installation.
Step 1: Clean up the broken devtools files
First, we need to get rid of the corrupted installation:
remove.packages("devtools")
Then, head to your R library folder C:/Users/hyunj/OneDrive/문서/R/win-library/3.4 — if there's still a folder named devtools hanging around, delete it manually to clear any leftover junk.
Step 2: Install the updated withr package
Since the newer source version of withr doesn't require compilation, install it directly from source:
install.packages("withr", type = "source")
Step 3: Reinstall devtools properly
Now install devtools again, making sure we pull in all necessary dependencies to avoid missing components:
install.packages("devtools", dependencies = TRUE)
If you still hit snags, try restarting your R session first before running these commands — sometimes lingering background processes can mess with package installations.
内容的提问来源于stack exchange,提问作者Daniel

