What package to install

Dason

Ambassador to the humans
#41
I have no idea. Because you are posting snippets that you think matter but aren't posting the whole thing. Post all relevant information. Scratch that. Start a new session and try to do what want and then post the entire session.
 

noetsi

Fortran must die
#42
I got the reinstalled (4.0) to work. Apparently. But I need now to import excel files to analyze. What is the simplest way to do this? For someone who obviously struggles with R. :p
 

noetsi

Fortran must die
#43
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")
 
Last edited:

Dason

Ambassador to the humans
#44
Either change all of your \ to be / instead or change them to be \\. Alternatively if you updated to 4.0 I think there is a way to specify a raw string to avoid this nonsense but haven't updated yet myself so can't check directly.
 

noetsi

Fortran must die
#45
I got it to work, but now I want to use the file in auto.arima() which is in the forecast package I have loaded. I am not sure how you do that.
 

noetsi

Fortran must die
#46
I am puzzled. I installed forecast and saw no errors. but when I do library("forecast") I get

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
 

noetsi

Fortran must die
#48
I found out the problem. There are requirements that were not installed when I installed forecast that it needs. I thought R always pulled in all needed dependencies.
 

noetsi

Fortran must die
#49
ok this is the link I found to the auto.arima function https://www.rdocumentation.org/packages/forecast/versions/8.12/topics/auto.arima

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.
 

noetsi

Fortran must die
#50
I tried making it simple and did
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
 

noetsi

Fortran must die
#52
I don't know how to import it into an object. My comments in previous post reflects my efforts to do so. Say you do

Library(forecast)

what do you do to import the file into forecast