我有一个R代码,可以进行两个函数的卷积...
convolveSlow <- function(x, y) {
nx <- length(x); ny <- length(y)
xy <- numeric(nx + ny - 1)
for(i in seq(length = nx)) {
xi <- x[[i]]
for(j in seq(length = ny)) {
ij <- i+j-1
xy[[ij]] <- xy[[ij]] + xi * y[[j]]
}
}
xy
}
Run Code Online (Sandbox Code Playgroud)
有没有办法删除两个for循环并使代码运行得更快?
谢谢你
我的包需要ggplot2包,但是我无法修复运行R CMD检查时得到的以下注释.
no visible global function definition for qplot
'library' or 'require' call not declared from: ggplot2
Run Code Online (Sandbox Code Playgroud)
我也有一个.onLoad函数,
.onLoad <- function(libname, pkgname){
.libPaths("~/RLibrary")
require(ggplot2)
}
Run Code Online (Sandbox Code Playgroud)
有关如何解决错误的任何建议?我应该在哪里放置onLoad功能?
谢谢
圣
我在数据子目录下有.RDa格式的数据文件.但是,该R CMD check命令无法识别该load("test.RDa")命令及其在此阶段失败并发出以下错误:
Warning in readChar(con, 5L, useBytes = TRUE) :
cannot open compressed file 'test.RDa', probable reason 'No such file or directory'
Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
Calls: load -> readChar
Execution halted
Run Code Online (Sandbox Code Playgroud)
你能告诉我原因吗?我应该指定一个路径来指定从哪里加载?
我有一个FASTQ质量得分,它是一系列ASCII字符.在这种情况下(可能)ASCII字符64到126表示0到62的分数(假设它是Illumina).这产生了潜在的序列:
feffefdfbefdfffcfdeTddaYddffbfcI``S_KKX _]] MR [D_TY [VTVXQ]`Q_BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
如何提取哪个是ASCII字符的数量?
谢谢你
编辑:该序列表示由碱基构成的生物序列的质量(来自核酸中的碱基对,意指字符(ATGC)).基本质量是phred-scaled基本错误概率,等于-10 log10 Pr {base is wrong}.
如何将PHP多维数组转换为Python字典格式的字符串?
var_dump($myarray);
array(2) { ["a1"]=> array(2) { ["29b"]=> string(0) "" ["29a"]=> string(0) "" } ["a2"]=> array(2) { ["29b"]=> string(0) "" ["29a"]=> string(0) "" } }
Run Code Online (Sandbox Code Playgroud)