为什么我不能使用爆发器包?

  • 本文关键字:爆发 不能 r
  • 更新时间 :
  • 英文 :


我在使用outbreaker r包时遇到了太多问题。。。我已经安装和卸载了好几次。。。

现在我有这个错误:

install.packages("outbreaker")
library(outbreaker)
data(fakeOutbreak)
attach(fakeOutbreak)

这就是错误:

The following object is masked _by_ .GlobalEnv:
res

如果我试图删除包,我会得到这个:

> remove.packages("outbreaker")
Removing package from ‘C:/Users/vale/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found

如果我尝试工作,我会得到这个:

> data(fakeOutbreak)
> attach(fakeOutbreak)
The following object is masked _by_ .GlobalEnv:
res
> mu <- get.mu(res, genome.size=ncol(dat$dna))
Error in get.mu(res, genome.size = ncol(dat$dna)) : 
burnin too high - no chain left
> hist(mu, col="grey",
+      main="Inferred distribution of mu",
+      xlab="mutations/site/day")
Error in hist(mu, col = "grey", main = "Inferred distribution of mu",  : 
object 'mu' not found
> abline(v=1e-4,lty=2, lwd=4, col="royalblue")
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : 
plot.new has not been called yet
> mtext(side=3, "Dashed line = actual value")
Error in mtext(side = 3, "Dashed line = actual value") : 
plot.new has not been called yet

根据@mischva11的建议,我再次尝试安装yaml,然后重新安装爆发

> install.packages("yaml")
Error in install.packages : Updating loaded packages
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Restarting R session...
Loading required package: copula
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
In addition: Warning message:
package ‘copula’ was built under R version 3.4.4 
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
> install.packages("yaml")
Error in install.packages : Updating loaded packages
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Restarting R session...
Loading required package: copula
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
In addition: Warning message:
package ‘copula’ was built under R version 3.4.4 
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
> install.packages("yaml")
Error in install.packages : Updating loaded packages
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
> install.packages("yaml")
Installing package into ‘C:/Users/vale/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
yaml  2.2.0  2.2.1              TRUE
Do you want to install from sources the package which needs compilation?
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
y/n: y
installing the source package ‘yaml’
trying URL 'https://cran.rstudio.com/src/contrib/yaml_2.2.1.tar.gz'
Content type 'application/x-gzip' length 92670 bytes (90 KB)
downloaded 90 KB
* installing *source* package 'yaml' ...
** package 'yaml' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O3 -Wall  -std=gnu99 -mtune=generic -c api.c -o api.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O3 -Wall  -std=gnu99 -mtune=generic -c dumper.c -o dumper.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O3 -Wall  -std=gnu99 -mtune=generic -c emitter.c -o emitter.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O3 -Wall  -std=gnu99 -mtune=generic -c implicit.c -o implicit.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O3 -Wall  -std=gnu99 -mtune=generic -c loader.c -o loader.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O3 -Wall  -std=gnu99 -mtune=generic -c parser.c -o parser.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O3 -Wall  -std=gnu99 -mtune=generic -c r_emit.c -o r_emit.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O3 -Wall  -std=gnu99 -mtune=generic -c r_ext.c -o r_ext.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O3 -Wall  -std=gnu99 -mtune=generic -c r_parse.c -o r_parse.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O3 -Wall  -std=gnu99 -mtune=generic -c reader.c -o reader.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O3 -Wall  -std=gnu99 -mtune=generic -c scanner.c -o scanner.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O3 -Wall  -std=gnu99 -mtune=generic -c writer.c -o writer.o
C:/Rtools/mingw_32/bin/gcc -shared -s -static-libgcc -o yaml.dll tmp.def api.o dumper.o emitter.o implicit.o loader.o parser.o r_emit.o r_ext.o r_parse.o reader.o scanner.o writer.o -LC:/PROGRA~1/R/R-34~1.3/bin/i386 -lR
installing to C:/Users/vale/Documents/R/win-library/3.4/yaml/libs/i386
*** arch - x64
C:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c api.c -o api.o
C:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c dumper.c -o dumper.o
C:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c emitter.c -o emitter.o
C:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c implicit.c -o implicit.o
C:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c loader.c -o loader.o
C:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c parser.c -o parser.o
C:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c r_emit.c -o r_emit.o
C:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c r_ext.c -o r_ext.o
C:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c r_parse.c -o r_parse.o
C:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c reader.c -o reader.o
C:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c scanner.c -o scanner.o
C:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I. -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c writer.c -o writer.o
C:/Rtools/mingw_64/bin/gcc -shared -s -static-libgcc -o yaml.dll tmp.def api.o dumper.o emitter.o implicit.o loader.o parser.o r_emit.o r_ext.o r_parse.o reader.o scanner.o writer.o -LC:/PROGRA~1/R/R-34~1.3/bin/x64 -lR
installing to C:/Users/vale/Documents/R/win-library/3.4/yaml/libs/x64
Warning in file.copy(files, dest, overwrite = TRUE) :
problem copying .yaml.dll to C:UsersvaleDocumentsRwin-library3.4yamllibsx64yaml.dll: Permission denied
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
converting help for package 'yaml'
finding HTML links ... fatto
as.yaml                                 html  
read_yaml                               html  
write_yaml                              html  
yaml.load                               html  
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (yaml)
In R CMD INSTALL
The downloaded source packages are in
‘C:UsersvaleAppDataLocalTempRtmpYHKnKPdownloaded_packages’
> library(yaml)
> install.packages("outbreaker")
Installing package into ‘C:/Users/vale/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/outbreaker_1.1-8.zip'
Content type 'application/zip' length 319541 bytes (312 KB)
downloaded 312 KB
package ‘outbreaker’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘outbreaker’
The downloaded binary packages are in
C:UsersvaleAppDataLocalTempRtmpYHKnKPdownloaded_packages
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
Error in yaml.load(readLines(con), error.label = error.label, ...) : 
object 'C_unserialize_from_yaml' not found
> library(outbreaker)
Error in library(outbreaker) : there is no package called ‘outbreaker’
> library(outbreaker)
Error in library(outbreaker) : there is no package called ‘outbreaker’
> 

我该如何解决?谢谢

试试这个@ArTu,

按照以下方式安装"Outbreaker"软件包,请参阅。

install.packages("outbreaker", dependencies = TRUE)

我认为这肯定能解决你的问题。我试过安装并查看。它运行良好。