Open MinhasMA opened 6 years ago
What is the error you get?
Was able to figure it out. Thanks!
However, there is another issue
Quitting from lines 58-69 (MarketSegmentationProcessInClassParts1and2.Rmd) Error in file(filename, "r", encoding = encoding) : cannot open the connection
rmarkdown::render("MarketSegmentationProcessInClassParts1and2.Rmd")
processing file: MarketSegmentationProcessInClassParts1and2.Rmd |. | 2% ordinary text without R code
|.. | 4% label: setuplibraries (with options) List of 2 $ echo : logi FALSE $ message: logi FALSE
Quitting from lines 58-69 (MarketSegmentationProcessInClassParts1and2.Rmd) Error in file(filename, "r", encoding = encoding) : cannot open the connection
What are the lines 58 - 69 in your RMD file?
suppressWarnings(source("../../AnalyticsLibraries/library.R"))
# Package options
suppressWarnings(ggthemr('fresh')) # ggplot theme
opts_knit$set(progress=FALSE, verbose=FALSE)
opts_chunk$set(echo=FALSE, fig.align="center", fig.width=10, fig.height=6.35, results="asis")
options(knitr.kable.NA = '')
# Run below only once, then comment out
# New versions of the networkD3 package may not work properly, so install the following version
packageurl <- "https://cran.r-project.org/src/contrib/Archive/networkD3/networkD3_0.2.13.tar.gz"
install.packages(packageurl, repos=NULL, type="source")
I have the correct directory as set by setwd() But it appears that some information was lost in translation?
"../../AnalyticsLibraries/library.R"
is a relative path. This basically says, go up two levels from the working directorry and look for a folder called "AnalyticsLibraries" at that location. Does that process make sense in your context?
If not, subsitute the ../../AnalyticsLibraries/library.R with the absolute path. For example: In my case: Users/Varun/Docs/InseadAnalysticsGit/AnalyticLibraries/Library.R
Tried it but it did not work. I looked at the folder and the analyticslibraries folder is not present in my home folder (setwd)
Could I comment out the whole section? 58-69?
No. Don't comment it out. The RMD needs that piece for knitting.
Do you have the Library.R script on your disk somewhere? What is the path to that file?
Yes, file is available on my computer.
I've made the following address change (locating it to the right folder)
Still get an error
suppressWarnings(source("C:\Users\manna\Documents\COURSES\Data Science for Business\INSEADAnalytics-master\INSEADAnalytics-master\CourseSessions\Session1 /AnalyticsLibraries/library.R"))
Can you try this instead? I just replaced with appropriate slashes. C:/Users/manna/Documents/COURSES/Data Science for Business/INSEADAnalytics-master/INSEADAnalytics-master/CourseSessions/Session1/AnalyticsLibraries/library.R
Tried and it still fails :(
Quitting from lines 58-71 (MarketSegmentationProcessInClassParts1and2.Rmd) Error in file(filename, "r", encoding = encoding) : cannot open the connection
Lines 58-71
suppressWarnings(source("C:/Users/manna/Documents/COURSES/Data Science for Business/INSEADAnalytics-master/INSEADAnalytics-master/CourseSessions/Session1/AnalyticsLibraries/library.R"))
# Package options
suppressWarnings(ggthemr('fresh')) # ggplot theme
opts_knit$set(progress=FALSE, verbose=FALSE)
opts_chunk$set(echo=FALSE, fig.align="center", fig.width=10, fig.height=6.35, results="asis")
options(knitr.kable.NA = '')
# Run below only once, then comment out
# New versions of the networkD3 package may not work properly, so install the following version
packageurl <- "https://cran.r-project.org/src/contrib/Archive/networkD3/networkD3_0.2.13.tar.gz"
install.packages(packageurl, repos=NULL, type="source")
Are you sure your path is correct? You should be routing to the library.R
inside AnalyticsLibraries
. There isn't an AnalyticsLibraries
folder inside Session1 typically.
"C:/Users/manna/Documents/COURSES/Data Science for Business/INSEADAnalytics-master/INSEADAnalytics-master/AnalyticsLibraries/library.R"
"C:/Users/manna/Documents/COURSES/Data Science for Business/INSEADAnalytics-master/AnalyticsLibraries/library.R"
I think your correct path should be one of the above two.
Thanks a lot. It works!
Can someone comment on the setwd() command in R? Seemingly have followed the correct syntax, but keep on getting an error setwd("Addresstoworkingdirectory")