User Tools

Site Tools


r_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
r_notes [2019/02/11 10:30] – [데이터프레임- row-wise maximum] hyjeongr_notes [2022/05/11 15:30] (current) – [정해영의 R 노트] hyjeong
Line 1: Line 1:
 ====== 정해영의 R 노트 ====== ====== 정해영의 R 노트 ======
 +Private 영역에 작성한 [[p:2019_r_note|2019 R note]]도 상호 보완적인 관계에 있으니 계속 업데이트해 나갈 것. 
 ===== 유용한 글 링크 ===== ===== 유용한 글 링크 =====
  
Line 15: Line 15:
   * [[http://www.r-tutor.com/r-introduction|R introduction]]   * [[http://www.r-tutor.com/r-introduction|R introduction]]
   * [[https://www.rstudio.com/resources/cheatsheets/|RStudio Cheat Sheets]]   * [[https://www.rstudio.com/resources/cheatsheets/|RStudio Cheat Sheets]]
 +  * R Friend [[https://rfriend.tistory.com/118|R 단일 모집단 분석과 정규성 검정]]
  
 ===== R graphics ===== ===== R graphics =====
Line 27: Line 28:
  
 ===== 정해영의 블로그: 하루에 한 R 시리즈 ===== ===== 정해영의 블로그: 하루에 한 R 시리즈 =====
-[[http://blog.genoglobe.com/search?q=%ED%95%98%EB%A3%A8%EC%97%90+%ED%95%9C+R&max-results=20&by-date=true|[하루에 한 R] - 날짜순으로 정렬하여 보여주기]]+[[http://blog.genoglobe.com/search?q=%ED%95%98%EB%A3%A8%EC%97%90+%ED%95%9C+R&max-results=20&by-date=true|[하루에 한 R] - 전체 블로그 글을 날짜순으로 정렬하여 보여주기]] 
 + 
 +===== KGOL 강좌 수강 노트 ===== 
 +[[R을 활용한 통계학 개론(2018)]] [[https://www.kgol.org/course/course_view.jsp?id=9056&cid=4933&ch=course|강좌 소개]] 
  
 ===== 짧은 팁 ===== ===== 짧은 팁 =====
Line 56: Line 61:
 ===== 활용 사례 ===== ===== 활용 사례 =====
 ==== CSV 파일의 병합 ==== ==== CSV 파일의 병합 ====
 +  * [[https://blog.genoglobe.com/2018/01/r-phylosift-tab-delimited-csv.html|[하루에 한 R] PhyloSift 결과 종합하기(tab-delimited CSV 파일의 일괄 입력 및 병합 등)]]
 ==== 데이터프레임-행과 열의 이름 일괄 변경 ==== ==== 데이터프레임-행과 열의 이름 일괄 변경 ====
   * [[https://blog.genoglobe.com/2019/02/r-keyvalue.html|[하루에 한 R] Key/value 형태의 자료를 이용한 치환]]   * [[https://blog.genoglobe.com/2019/02/r-keyvalue.html|[하루에 한 R] Key/value 형태의 자료를 이용한 치환]]
Line 63: Line 69:
   * [[https://blog.genoglobe.com/2015/04/r-row.html|[하루에 한 R] 특정 조건에 맞는 row만 출력하기]]   * [[https://blog.genoglobe.com/2015/04/r-row.html|[하루에 한 R] 특정 조건에 맞는 row만 출력하기]]
   * [[https://blog.genoglobe.com/2017/12/r-row.html|[하루에 한 R] 매트릭스에서 특정 값을 갖는 row 추출하기]]   * [[https://blog.genoglobe.com/2017/12/r-row.html|[하루에 한 R] 매트릭스에서 특정 값을 갖는 row 추출하기]]
-antiSMASH 데이터셋을 사용한다. 첫 줄의 '#'는 삭제할 것.+{{ :asdb_search_results.zip |antiSMASH 데이터셋}}을 사용한다. 첫 줄의 '#'는 삭제할 것. 
 +  $ wget http://genoglobe.kr/kribb/_media/asdb_search_results.zip 
 +  $ unzip asdb_search_results.zip 
 +  $ cp asdb_search_results.csv asdb_search_results.csv.bak 
 +  $ awk '{gsub("^#", ""); print}' asdb_search_results.csv.bak > asdb_search_results.csv
  
   data = read.table("asdb_search_results.csv",sep="\t",header=T)   data = read.table("asdb_search_results.csv",sep="\t",header=T)
Line 84: Line 94:
   data[which(names(data) %in% sel.col)]   data[which(names(data) %in% sel.col)]
      
 +  # Genus와 Species 컬럼을 결합하고 문자열 치환하기
 +  data$Species = paste(data$Genus, data$Species, sep=" ")
 +  data = data[,-1]
 +  data$Species = gsub("Unclassified", "sp.", data$Species)
 +  # 다음과 같이 해도 된다.
 +  #data[,2] = paste(data[,1], data[,2], sep=" ")
 +  #data = data[,-1]
 +  #data[,1] = gsub("Unclassified", "sp.", data[,1])
      
   # 조건에 맞는 row 전체 혹은 일부 컬럼만 추출하기   # 조건에 맞는 row 전체 혹은 일부 컬럼만 추출하기
Line 114: Line 132:
   * {{ :anib_percentage_identity_paenibacillus.zip |ANI percent identity (pyani)}} - 51 Paenibacillus genomes. col/row label의 형식은 "GCF_000146875.3"이다.   * {{ :anib_percentage_identity_paenibacillus.zip |ANI percent identity (pyani)}} - 51 Paenibacillus genomes. col/row label의 형식은 "GCF_000146875.3"이다.
   * {{ :asdb_search_results.zip |antiSMASH db file}} [[https://antismash-db.secondarymetabolites.org/#!/query|source link]] - search result using the keyword "Paenibacillus"   * {{ :asdb_search_results.zip |antiSMASH db file}} [[https://antismash-db.secondarymetabolites.org/#!/query|source link]] - search result using the keyword "Paenibacillus"
 +
  
r_notes.1549848651.txt.gz · Last modified: (external edit)