Skip to content

Instantly share code, notes, and snippets.

@alexland
Created October 8, 2012 06:02
Show Gist options
  • Save alexland/3850956 to your computer and use it in GitHub Desktop.
Save alexland/3850956 to your computer and use it in GitHub Desktop.
for programatic update of an R package--avoid having to use complete filename with version appended
pkg_name = paste("~/path/to/package", system('cd /path/to/package; ls adStats*', intern=T), sep="/")
install.packages(pkg_name, repos=NULL, type="source")
@acabangbang
Copy link

updated to be added to .RProfile without resulting in infinite loop

install_command = paste("R --vanilla CMD install ~/'path/to/package'", system("cd ~/'path/to/package'; ls adStats*", intern=T), sep="/")
system(install_command, intern=T)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment