10 2021 档案
摘要:1、加减(矩阵加减只能在同维度矩阵之间进行,即行列数相同) a1 <- c(2, 3, 5, 1, 7, 4, 8, 4, 2) a2 <- c(3, 1, 3, 1, 4, 8, 4, 3, 4) m1 <- matrix(a1, nrow = 3, byrow = T) m2 <- matrix
阅读全文
摘要:1、协方差 协方差:两个向量每一项与各自平均数只差 的对应项乘积之和的平均数。 方差:每一项与平均数只差 的平方的平均数。 标准差: 方差开平方 皮尔逊相关系数:两个向量的协方差 除以 两个向量的标准差的乘积。 a <- c(1, 3, 7, 8) b <- c(12, 15, 16, 18) su
阅读全文
摘要:1、R脚本 dir() dat <- read.table("outcome.ped") dat id <- dat[,2] dat <- dat[, -(1:6)] result <- data.frame() for (i in 1:nrow(dat)) { count = 0 for (j i
阅读全文
摘要:1、shell脚本 [root@centos79 test]# cat test.sh #!/bin/bash ## step1 for i in $(seq `sed -n "$=" $1`); do sed -n "$i"p $1 | cut -d " " -f 7- | grep -o "0"
阅读全文
摘要:1、plink脚本 plink --file outcome --pca 3 header tabs --sheep --out pcatest > /dev/null; rm *.log *.nosex 2、R绘图 dir() dat <- read.table("pcatest.eigenvec
阅读全文
摘要:1、R实现 dir() dat <- read.table("outcome.ped") dim(dat) dat <- dat[,-(1:6)] loci <- data.frame(v1 = rep(1, 2 * nrow(dat))) for (i in 1:(ncol(dat)/2)) {
阅读全文
摘要:1、脚本 [root@centos79 test]# cat test.sh #!/bin/bash #step1 check ped file uniqn=$(sed 's/\r//g' $1 | cut -d " " -f 7- | sed 's/ /\n/g' | sort -u | wc -
阅读全文
摘要:1、脚本只有10行,报第11行错误?? [root@centos79 test]# bash test.sh test.sh: line 11: syntax error: unexpected end of file [root@centos79 test]# cat -n test.sh 1 #
阅读全文
摘要:1、点R添加至环境变量中 2、点关于 3、点高级系统设置 4、点环境变量 5、点path 6、点编辑 7、点新建 8、输入R安装的bin目录(根据个人安装的目录) 9、确定一直点 10、win + r ,输入cmd,进入dos 11、测试Rscript命令, 没有问题 12、进入工作目录 13、测试
阅读全文
摘要:1、删除指定类型的文件 dir() allfile = dir() ## 目录下的所有文件 allfile txtfile <- grep("*.txt", allfile) ## 查找txt文件,返回索引 txtfile file.remove(allfile[txtfile]) ## 删除txt
阅读全文
摘要:1、启动Rstudio 2、点击tools 3、点击global options 4、点击browse 5、选择将要设定的路径,点击open 6、然后点击应用 7、重启rstudio,查看
阅读全文
摘要:1、 dir() dat <- read.table("outcome.ped") dat <- dat[,-(1:6)] loci <- data.frame() loci[1:(nrow(dat) * 2), 1] <- 1 for (i in 1:(ncol(dat)/2)) { loci <
阅读全文
摘要:1、 [root@centos79 test]# cat test.sh #!/bin/bash #step1 check consistence of columns temp1=`head -n 1 $1 | awk '{print NF}'` for i in $(seq `sed -n "$
阅读全文
摘要:1、 a <- c(1, 3, 4, 7, 9) sum_a = 0 for (i in 1:length(a)) { sum_a = sum_a + a[i] } mean_a = sum_a / length(a) va = 0 for (i in 1:length(a)) { va = va
阅读全文
摘要:1、rbind, 按行合并数据框 a <- 1:3 b <- 5:7 c <- 9:11 d <- data.frame(a, b, c) d e <- 11:13 f <- 15:17 g <- 19:21 h <- data.frame(e, f, g) h rbind(d, h) ## 列名不
阅读全文
摘要:R中%in%用于判断前一个向量的元素是否在后一个向量中, 返回逻辑值。 1、 a <- c(3,1,8,9) b <- c(2, 3, 4, 8, 10) a %in% b 利用此关系可以取出向量a、和向量b的交集, 可以取出向量a中不包含在向量b中的项 a <- c(3,1,8,9) b <- c
阅读全文
摘要:1、echo liujiaxin01@PC1:~/test$ ls a.txt liujiaxin01@PC1:~/test$ cat a.txt 01 02 03 04 05 06 07 08 09 10 liujiaxin01@PC1:~/test$ echo "" >> a.txt liuji
阅读全文
摘要:列转行 1、paste liujiaxin01@PC1:~/test$ seq -f %02g 10 01 02 03 04 05 06 07 08 09 10 liujiaxin01@PC1:~/test$ seq -f %02g 10 > a.txt liujiaxin01@PC1:~/test
阅读全文
摘要:1、 a <- 1:5 b <- 3:7 c <- 5:9 d <- 4:8 e <- data.frame(a, b, c, d) e e[e == 5] = 500 e 2、在指定列替换 a <- 1:5 b <- 3:7 c <- 5:9 d <- 4:8 e <- data.frame(a,
阅读全文
摘要:1、 a <- 1:5 b <- 3:7 c <- 5:9 d <- data.frame(a, b, c) unique(c(d$a, d$b, d$c)) 2、 a <- 1:5 b <- 3:7 c <- 5:9 d <- data.frame(a, b, c) e <- vector() f
阅读全文
摘要:1、直接测试 a <- c(2, 1, 3, 5) b <- c(2, 3, 1, 1) a * b ## 仅计算每一项的成绩 a %*% b ## 将乘积汇总
阅读全文
摘要:1、win + r, 然后输入cmd 2、例如查看80端口占用情况,netstat -an |find ":80" 3、查看端口是否开启 netstat -ano -p tcp | find "5952" >nul 2>nul && echo 端口已开启 || echo 端口未开启
阅读全文
摘要:1、直接测试 a <- 1:5 b <- 3:8 a b setdiff(a, b) ##左侧唯一 setdiff(b, a) ##右侧唯一 intersect(a, b) ##交集 union(a, b) ##并集
阅读全文
摘要:来源:https://blog.csdn.net/u010652755/article/details/72982227/ 1、创建测试数据: name <- c('A','B','A','A','C','D') school <- c('s1','s2','s1','s1','s1','s3')
阅读全文
摘要:1、单列测试 root@PC1:/home/test2# seq 5 > a.txt root@PC1:/home/test2# cat a.txt 1 2 3 4 5 root@PC1:/home/test2# paste -s a.txt 1 2 3 4 5 root@PC1:/home/tes
阅读全文
摘要:1、测试1 library(dplyr) fun1 <- function(x1, x2){return(x1 - x2)} fun2 <- function(x1, x2, x3){return(x1 * x2 - x3)} a = 8 b = 7 c = 3 y1 <- a %>% fun1(b
阅读全文
摘要:1、测试数据 root@PC1:/home/test/test/test# cat a.txt 1 d f 2 3 f 3 s 8 4 f a d g 8 root@PC1:/home/test/test/test# cat -A a.txt 1 d f$ $ 2 3 f$ 3 s 8$ $ $ 4
阅读全文
摘要:1、问题 2、解决方法,增加如下内容 root@PC1:~/home/test# vim /etc/profileexport DISPLAY=:0.0 3、立即生效 root@PC1:/home/test# source /etc/profile 参考:https://blog.csdn.net/
阅读全文
摘要:linux中comm命令用于提取两列数据中的唯一项、交集、并集等。 1、测试数据 root@PC1:/home/test/test# ls a.txt b.txt root@PC1:/home/test/test# cat a.txt w s g d w a root@PC1:/home/test/
阅读全文
摘要:1、 root@PC1:/home/test# cat test.r library(optparse) option_list <- list( make_option(c("-p", "--arg1"), type = "character", default=FALSE), make_opti
阅读全文
摘要:1、查看内核 root@PC1:~/GS/lihua/test# hostnamectl Static hostname: PC1 Icon name: computer-vm Chassis: vm Machine ID: dc50d4dc469c45ea8a2a10f39caa45e9 Boot
阅读全文
摘要:1、问题 Package libxml-2.0 was not found in the pkg-config search path 2、检查是否有库文件, no root@PC1:/home/software# find / -name "libxml-2.0.pc" root@PC1:/hom
阅读全文
摘要:1、问题 2、检查相关变量、目录 root@PC1:/test# locate libcurl.pc root@PC1:/test# echo PKG_CONFIG_PATH PKG_CONFIG_PATH root@PC1:/test# ls /usr/lib/pkgconfig/ ibus-ta
阅读全文
摘要:1、问题, 命名是目录,却无法通过颜色识别 2、解决方法 root@PC1:/test# vim /etc/profile 在配置文件末尾添加ls命令别名,保存退出 3、使用source命令使其立即生效 root@PC1:/test# source /etc/profile 4、测试效果
阅读全文
摘要:1、问题 ll: command not found 2、解决方法 root@PC1:/etc# vim /etc/profile 在最下面增加命令别名, 然后保存退出。 3、重新加载profle文件 root@PC1:/etc# source /etc/profile 4、测试效果 root@PC
阅读全文
摘要:1、今天莫名其妙出现问题, qq网络正常,浏览器无法访问网页, 换了几个浏览器都是这样 2、经过查询找到如下解决方法 win+q,在搜索栏输入:代理服务器, 然后点打开 3、发现使用代理服务器是打开状态,如下所示: 4、将使用代理服务器关闭 5、打开浏览器测试,如chrome
阅读全文
摘要:1、内核版本 root@ubuntu02:~# hostnamectl Static hostname: ubuntu02 Icon name: computer-vm Chassis: vm Machine ID: 3c186d21e7094b71a8889a2d78350c4b Boot ID:
阅读全文
摘要:1、查看系统位数、系统内核 root@ubuntu02:/home# getconf LONG_BIT 64 root@ubuntu02:/home# hostnamectl Static hostname: ubuntu02 Icon name: computer-vm Chassis: vm M
阅读全文
摘要:1、 getconf LONG_BIT root@ubuntu02:/home# getconf LONG_BIT 64
阅读全文
摘要:1、内核版本 root@ubuntu01:/home# hostnamectl Static hostname: ubuntu01 Icon name: computer-vm Chassis: vm Machine ID: f3145548a2fe40f2a4a23301fc7493a5 Boot
阅读全文
摘要:1、问题,root无法在图形界面登录 2、解决方法 step1、 vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf 增加一行:greeter-show-manual-login=true, 然后保存退出 step2、 vim /root/.pr
阅读全文
摘要:1、问题 2、解决方法 step1、 vim /etc/ssh/sshd_config step2、 service ssh restart 3、测试效果
阅读全文
摘要:1、问题 2、解决方法 step1、 apt install openssh-server 。。。。。。 step2、 apt install openssh-client step3、 ps -e | grep sshd 3、测试效果
阅读全文
摘要:step1、 apt autoremove open-vm-tools step2、 apt install open-vm-tools-desktop 。。。。。。 step3、重启 reboot
阅读全文
摘要:1、问题:E: Unable to locate package 2、解决方法 。。。。。。 3、测试效果
阅读全文
摘要:1、测试sl命令 root@ubuntu01:~/Desktop# sl bash: /usr/games/sl: No such file or directory root@ubuntu01:~/Desktop# 2、安装sl root@ubuntu01:~/Desktop# apt-get i
阅读全文
摘要:1、win + r, 输入cmd, 然后回车 2、CertUtil -hashfile 文件, 文件需要绝对路径
阅读全文
摘要:一、利用软件检测准备安装win11计算机硬件是否满足win11要求 微软官网下载兼容性检测软件,链接:https://www.microsoft.com/zh-cn/windows/windows-11。(也可以其他检测软件,比如鲁大师等) 如果出现如下界面,说明不满足要求,需要开启,TPM2.0,
阅读全文
摘要:一、升级条件 1、必须在win10 2004版本及以上的版本上升级。 2、必须满足win10升级的硬件要求。 检测硬件方法如下: 微软官网下载兼容性检测软件,链接:https://www.microsoft.com/zh-cn/windows/windows-11。(也可以其他检测软件,比如鲁大师等
阅读全文
摘要:参考:https://www.bilibili.com/video/BV1qB4y1T7z2?from=search&seid=18386283577516852395 先试用软件检测硬件是否符合要求,微软官网的电脑健康状况检查软件:(链接: https://www.microsoft.com/zh
阅读全文
摘要:1、重启计算机,连续按del键,进入bios设置界面 2、按F7进入高级设置界面,或者鼠标点击Advanced(F7) 3、点击setting 4、点击security 5、点击Trusted computing 6、将Security Device Support 改为Enabled, 将TPM
阅读全文
摘要:1、win + r 2、输入tpm.msc, 然后回车 以下表示未开启。 以下表示开启:
阅读全文
摘要:1、 [root@centos79 test]# cat test.c #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char * argv[]) { char ch; FILE * in,
阅读全文
摘要:1、准备缩小的视频 2、打开格式工厂软件,点击mp4,点击添加文件,选中视频文件, 打开 3、点击输出配置,选HEVC 480P, 码率输入300, 点击确定 4、 点击开始 5、等待转换完成
阅读全文
摘要:1、首先计算机安装好格式工厂软件。 2、准备好合并的视频和音频文件 3、打开格式工厂软件,选择视屏合并&混流 4、选择视频, 点击添加文件,选择准备好的视频文件 5、选择音频,点击添加文件 6、点击输出配置,指定输出视频参数,然后点击确定 7、点击开始 8、等待。。。 9、点击完成, 视频、音频合成
阅读全文
摘要:1、首先下载所有文件(包括视频和音频),例如: 2、播放分别视频和音频 使用potplayer软件打开视频 然后右击视频选择 打开→载入音频文件,选择音频文件即可(会自动同步)。
阅读全文
摘要:1、首先确保计算机已经安装IDM。 2、在浏览器(如chrome中)进入设置 点扩展程序: 启动开发者模式: 3、进入IDM的安装目录,找到IDMGCExt.crx 文件。 4、拖动IDMGCExt.crx 文件 到 浏览器的扩展程序页面,选择添加扩展程序 5、测试,出现下载悬浮窗
阅读全文
摘要:从文件编码的方式来看,文件可分为ASCII码(或unicode)文件和二进制码文件两种。 文本文件是基于字符编码的文件。 二进制文件是基于值编码的文件。 二进制编码的字符(ascii或unicode等)表示文件内容, 是文本文件, 其中包含文本字符内容。 二进制值代表机器语言代码或数值数据、图片、音
阅读全文
摘要:1、 #include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { srand((unsigned int) time(0)); int i; for(i = 0; i < 10; i++) { printf("%
阅读全文