- Thread starter noetsi
- Start date

I am trying to specify a path in the following code to import excell

read_excel("S:\CIU\A2_Routine Reports Library\R\\DataforTS.xls")

and get this which baffles me

Error: '\C' is an unrecognized escape in character string starting ""S:\C"

This links shows what I am trying to do, its at the top https://datatofish.com/import-excel-r/

tried this and got the same error

read_excel("S:\CIU\A2_Routine Reports Library\R\DataforTS.xlsx")

I found the error should be read_excel("S:\\CIU\\A2_Routine Reports Library\\R\\DataforTS.xlsx")

read_excel("S:\CIU\A2_Routine Reports Library\R\\DataforTS.xls")

and get this which baffles me

Error: '\C' is an unrecognized escape in character string starting ""S:\C"

This links shows what I am trying to do, its at the top https://datatofish.com/import-excel-r/

tried this and got the same error

read_excel("S:\CIU\A2_Routine Reports Library\R\DataforTS.xlsx")

I found the error should be read_excel("S:\\CIU\\A2_Routine Reports Library\\R\\DataforTS.xlsx")

Last edited:

library("forecast")

Error: package or namespace load failed for ‘forecast’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[

there is no package called ‘xts’

this is the code when I installed forecast.

package ‘ps’ successfully unpacked and MD5 sums checked

package ‘processx’ successfully unpacked and MD5 sums checked

package ‘callr’ successfully unpacked and MD5 sums checked

package ‘backports’ successfully unpacked and MD5 sums checked

package ‘desc’ successfully unpacked and MD5 sums checked

package ‘rprojroot’ successfully unpacked and MD5 sums checked

package ‘rstudioapi’ successfully unpacked and MD5 sums checked

package ‘evaluate’ successfully unpacked and MD5 sums checked

package ‘pkgload’ successfully unpacked and MD5 sums checked

package ‘praise’ successfully unpacked and MD5 sums checked

package ‘testthat’ successfully unpacked and MD5 sums checked

package ‘farver’ successfully unpacked and MD5 sums checked

package ‘labeling’ successfully unpacked and MD5 sums checked

package ‘munsell’ successfully unpacked and MD5 sums checked

package ‘RColorBrewer’ successfully unpacked and MD5 sums checked

package ‘viridisLite’ successfully unpacked and MD5 sums checked

package ‘gtable’ successfully unpacked and MD5 sums checked

package ‘isoband’ successfully unpacked and MD5 sums checked

package ‘scales’ successfully unpacked and MD5 sums checked

package ‘withr’ successfully unpacked and MD5 sums checked

package ‘quadprog’ successfully unpacked and MD5 sums checked

package ‘colorspace’ successfully unpacked and MD5 sums checked

package ‘fracdiff’ successfully unpacked and MD5 sums checked

package ‘ggplot2’ successfully unpacked and MD5 sums checked

package ‘lmtest’ successfully unpacked and MD5 sums checked

package ‘timeDate’ successfully unpacked and MD5 sums checked

package ‘tseries’ successfully unpacked and MD5 sums checked

package ‘zoo’ successfully unpacked and MD5 sums checked

package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked

package ‘forecast’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in

C:\Users\rthellein\AppData\Local\Temp\RtmpgtO0qV\downloaded_packages

installing the source package ‘pkgbuild’

trying URL 'https://mirror.las.iastate.edu/CRAN/src/contrib/pkgbuild_1.0.8.tar.gz'

Content type 'application/x-gzip' length 29485 bytes (28 KB)

downloaded 28 KB

'\\fldvr.net\hq\users\rthellein\Documents'

CMD.EXE was started with the above path as the current directory.

UNC paths are not supported. Defaulting to Windows directory.

* installing *source* package 'pkgbuild' ...

** package 'pkgbuild' successfully unpacked and MD5 sums checked

** using staged installation

** R

** byte-compile and prepare package for lazy loading

** help

*** installing help indices

converting help for package 'pkgbuild'

finding HTML links ... done

build html

clean_dll html

compile_dll html

compiler_flags html

has_build_tools html

has_compiler html

has_latex html

has_rtools html

needs_compile html

pkg_has_src html

pkg_links_to_rcpp html

pkgbuild_process html

rcmd_build_tools html

Rd warning: C:/Users/rthellein/AppData/Local/Temp/RtmpKi8Jck/R.INSTALL418ce986ebe/pkgbuild/man/rcmd_build_tools.Rd:14: file link 'rcmd_safe_env' in package 'callr' does not exist and so has been treated as a topic

with_debug html

without_compiler html

** building package indices

** testing if installed package can be loaded from temporary location

*** arch - i386

*** arch - x64

** testing if installed package can be loaded from final location

*** arch - i386

*** arch - x64

** testing if installed package keeps a record of temporary installation path

install.packages("package's name", repos=c("http://rstudio.org/_packages", "http://cran.rstudio.com"))

https://stackoverflow.com/questions/16501507/lib-unspecified-error-in-loadnamespace

I paste this in

auto.arima(

"S:\\CIU\\A2_Routine Reports Library\\R\\DataforTS.xlsx",

d = NA,

D = NA,

max.p = 5,

max.q = 5,

max.P = 2,

max.Q = 2,

max.order = 5,

max.d = 2,

max.D = 1,

start.p = 2,

start.q = 2,

start.P = 1,

start.Q = 1,

stationary = FALSE,

seasonal = TRUE,

ic = c("aicc", "aic", "bic"),

stepwise = TRUE,

nmodels = 94,

trace = FALSE,

approximation = (length(x) > 150 | frequency(x) > 12),

method = NULL,

truncate = NULL,

xreg = NULL,

test = c("kpss", "adf", "pp"),

test.args = list(),

seasonal.test = c("seas", "ocsb", "hegy", "ch"),

seasonal.test.args = list(),

allowdrift = TRUE,

allowmean = TRUE,

lambda = NULL,

biasadj = FALSE,

parallel = FALSE,

num.cores = 2,

x = y)

and get Error in as.ts(x) : object 'y' not found

that is the right path, r found it before.

auto.arima("S:\\CIU\\A2_Routine Reports Library\\R\\DataforTS.xlsx")

and got

Error in stats::arima(x = x, order = order, seasonal = seasonal, include.mean = include.mean, :

'x' must be numeric

In addition: Warning message:

In is.constant(x) : NAs introduced by coercion

my data has two fields in it. The first is a month field and the second is a dollar number (it is numeric in excel). Do I have to tell r which field is the number field, not sure how you do this as none of the documentation I have found tells you that