I installed an R library (https://github.com/behavioral-ds/evently) using devtools::install_github()
This library (evently
) is installed in Library/Frameworks/R.framework/Resources/library
. On the other hand, I have the same directory (evently) in my local folder: Docs/proj
(because I cloned the github URL in this local folder).
I have to run the following lines (to build retweet cascades):
library(evently)
filepath <- system.file('extdata', 'tweets_anonymized.jsonl', package = 'evently')
cascades <- parse_raw_tweets_to_cascades(filepath, progress = F)
The parse_raw_tweets_to_cascades
function is in the tweet.R
file. When I edit the tweet.R
file and run the above lines of code, it runs the original "evently" library, and not the one I am editing (in Docs/proj)
I tried the following:
library("evently",lib.loc="~/Docs/proj/evently")
but I get the error: "there is no package called ‘evently’". How can I run the R file from the local directory?
Update/Answer
The answer provided by Konrad Rudolph worked for me. I just used devtools::load_all()
instead of library(packagename
).