Use check() and get error about `*-Ex.R`

I am learning to build a package and get error when I I run check()

E  checking examples (625ms)
   
   See
     ‘/private/var/folders/yt/307v0c_945z1rh043jsdx1lh0000gn/T/RtmpvZl8ug/add2md.Rcheck/00check.log’
   for details.
   
   Running examples in ‘add2md-Ex.R’ failed

But I cannot find it from the spotlight on Mac.

> check()
Updating add2md documentation
Warning: @examples [/Users/vija/Downloads/180805_folder_01/tmp_jli/trans/projIN/add2md/R/m2.R#17]: mismatched braces or quotes
Writing NAMESPACE
Loading add2md
It is recommended to use ‘given’ instead of ‘middle’.
Writing NAMESPACE
─ Building ──────────────────────────────────────────────── add2md ─
Setting env vars:
● CFLAGS    : -Wall -pedantic -fdiagnostics-color=always
● CXXFLAGS  : -Wall -pedantic -fdiagnostics-color=always
● CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always
───────────────────────────────────────────────────────────
✔  checking for file ‘/Users/vija/Downloads/180805_folder_01/tmp_jli/trans/projIN/add2md/DESCRIPTION’ (388ms)
─  preparing ‘add2md’: (1.7s)
   It is recommended to use ‘given’ instead of ‘middle’.
✔  checking DESCRIPTION meta-information ...
   It is recommended to use ‘given’ instead of ‘middle’.
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
   Removed empty directory ‘add2md/packrat/lib-ext/x86_64-apple-darwin15.6.0/3.5.1’
   Removed empty directory ‘add2md/packrat/lib-ext/x86_64-apple-darwin15.6.0’
   Removed empty directory ‘add2md/packrat/lib-ext’
─  building ‘add2md_0.1.1.tar.gz’
   Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9L,  :
     storing paths of more than 100 bytes is not portable:
     ‘add2md/packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth/po/en@quot/LC_MESSAGES/R-KernSmooth.mo’
   
─ Checking ──────────────────────────────────────────────── add2md ─
Setting env vars:
● _R_CHECK_CRAN_INCOMING_REMOTE_: FALSE
● _R_CHECK_CRAN_INCOMING_       : FALSE
● _R_CHECK_FORCE_SUGGESTS_      : FALSE
── R CMD check ──────────────────────────────────────────────────────────────────────────────────────────────────────
─  using log directory ‘/private/var/folders/yt/307v0c_945z1rh043jsdx1lh0000gn/T/RtmpvZl8ug/add2md.Rcheck’
─  using R version 3.5.1 (2018-07-02)
─  using platform: x86_64-apple-darwin15.6.0 (64-bit)
─  using session charset: UTF-8
─  using options ‘--no-manual --as-cran’ (2.7s)
✔  checking for file ‘add2md/DESCRIPTION’
─  checking extension type ... Package
─  this is package ‘add2md’ version ‘0.1.1’
─  package encoding: UTF-8
✔  checking package namespace information
✔  checking package dependencies (1.3s)
N  checking if this is a source package ...
   Found the following apparent object files/libraries:
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth/libs/KernSmooth.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/MASS/libs/MASS.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/Matrix/libs/Matrix.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/class/libs/class.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/cluster/libs/cluster.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/foreign/libs/foreign.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/grDevices/libs/cairo.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/grDevices/libs/grDevices.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/graphics/libs/graphics.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/grid/libs/grid.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/lattice/libs/lattice.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/methods/libs/methods.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/mgcv/libs/mgcv.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nlme/libs/nlme.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nnet/libs/nnet.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/parallel/libs/parallel.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/rpart/libs/rpart.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/spatial/libs/spatial.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/splines/libs/splines.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/stats/libs/stats.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/survival/libs/survival.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/tcltk/libs/tcltk.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/tools/libs/tools.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/utils/libs/utils.so
   Object files/libraries should not be included in a source package.
   
   Subdirectory ‘packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth’ seems to contain an installed version of the package.
✔  checking if there is a namespace
✔  checking for executable files (7.5s)
✔  checking for hidden files and directories ...
N  checking for portable file names ...
   Found the following non-portable file path:
     add2md/packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth/po/en@quot/LC_MESSAGES/R-KernSmooth.mo
   
   Tarballs are only required to store paths of up to 100 bytes and cannot
   store those of more than 256 bytes, with restrictions including to 100
   bytes for the final component.
   See section ‘Package structure’ in the ‘Writing R Extensions’ manual.
✔  checking for sufficient/correct file permissions ...
✔  checking serialization versions ...
✔  checking whether package ‘add2md’ can be installed (1.2s)
✔  checking installed package size ...
✔  checking package directory ...
─  checking DESCRIPTION meta-information ...It is recommended to use ‘given’ instead of ‘middle’.
    OK
N  checking top-level files
   Non-standard files/directories found at top level:
     ‘README.html’ ‘docs’ ‘packrat’
✔  checking for left-over files ...
✔  checking index information
N  checking package subdirectories ...
   Found the following CITATION files in a non-standard place:
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/MASS/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/base/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/boot/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/class/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/cluster/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/lattice/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/mgcv/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nlme/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nnet/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/spatial/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/survival/CITATION
   Most likely ‘inst/CITATION’ should be used instead.
✔  checking R files for non-ASCII characters ...
✔  checking R files for syntax errors ...
✔  checking whether the package can be loaded (434ms)
✔  checking whether the package can be loaded with stated dependencies ...
✔  checking whether the package can be unloaded cleanly (335ms)
✔  checking whether the namespace can be loaded with stated dependencies ...
✔  checking whether the namespace can be unloaded cleanly ...
✔  checking dependencies in R code ...
✔  checking S3 generic/method consistency (514ms)
✔  checking replacement functions ...
✔  checking foreign function calls ...
N  checking R code for possible problems (2.4s)
   m_detail: no visible binding for global variable ‘.’
   Undefined global functions or variables:
     .
✔  checking Rd files ...
✔  checking Rd metadata ...
N  checking Rd line widths ...
   Rd file 'm2.Rd':
     \usage lines wider than 90 characters:
          m2(url = "https://raw.githubusercontent.com/JiaxiangBU/picbackup/master/add2blog_sample_wallpaper.png",
   
   These lines will be truncated in the PDF manual.
✔  checking Rd cross-references ...
✔  checking for missing documentation entries ...
✔  checking for code/documentation mismatches (720ms)
W  checking Rd \usage sections ...
   Documented arguments not in \usage in documentation object 'm_detail':
     ‘name’
   
   Functions with \usage entries need to have the appropriate \alias
   entries, and all their arguments documented.
   The \usage entries must correspond to syntactically valid R code.
   See chapter ‘Writing R documentation files’ in the ‘Writing R
   Extensions’ manual.
✔  checking Rd contents (635ms)
✔  checking for unstated dependencies in examples ...
E  checking examples (593ms)
   
   See
     ‘/private/var/folders/yt/307v0c_945z1rh043jsdx1lh0000gn/T/RtmpvZl8ug/add2md.Rcheck/00check.log’
   for details.
   
   Running examples in ‘add2md-Ex.R’ failed
   The error most likely occurred in:
   
   > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
   > ### Name: hello
   > ### Title: Hello, World!
   > ### Aliases: hello
   > 
   > ### ** Examples
   > 
   > hello()
   Error in hello() : could not find function "hello"
   Execution halted
── R CMD check results ──────────────────────────────────────────────────────────────────────────── add2md 0.1.1 ────
Duration: 23.9s

❯ checking examples ... ERROR
  Running examples in ‘add2md-Ex.R’ failed
  The error most likely occurred in:
  
  > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
  > ### Name: hello
  > ### Title: Hello, World!
  > ### Aliases: hello
  > 
  > ### ** Examples
  > 
  > hello()
  Error in hello() : could not find function "hello"
  Execution halted

❯ checking Rd \usage sections ... WARNING
  Documented arguments not in \usage in documentation object 'm_detail':
    ‘name’
  
  Functions with \usage entries need to have the appropriate \alias
  entries, and all their arguments documented.
  The \usage entries must correspond to syntactically valid R code.
  See chapter ‘Writing R documentation files’ in the ‘Writing R
  Extensions’ manual.

❯ checking if this is a source package ... NOTE
  Found the following apparent object files/libraries:
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth/libs/KernSmooth.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/MASS/libs/MASS.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/Matrix/libs/Matrix.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/class/libs/class.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/cluster/libs/cluster.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/foreign/libs/foreign.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/grDevices/libs/cairo.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/grDevices/libs/grDevices.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/graphics/libs/graphics.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/grid/libs/grid.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/lattice/libs/lattice.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/methods/libs/methods.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/mgcv/libs/mgcv.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nlme/libs/nlme.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nnet/libs/nnet.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/parallel/libs/parallel.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/rpart/libs/rpart.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/spatial/libs/spatial.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/splines/libs/splines.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/stats/libs/stats.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/survival/libs/survival.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/tcltk/libs/tcltk.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/tools/libs/tools.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/utils/libs/utils.so
  Object files/libraries should not be included in a source package.
  
  Subdirectory ‘packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth’ seems to contain an installed version of the package.

❯ checking for portable file names ... NOTE
  Found the following non-portable file path:
    add2md/packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth/po/en@quot/LC_MESSAGES/R-KernSmooth.mo
  
  Tarballs are only required to store paths of up to 100 bytes and cannot
  store those of more than 256 bytes, with restrictions including to 100
  bytes for the final component.
  See section ‘Package structure’ in the ‘Writing R Extensions’ manual.

❯ checking top-level files ... NOTE
  Non-standard files/directories found at top level:
    ‘README.html’ ‘docs’ ‘packrat’

❯ checking package subdirectories ... NOTE
  Found the following CITATION files in a non-standard place:
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/MASS/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/base/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/boot/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/class/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/cluster/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/lattice/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/mgcv/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nlme/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nnet/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/spatial/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/survival/CITATION
  Most likely ‘inst/CITATION’ should be used instead.

❯ checking R code for possible problems ... NOTE
  m_detail: no visible binding for global variable ‘.’
  Undefined global functions or variables:
    .

❯ checking Rd line widths ... NOTE
  Rd file 'm2.Rd':
    \usage lines wider than 90 characters:
         m2(url = "https://raw.githubusercontent.com/JiaxiangBU/picbackup/master/add2blog_sample_wallpaper.png",
  
  These lines will be truncated in the PDF manual.

1 error ✖ | 1 warning ✖ | 6 notes ✖
> check()
Updating add2md documentation
Warning: @examples [/Users/vija/Downloads/180805_folder_01/tmp_jli/trans/projIN/add2md/R/m2.R#17]: mismatched braces or quotes
Writing NAMESPACE
Loading add2md
It is recommended to use ‘given’ instead of ‘middle’.
Writing NAMESPACE
─ Building ──────────────────────────────────────────────── add2md ─
Setting env vars:
● CFLAGS    : -Wall -pedantic -fdiagnostics-color=always
● CXXFLAGS  : -Wall -pedantic -fdiagnostics-color=always
● CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always
───────────────────────────────────────────────────────────
✔  checking for file ‘/Users/vija/Downloads/180805_folder_01/tmp_jli/trans/projIN/add2md/DESCRIPTION’ ...
─  preparing ‘add2md’: (1.7s)
   It is recommended to use ‘given’ instead of ‘middle’.
✔  checking DESCRIPTION meta-information ...
   It is recommended to use ‘given’ instead of ‘middle’.
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
   Removed empty directory ‘add2md/packrat/lib-ext/x86_64-apple-darwin15.6.0/3.5.1’
   Removed empty directory ‘add2md/packrat/lib-ext/x86_64-apple-darwin15.6.0’
   Removed empty directory ‘add2md/packrat/lib-ext’
─  building ‘add2md_0.1.1.tar.gz’
   Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9L,  :
     storing paths of more than 100 bytes is not portable:
     ‘add2md/packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth/po/en@quot/LC_MESSAGES/R-KernSmooth.mo’
   
─ Checking ──────────────────────────────────────────────── add2md ─
Setting env vars:
● _R_CHECK_CRAN_INCOMING_REMOTE_: FALSE
● _R_CHECK_CRAN_INCOMING_       : FALSE
● _R_CHECK_FORCE_SUGGESTS_      : FALSE
── R CMD check ──────────────────────────────────────────────────────────────────────────────────────────────────────
─  using log directory ‘/private/var/folders/yt/307v0c_945z1rh043jsdx1lh0000gn/T/RtmpvZl8ug/add2md.Rcheck’
─  using R version 3.5.1 (2018-07-02)
─  using platform: x86_64-apple-darwin15.6.0 (64-bit)
─  using session charset: UTF-8
─  using options ‘--no-manual --as-cran’ (2.8s)
✔  checking for file ‘add2md/DESCRIPTION’
─  checking extension type ... Package
─  this is package ‘add2md’ version ‘0.1.1’
─  package encoding: UTF-8
✔  checking package namespace information
✔  checking package dependencies (2.8s)
N  checking if this is a source package ...
   Found the following apparent object files/libraries:
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth/libs/KernSmooth.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/MASS/libs/MASS.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/Matrix/libs/Matrix.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/class/libs/class.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/cluster/libs/cluster.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/foreign/libs/foreign.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/grDevices/libs/cairo.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/grDevices/libs/grDevices.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/graphics/libs/graphics.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/grid/libs/grid.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/lattice/libs/lattice.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/methods/libs/methods.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/mgcv/libs/mgcv.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nlme/libs/nlme.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nnet/libs/nnet.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/parallel/libs/parallel.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/rpart/libs/rpart.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/spatial/libs/spatial.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/splines/libs/splines.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/stats/libs/stats.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/survival/libs/survival.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/tcltk/libs/tcltk.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/tools/libs/tools.so
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/utils/libs/utils.so
   Object files/libraries should not be included in a source package.
   
   Subdirectory ‘packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth’ seems to contain an installed version of the package.
✔  checking if there is a namespace
✔  checking for executable files (7.7s)
✔  checking for hidden files and directories ...
N  checking for portable file names ...
   Found the following non-portable file path:
     add2md/packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth/po/en@quot/LC_MESSAGES/R-KernSmooth.mo
   
   Tarballs are only required to store paths of up to 100 bytes and cannot
   store those of more than 256 bytes, with restrictions including to 100
   bytes for the final component.
   See section ‘Package structure’ in the ‘Writing R Extensions’ manual.
✔  checking for sufficient/correct file permissions ...
✔  checking serialization versions ...
✔  checking whether package ‘add2md’ can be installed (1s)
✔  checking installed package size
✔  checking package directory ...
─  checking DESCRIPTION meta-information ...It is recommended to use ‘given’ instead of ‘middle’.
    OK
N  checking top-level files ...
   Non-standard files/directories found at top level:
     ‘README.html’ ‘docs’ ‘packrat’
✔  checking for left-over files ...
✔  checking index information
N  checking package subdirectories ...
   Found the following CITATION files in a non-standard place:
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/MASS/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/base/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/boot/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/class/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/cluster/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/lattice/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/mgcv/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nlme/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nnet/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/spatial/CITATION
     packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/survival/CITATION
   Most likely ‘inst/CITATION’ should be used instead.
✔  checking R files for non-ASCII characters ...
✔  checking R files for syntax errors ...
✔  checking whether the package can be loaded ...
✔  checking whether the package can be loaded with stated dependencies ...
✔  checking whether the package can be unloaded cleanly ...
✔  checking whether the namespace can be loaded with stated dependencies ...
✔  checking whether the namespace can be unloaded cleanly ...
✔  checking dependencies in R code ...
✔  checking S3 generic/method consistency (548ms)
✔  checking replacement functions ...
✔  checking foreign function calls ...
N  checking R code for possible problems (2.1s)
   m_detail: no visible binding for global variable ‘.’
   Undefined global functions or variables:
     .
✔  checking Rd files ...
✔  checking Rd metadata ...
N  checking Rd line widths ...
   Rd file 'm2.Rd':
     \usage lines wider than 90 characters:
          m2(url = "https://raw.githubusercontent.com/JiaxiangBU/picbackup/master/add2blog_sample_wallpaper.png",
   
   These lines will be truncated in the PDF manual.
✔  checking Rd cross-references ...
✔  checking for missing documentation entries ...
W  checking for code/documentation mismatches ...
   Functions or methods with usage in documentation object 'hello' but not in code:
     hello
   
W  checking Rd \usage sections (559ms)
   Documented arguments not in \usage in documentation object 'm_detail':
     ‘name’
   
   Functions with \usage entries need to have the appropriate \alias
   entries, and all their arguments documented.
   The \usage entries must correspond to syntactically valid R code.
   See chapter ‘Writing R documentation files’ in the ‘Writing R
   Extensions’ manual.
✔  checking Rd contents (610ms)
✔  checking for unstated dependencies in examples ...
E  checking examples (625ms)
   
   See
     ‘/private/var/folders/yt/307v0c_945z1rh043jsdx1lh0000gn/T/RtmpvZl8ug/add2md.Rcheck/00check.log’
   for details.
   
   Running examples in ‘add2md-Ex.R’ failed
   The error most likely occurred in:
   
   > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
   > ### Name: hello
   > ### Title: Hello, World!
   > ### Aliases: hello
   > 
   > ### ** Examples
   > 
   > hello()
   Error in hello() : could not find function "hello"
   Execution halted
── R CMD check results ──────────────────────────────────────────────────────────────────────────── add2md 0.1.1 ────
Duration: 24.5s

❯ checking examples ... ERROR
  Running examples in ‘add2md-Ex.R’ failed
  The error most likely occurred in:
  
  > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
  > ### Name: hello
  > ### Title: Hello, World!
  > ### Aliases: hello
  > 
  > ### ** Examples
  > 
  > hello()
  Error in hello() : could not find function "hello"
  Execution halted

❯ checking for code/documentation mismatches ... WARNING
  Functions or methods with usage in documentation object 'hello' but not in code:
    hello

❯ checking Rd \usage sections ... WARNING
  Documented arguments not in \usage in documentation object 'm_detail':
    ‘name’
  
  Functions with \usage entries need to have the appropriate \alias
  entries, and all their arguments documented.
  The \usage entries must correspond to syntactically valid R code.
  See chapter ‘Writing R documentation files’ in the ‘Writing R
  Extensions’ manual.

❯ checking if this is a source package ... NOTE
  Found the following apparent object files/libraries:
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth/libs/KernSmooth.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/MASS/libs/MASS.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/Matrix/libs/Matrix.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/class/libs/class.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/cluster/libs/cluster.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/foreign/libs/foreign.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/grDevices/libs/cairo.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/grDevices/libs/grDevices.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/graphics/libs/graphics.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/grid/libs/grid.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/lattice/libs/lattice.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/methods/libs/methods.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/mgcv/libs/mgcv.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nlme/libs/nlme.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nnet/libs/nnet.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/parallel/libs/parallel.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/rpart/libs/rpart.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/spatial/libs/spatial.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/splines/libs/splines.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/stats/libs/stats.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/survival/libs/survival.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/tcltk/libs/tcltk.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/tools/libs/tools.so
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/utils/libs/utils.so
  Object files/libraries should not be included in a source package.
  
  Subdirectory ‘packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth’ seems to contain an installed version of the package.

❯ checking for portable file names ... NOTE
  Found the following non-portable file path:
    add2md/packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/KernSmooth/po/en@quot/LC_MESSAGES/R-KernSmooth.mo
  
  Tarballs are only required to store paths of up to 100 bytes and cannot
  store those of more than 256 bytes, with restrictions including to 100
  bytes for the final component.
  See section ‘Package structure’ in the ‘Writing R Extensions’ manual.

❯ checking top-level files ... NOTE
  Non-standard files/directories found at top level:
    ‘README.html’ ‘docs’ ‘packrat’

❯ checking package subdirectories ... NOTE
  Found the following CITATION files in a non-standard place:
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/MASS/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/base/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/boot/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/class/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/cluster/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/lattice/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/mgcv/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nlme/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/nnet/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/spatial/CITATION
    packrat/lib-R/x86_64-apple-darwin15.6.0/3.5.1/survival/CITATION
  Most likely ‘inst/CITATION’ should be used instead.

❯ checking R code for possible problems ... NOTE
  m_detail: no visible binding for global variable ‘.’
  Undefined global functions or variables:
    .

❯ checking Rd line widths ... NOTE
  Rd file 'm2.Rd':
    \usage lines wider than 90 characters:
         m2(url = "https://raw.githubusercontent.com/JiaxiangBU/picbackup/master/add2blog_sample_wallpaper.png",
  
  These lines will be truncated in the PDF manual.

1 error ✖ | 2 warnings ✖ | 6 notes ✖

And here is my session info.

"si"
#> [1] "si"

Created on 2018-11-15 by the reprex package (v0.2.1)

Session info
devtools::session_info()
#> ─ Session info ──────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.5.1 (2018-07-02)
#>  os       macOS  10.14                
#>  system   x86_64, darwin15.6.0        
#>  ui       X11                         
#>  language (EN)                        
#>  collate  zh_CN.UTF-8                 
#>  ctype    zh_CN.UTF-8                 
#>  tz       Asia/Shanghai               
#>  date     2018-11-15                  
#> 
#> ─ Packages ──────────────────────────────────────────────────────────────
#>  package     * version date       lib source        
#>  assertthat    0.2.0   2017-04-11 [1] CRAN (R 3.5.0)
#>  backports     1.1.2   2017-12-13 [1] CRAN (R 3.5.0)
#>  base64enc     0.1-3   2015-07-28 [1] CRAN (R 3.5.0)
#>  callr         3.0.0   2018-08-24 [1] CRAN (R 3.5.0)
#>  cli           1.0.1   2018-09-25 [1] CRAN (R 3.5.0)
#>  crayon        1.3.4   2017-09-16 [1] CRAN (R 3.5.0)
#>  desc          1.2.0   2018-05-01 [1] CRAN (R 3.5.0)
#>  devtools      2.0.1   2018-10-26 [1] CRAN (R 3.5.1)
#>  digest        0.6.18  2018-10-10 [1] CRAN (R 3.5.0)
#>  evaluate      0.12    2018-10-09 [1] CRAN (R 3.5.0)
#>  fs            1.2.6   2018-08-23 [1] CRAN (R 3.5.0)
#>  glue          1.3.0   2018-07-17 [1] CRAN (R 3.5.0)
#>  htmltools     0.3.6   2017-04-28 [1] CRAN (R 3.5.0)
#>  knitr         1.20    2018-02-20 [1] CRAN (R 3.5.0)
#>  magrittr      1.5     2014-11-22 [1] CRAN (R 3.5.0)
#>  memoise       1.1.0   2017-04-21 [1] CRAN (R 3.5.0)
#>  pkgbuild      1.0.2   2018-10-16 [1] CRAN (R 3.5.0)
#>  pkgload       1.0.2   2018-10-29 [1] CRAN (R 3.5.0)
#>  prettyunits   1.0.2   2015-07-13 [1] CRAN (R 3.5.0)
#>  processx      3.2.0   2018-08-16 [1] CRAN (R 3.5.0)
#>  ps            1.2.1   2018-11-06 [1] CRAN (R 3.5.0)
#>  R6            2.3.0   2018-10-04 [1] CRAN (R 3.5.0)
#>  Rcpp          1.0.0   2018-11-07 [1] CRAN (R 3.5.0)
#>  remotes       2.0.2   2018-10-30 [1] CRAN (R 3.5.0)
#>  rlang         0.3.0.1 2018-10-25 [1] CRAN (R 3.5.0)
#>  rmarkdown     1.10    2018-06-11 [1] CRAN (R 3.5.0)
#>  rprojroot     1.3-2   2018-01-03 [1] CRAN (R 3.5.0)
#>  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.5.0)
#>  stringi       1.2.4   2018-07-20 [1] CRAN (R 3.5.0)
#>  stringr       1.3.1   2018-05-10 [1] CRAN (R 3.5.0)
#>  testthat      2.0.0   2017-12-13 [1] CRAN (R 3.5.0)
#>  usethis       1.4.0   2018-08-14 [1] CRAN (R 3.5.0)
#>  withr         2.1.2   2018-03-15 [1] CRAN (R 3.5.0)
#>  yaml          2.2.0   2018-07-25 [1] CRAN (R 3.5.0)
#> 
#> [1] /Library/Frameworks/R.framework/Versions/3.5/Resources/library

It seems there is a function not found in your example file add2md-Ex.R Can you check that example? It needs to be able to run without error.

Hi @cderv, I cannot find this file.

57

And The hello.R file is under the folder R I can see.

You only have access to your package. Try to run you examples in clean session to see if everything goes well. There is a devtools helper function for that.
We can't help you more from afar.