随笔分类 -  R语言

摘要:# 清除所有变量 rm(list = ls()) # 设置工作目录 setwd("C:\\Users\\Administrator\\Desktop\\machine learning\\Heatmap\\KEGG") # 读取txt文件 # 假设txt文件是以制表符分隔,并且第一行为列名 inpu 阅读全文
posted @ 2024-12-15 15:54 王哲MGG_AI 阅读(34) 评论(0) 推荐(0) 编辑
摘要:rm(list = ls()) setwd("C:\\Users\\Administrator\\Desktop\\machine learning\\Network") #设置工作目录 library(dplyr) library(tidyr) library(readr) # 读取文件 data 阅读全文
posted @ 2024-12-15 15:46 王哲MGG_AI 阅读(29) 评论(0) 推荐(0) 编辑
摘要:# 清除工作空间 rm(list = ls()) # 设置工作目录 setwd("C:\\Users\\Administrator\\Desktop\\machine learning\\Heatmap\\CAZy") # 读取数据 otu <- read.table("TPM.CAZy.raw.t 阅读全文
posted @ 2024-12-15 15:45 王哲MGG_AI 阅读(20) 评论(0) 推荐(0) 编辑
摘要:# 清理环境和加载必要包 rm(list = ls()) setwd("C:\\Users\\Administrator\\Desktop\\machine learning\\LASSO回归\\CAZy") # 设置工作目录 train <- read.table("matched_otu.txt 阅读全文
posted @ 2024-12-15 15:43 王哲MGG_AI 阅读(109) 评论(0) 推荐(1) 编辑
摘要:# 清理环境和设置工作目录 rm(list = ls()) setwd("C:\\Users\\Administrator\\Desktop\\machine learning\\SVM-RFE\\CAZy") set.seed(127) # 加载数据 input <- read.table("ma 阅读全文
posted @ 2024-12-15 15:42 王哲MGG_AI 阅读(91) 评论(0) 推荐(0) 编辑
摘要:# 清空环境变量 rm(list = ls()) # 设置工作目录,请修改为你的文件实际路径 setwd("C:\\Users\\Administrator\\Desktop\\machine learning\\Heatmap\\MetaCyc") # 读取路径数据 Pathway_raw <- 阅读全文
posted @ 2024-12-15 15:40 王哲MGG_AI 阅读(11) 评论(0) 推荐(0) 编辑
摘要:# 清除所有变量 rm(list = ls()) # 设置工作目录 setwd("C:\\Users\\Administrator\\Desktop\\machine learning\\Bar chart") # 读取txt文件 # 假设txt文件是以制表符分隔,并且第一行为列名 input_da 阅读全文
posted @ 2024-12-10 17:13 王哲MGG_AI 阅读(79) 评论(0) 推荐(0) 编辑
摘要:rm(list = ls()) library(readr) # 读取 CSV 文件 library(dplyr) # 数据操作 library(tidyr) # 数据整理 library(brms) # 贝叶斯回归 library(tibble) setwd("C:\\Users\\Adminis 阅读全文
posted @ 2024-12-02 10:12 王哲MGG_AI 阅读(67) 评论(0) 推荐(0) 编辑
摘要:rm(list = ls()) library(dplyr) library(broom) library(ggplot2) library(brms) # 设置工作目录 setwd("C:\\Users\\Administrator\\Desktop\\machine learning\\Baye 阅读全文
posted @ 2024-12-02 10:12 王哲MGG_AI 阅读(32) 评论(0) 推荐(0) 编辑
摘要:rm(list = ls()) library(readr) # 读取 CSV 文件 library(dplyr) # 数据操作 library(tidyr) # 数据整理 library(betareg) # Beta 回归 library(tibble) setwd("C:\\Users\\Ad 阅读全文
posted @ 2024-11-28 17:25 王哲MGG_AI 阅读(28) 评论(0) 推荐(0) 编辑
摘要:rm(list = ls()) library(dplyr) library(broom) library(ggplot2) # 设置工作目录 setwd("C:\\Users\\Administrator\\Desktop\\machine learning\\Multiple Linear Re 阅读全文
posted @ 2024-11-28 16:01 王哲MGG_AI 阅读(24) 评论(0) 推荐(0) 编辑
摘要:rm(list = ls()) setwd("C:\\Users\\Administrator\\Desktop\\machine learning\\Multiple Linear Regression") # 导入所需的库 # 如果需要的话,可以使用 `install.packages("rea 阅读全文
posted @ 2024-11-26 10:37 王哲MGG_AI 阅读(87) 评论(0) 推荐(0) 编辑
摘要:# 清空环境变量 rm(list = ls()) setwd("C:\\Users\\Administrator\\Desktop\\machine learning\\LSTM") library(magrittr) # 提供 %>% 管道操作符 library(keras) # 提供 Keras 阅读全文
posted @ 2024-10-14 14:55 王哲MGG_AI 阅读(15) 评论(0) 推荐(0) 编辑
摘要:rm(list = ls()) library(ggplot2) setwd("C:\\Users\\Administrator\\Desktop\\Pei\\Trans_Kegg") data1 <- read.table("1.txt", header = TRUE, sep = "\t") d 阅读全文
posted @ 2024-09-23 17:10 王哲MGG_AI 阅读(92) 评论(0) 推荐(0) 编辑
摘要:rm(list = ls()) setwd("C:\\Users\\Administrator\\Desktop\\machine learning\\分组散点图") data("mpg") library(ggplot2) data <- read.table("data.txt", sep = 阅读全文
posted @ 2024-09-11 15:25 王哲MGG_AI 阅读(32) 评论(0) 推荐(0) 编辑
摘要:此代码的功能是遍历当前目录下的所有TSV文件,将每个文件的第一列内容提取出来,并将其写入一个TXT文件中。每个TSV文件的内容占一行,文件名作为该行的第一列,第一列内容依次排开。 rm(list = ls()) setwd("C:\\Users\\Administrator\\Desktop\\pr 阅读全文
posted @ 2024-08-06 10:28 王哲MGG_AI 阅读(28) 评论(0) 推荐(0) 编辑
摘要:# 清空工作环境,删除所有对象 rm(list = ls()) setwd("C:\\Users\\Administrator\\Desktop\\New_microtable\\Co-occurrence Network") #设置工作目录 # 加载必要的包 library(ggplot2) li 阅读全文
posted @ 2024-08-02 11:33 王哲MGG_AI 阅读(14) 评论(0) 推荐(0) 编辑
摘要:rm (list = ls ()) #清除所有变量 library(KEGGREST) # 设置工作目录并读取数据 setwd("C:\\Users\\Administrator\\Desktop\\New_microtable\\HUMAnN") # 根据实际路径修改 pathways_df <- 阅读全文
posted @ 2024-07-06 15:37 王哲MGG_AI 阅读(41) 评论(0) 推荐(0) 编辑
摘要:# 清空工作环境,删除所有对象 rm(list = ls()) library(data.table) # 加载data.table包 library(data.table) # 设置工作目录 setwd("C:\\Users\\Administrator\\Desktop") # 设置为你的工作目 阅读全文
posted @ 2024-06-19 16:07 王哲MGG_AI 阅读(48) 评论(0) 推荐(1) 编辑
摘要:# 清除所有变量 rm(list = ls()) # 设置工作目录 setwd("C:\\Users\\Administrator\\Desktop\\新建文件夹\\PLS_Pathway") # 1. 加载所需的库 library(vegan) library(tidyverse) library 阅读全文
posted @ 2024-03-27 17:15 王哲MGG_AI 阅读(282) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示