1. 使用 RMarkdown 的 child 参数,进行文档拼接。
  2. 这样拼接以后的笔记方便复习。
  3. 相关问题提交到 Issue http://127.0.0.1:43572/rmd_output/0/#number

1 Chapter 1

参考 Wickham (2019)

1.1 Quotes

\

  1. escape sequence
  2. backslash type \\
## "There's plenty of room!" said Alice indignantly, and she sat down in a large arm-chair at one end of the table.
## "There's plenty of room!" said Alice indignantly, and she sat down in a large arm-chair at one end of the table.

1.2 Emoji

## hello
## <U+0001F30D>

\U followed by up to 8 hex digits sequence denotes a particular Unicode character.

  1. using base 16 and the digits 0-9 and A-F. http://www.unicode.org/charts/
  2. four digits for the codepoint, an alternative escape sequence is \u.

1.3 number

感觉 fixed 和 scientific 好复杂。

  1. 有效数字,使用format(..., digits = n),小数点前后取最大数的数位和最小数的数位(解释看例子)
    1. 方便以列展示数据,但是当数据呈现是居中,可以用trim = TRUE去除效果。
  2. 取消科学计数法,使用format(..., scientific = FALSE)
## [1] "0.001" "0.011" "1.000"
## [1] "1" "2" "1"
## [1] " 4.0" "-1.9" " 3.0" "-5.0"
## [1] "     72" "   1030" "  10292" "1189192"
## [1] "0.12000000000" "0.98000000000" "0.00001910000" "0.00000000002"
  1. 三位数控制,使用big.mark = ','给出分隔符,big.interval = 3给出分割距离。
## [1] "     72" "   1030" "  10292" "1189192"
##      72
##    1030
##   10292
## 1189192
## 72
## 1030
## 10292
## 1189192
##       72
##     1030
##   1,0292
## 118,9192

1.4 formatC

based on C style syntax

  1. "f" for fixed, digits is the number of digits after the decimal point.

  2. "e" for scientific, and

  3. "g" for fixed unless scientific saves space

  4. flag = "+"表示数据正负号

  5. format = "g", digits = 2用最少字母表示小数点后两位

  6. flag = "0"前面用0 pad 上,不清晰,也使用str_pad替代

## [1] "0.0" "0.0" "1.0"
## [1] "0.001" "0.011" "1.000"
## [1] "1.0" "2.0" "1.0"
## [1] "1" "2" "1"
## [1] "4.0"  "-1.9" "3.0"  "-5.0"
## [1] "+4.0" "-1.9" "+3.0" "-5.0"
## [1] "0.12"    "0.98"    "1.9e-05" "2e-11"
## [1] "72"      "1030"    "10292"   "1189192"
  1. 会计格式展示,使用formatpaste完成
  2. justify = "right"可以让文本居中或者向左向右。
##           Year 0   $       72
##           Year 1   $    1,030
##           Year 2   $   10,292
## Project Lifetime   $1,189,192
## [1] "0000072" "0001030" "0010292" "1189192"
## [1] "0000072" "0001030" "0010291" "1189192"
  1. formatC更简单一些 (Richie Cotton)
  2. 可以方便用于文件命名
## [1] "000" "001" "002" "003" "004" "005"

书签 https://campus.datacamp.com/courses/string-manipulation-in-r-with-stringr/pattern-matching-with-regular-expressions?ex=3

2 Chapter 2

参考 Wickham (2019)

2.2 str_length

str_length 对 factor 变量同样有效。

## [1] 4

2.3 英文名特点

## [1] 1924665       5

找不到 year 报错

## $first_letter
## 
##      A      B      C      D      E      F      G      H      I      J 
## 101494  32632  50036  57301  31795   9904  17624  18412  13880  77706 
##      K      L      M      N      O      P      Q      R      S      T 
##  77323  41851  68839  30200   8171  12109   3835  39261  63938  50452 
##      U      V      W      X      Y      Z 
##   1774   8647   6119   2276  13123  16358 
## 
## $last_letter
## 
##      a      b      c      d      e      f      g      h      i      j 
## 213857   2946   3121  13632 117122   1809   2992  51317  51723   1433 
##      k      l      m      n      o      p      q      r      s      t 
##   9203  38067  11083 170144  23668   1075    612  29900  31689  11871 
##      u      v      w      x      y      z 
##   3417   1477   1088   2219  55225   4370

因此以a开头和结尾的名字在90后和00后挺多的。

2.4 str_count

可以发现字母a挺常用的。

2.5 str_split

simplify = TRUE转换成矩阵,由于是统一数据类型,因此转换成矩阵,更加计算有效率。

##      [,1]  [,2]    
## [1,] "Box" "George"
## [2,] "Cox" "David"
## [1] "George" "David"
## [1] "Box" "Cox"

3 Chapter 3

  1. gr(?:e|a)y

参考 Wickham (2019)

参考 Wickham (2019)

  1. gr(?:e|a)y

参考 Wickham (2019)

参考 Github Issue 152,目前可以了。

3.1 rebus 包

  1. 方便管理复杂的正则化表达,因为支持缩进

  2. 支持共同部分的设定变量去调用

  3. Alternation or()

    1. or('aaa','bbb') -> (?:aaa|bbb)
    2. "gr" %R% or("e", "a") %R% "y" -> gr(?:e|a)y
  4. Character classes char_class()

    1. char_class("ae") -> [ae]
    2. negated_char_class("ae") -> [^ae]
  5. Repetition optional(), one_or_more(), zero_or_more(),repeated(lo,hi)不支持%R%

  6. exactly() = START %R% ... %R% END

  7. Shortcuts

    1. DGT = \d
    2. SPC =
    3. WRD = [a-zA-Z0-9_]
  8. Special characters

    1. BACKSLASH = \
    2. CARET = ^
    3. DOLLAR = $
    4. DOT = .
    5. PIPE = |
    6. QUESTION = ?
    7. STAR = *
    8. PLUS = +
    9. OPEN_PAREN = (
    10. CLOSE_PAREN = )
    11. OPEN_BRACKET = [
    12. CLOSE_BRACKET = ]
    13. OPEN_BRACE = {
  9. Date-time regexes

str_view()中的match = TRUE
this will only display elements that had a match, which is useful when you are searching over many strings.
且只展示第一个字母,全展示使用str_view_all
使用去查看自己的规则是否正确
## [[1]]
## [1] "555-555-0191"
## 
## [[2]]
## character(0)
## 
## [[3]]
## [1] "(555) 555 0191"
## 
## [[4]]
## [1] "555.555.0191" "555.555.0192"

分段写函数,方便管理

##  [1] "19YOM"   "31 YOF"  "82 YOM"  "33 YOF"  "10YOM"   "53 YO F" "13 MOF" 
##  [8] "14YR M"  "55YOM"   "5 YOM"

ls.str()还可以看具体的结构。

4 Chapter 4

参考 Wickham (2019)

4.1 capture + str_match

配合str_match使用

##      [,1]                            [,2]          [,3]            [,4] 
## [1,] "wolverine@xmen.com"            "wolverine"   "xmen"          "com"
## [2,] "wonderwoman@justiceleague.org" "wonderwoman" "justiceleague" "org"
## [3,] "thor@avengers.com"             "thor"        "avengers"      "com"

capture 的特性也见于 impala 的函数 regexp_extract

但是邮箱正则化很难提取,见 讨论

另外一个例子

##  [1] "19YOM-SHOULDER STRAIN-WAS TACKLED WHILE PLAYING FOOTBALL W/ FRIENDS "                      
##  [2] "31 YOF FELL FROM TOILET HITITNG HEAD SUSTAINING A CHI "                                    
##  [3] "ANKLE STR. 82 YOM STRAINED ANKLE GETTING OUT OF BED "                                      
##  [4] "TRIPPED OVER CAT AND LANDED ON HARDWOOD FLOOR. LACERATION ELBOW, LEFT. 33 YOF*"            
##  [5] "10YOM CUT THUMB ON METAL TRASH CAN DX AVULSION OF SKIN OF THUMB "                          
##  [6] "53 YO F TRIPPED ON CARPET AT HOME. DX HIP CONTUSION "                                      
##  [7] "13 MOF TRYING TO STAND UP HOLDING ONTO BED FELL AND HIT FOREHEAD ON RADIATOR DX LACERATION"
##  [8] "14YR M PLAYING FOOTBALL; DX KNEE SPRAIN "                                                  
##  [9] "55YOM RIDER OF A BICYCLE AND FELL OFF SUSTAINED A CONTUSION TO KNEE "                      
## [10] "5 YOM ROLLING ON FLOOR DOING A SOMERSAULT AND SUSTAINED A CERVICAL STRA IN"
##       [,1]      [,2] [,3] [,4]
##  [1,] "19YOM"   "19" "YO" "M" 
##  [2,] "31 YOF"  "31" "YO" "F" 
##  [3,] "82 YOM"  "82" "YO" "M" 
##  [4,] "33 YOF"  "33" "YO" "F" 
##  [5,] "10YOM"   "10" "YO" "M" 
##  [6,] "53 YO F" "53" "YO" "F" 
##  [7,] "13 MOF"  "13" "MO" "F" 
##  [8,] "14YR M"  "14" "YR" "M" 
##  [9,] "55YOM"   "55" "YO" "M" 
## [10,] "5 YOM"   "5"  "YO" "M"

同时优化一下,只提取首字母表示年月

##       [,1]      [,2] [,3] [,4]
##  [1,] "19YOM"   "19" "Y"  "M" 
##  [2,] "31 YOF"  "31" "Y"  "F" 
##  [3,] "82 YOM"  "82" "Y"  "M" 
##  [4,] "33 YOF"  "33" "Y"  "F" 
##  [5,] "10YOM"   "10" "Y"  "M" 
##  [6,] "53 YO F" "53" "Y"  "F" 
##  [7,] "13 MOF"  "13" "M"  "F" 
##  [8,] "14YR M"  "14" "Y"  "M" 
##  [9,] "55YOM"   "55" "Y"  "M" 
## [10,] "5 YOM"   "5"  "Y"  "M"

4.2 backreferences

  1. 方便删除重复单词
  2. 使用引用进行正序和反序提取字符
    1. 这一波可以去stackoverflow回复很多问题了
## [1] "hello"  "sweet"  "kitten"

这里相当于LOWER %R% LOWER

abab

abba

精确匹配

## [1] "Call me at X55-555-0191"                 
## [2] "X23 Main St"                             
## [3] "(X55) 555 0191"                          
## [4] "Phone: X55.555.0191 Mobile: 555.555.0192"
## [1] "Call me at XXX-XXX-XXXX"                 
## [2] "XXX Main St"                             
## [3] "(XXX) XXX XXXX"                          
## [4] "Phone: XXX.XXX.XXXX Mobile: XXX.XXX.XXXX"
## [1] "Call me at XXX-XXX-XXXX"                 
## [2] "... Main St"                             
## [3] "(***) *** ****"                          
## [4] "Phone: ___.___.____ Mobile: ___.___.____"

这是str_replace_all的特性,函数向量化。

剔除重复的词

## [1] "I am the aquaman"

这个可以在RStudio,replace的时候,可以每个替换对应的值

## <regex> \s([\w]+)\s\1

表示

## <regex> \s([\w]+)\s([\w]+)
adverbs <- 
c("ABNORMALLY","ABSENTMINDEDLY","ACCIDENTALLY","ACIDLY","ACTUALLY","ADVENTUROUSLY","AFTERWARDS","ALMOST","ALWAYS","ANGRILY","ANNUALLY","ANXIOUSLY","ARROGANTLY","AWKWARDLY","BADLY","BASHFULLY","BEAUTIFULLY","BITTERLY","BLEAKLY","BLINDLY","BLISSFULLY","BOASTFULLY","BOLDLY","BRAVELY","BRIEFLY","BRIGHTLY","BRISKLY","BROADLY","BUSILY","CALMLY","CAREFULLY","CARELESSLY","CAUTIOUSLY","CERTAINLY","CHEERFULLY","CLEARLY","CLEVERLY","CLOSELY","COAXINGLY","COLORFULLY","COMMONLY","CONTINUALLY","COOLLY","CORRECTLY","COURAGEOUSLY","CROSSLY","CRUELLY","CURIOUSLY","DAILY","DAINTILY","DEARLY","DECEIVINGLY","DEEPLY","DEFIANTLY","DELIBERATELY","DELIGHTFULLY","DILIGENTLY","DIMLY","DOUBTFULLY","DREAMILY","EASILY","ELEGANTLY","ENERGETICALLY","ENORMOUSLY","ENTHUSIASTICALLY","EQUALLY","ESPECIALLY","EVEN","EVENLY","EVENTUALLY","EXACTLY","EXCITEDLY","EXTREMELY","FAIRLY","FAITHFULLY","FAMOUSLY","FAR","FAST","FATALLY","FEROCIOUSLY","FERVENTLY","FIERCELY","FONDLY","FOOLISHLY","FORTUNATELY","FRANKLY","FRANTICALLY","FREELY","FRENETICALLY","FRIGHTFULLY","FULLY","FURIOUSLY","GENERALLY","GENEROUSLY","GENTLY","GLADLY","GLEEFULLY","GRACEFULLY","GRATEFULLY","GREATLY","GREEDILY","HAPPILY","HASTILY","HEALTHILY","HEAVILY","HELPFULLY","HELPLESSLY","HIGHLY","HONESTLY","HOPELESSLY","HOURLY","HUNGRILY","IMMEDIATELY","INNOCENTLY","INQUISITIVELY","INSTANTLY","INTENSELY","INTENTLY","INTERESTINGLY","INWARDLY","IRRITABLY","JAGGEDLY","JEALOUSLY","JOSHINGLY","JOVIALLY","JOYFULLY","JOYOUSLY","JUBILANTLY","JUDGEMENTALLY","JUSTLY","KEENLY","KIDDINGLY","KINDHEARTEDLY","KINDLY","KISSINGLY","KNAVISHLY","KNOTTILY","KNOWINGLY","KNOWLEDGEABLY","KOOKILY","LAZILY","LESS","LIGHTLY","LIKELY","LIMPLY","LIVELY","LOFTILY","LONGINGLY","LOOSELY","LOUDLY","LOVINGLY","LOYALLY","MADLY","MAJESTICALLY","MEANINGFULLY","MECHANICALLY","MERRILY","MISERABLY","MOCKINGLY","MONTHLY","MORE","MORTALLY","MOSTLY","MYSTERIOUSLY","NATURALLY","NEARLY","NEATLY","NEEDILY","NERVOUSLY","NEVER","NICELY","NOISILY","NOT","OBEDIENTLY","OBNOXIOUSLY","ODDLY","OFFENSIVELY","OFFICIALLY","OFTEN","ONLY","OPENLY","OPTIMISTICALLY","OVERCONFIDENTLY","OWLISHLY","PAINFULLY","PARTIALLY","PATIENTLY","PERFECTLY","PHYSICALLY","PLAYFULLY","POLITELY","POORLY","POSITIVELY","POTENTIALLY","POWERFULLY","PROMPTLY","PROPERLY","PUNCTUALLY","QUAINTLY","QUARRELSOMELY","QUEASILY","QUEERLY","QUESTIONABLY","QUESTIONINGLY","QUICKER","QUICKLY","QUIETLY","QUIRKILY","QUIZZICALLY","RAPIDLY","RARELY","READILY","REALLY","REASSURINGLY","RECKLESSLY","REGULARLY","RELUCTANTLY","REPEATEDLY","REPROACHFULLY","RESTFULLY","RIGHTEOUSLY","RIGHTFULLY","RIGIDLY","ROUGHLY","RUDELY","SADLY","SAFELY","SCARCELY","SCARILY","SEARCHINGLY","SEDATELY","SEEMINGLY","SELDOM","SELFISHLY","SEPARATELY","SERIOUSLY","SHAKILY","SHARPLY","SHEEPISHLY","SHRILLY","SHYLY","SILENTLY","SLEEPILY","SLOWLY","SMOOTHLY","SOFTLY","SOLEMNLY","SOLIDLY","SOMETIMES","SOON","SPEEDILY","STEALTHILY","STERNLY","STRICTLY","SUCCESSFULLY","SUDDENLY","SURPRISINGLY","SUSPICIOUSLY","SWEETLY","SWIFTLY","SYMPATHETICALLY","TENDERLY","TENSELY","TERRIBLY","THANKFULLY","THOROUGHLY","THOUGHTFULLY","TIGHTLY","TOMORROW","TOO","TREMENDOUSLY","TRIUMPHANTLY","TRULY","TRUTHFULLY","ULTIMATELY","UNABASHEDLY","UNACCOUNTABLY","UNBEARABLY","UNETHICALLY","UNEXPECTEDLY","UNFORTUNATELY","UNIMPRESSIVELY","UNNATURALLY","UNNECESSARILY","UPBEAT","UPLIFTINGLY","UPRIGHT","UPSIDE-DOWN","UPWARD","UPWARDLY","URGENTLY","USEFULLY","USELESSLY","USUALLY","UTTERLY","VACANTLY","VAGUELY","VAINLY","VALIANTLY","VASTLY","VERBALLY","VERY","VICIOUSLY","VICTORIOUSLY","VIOLENTLY","VIVACIOUSLY","VOLUNTARILY","WARMLY","WEAKLY","WEARILY","WELL","WETLY","WHOLLY","WILDLY","WILLFULLY","WISELY","WOEFULLY","WONDERFULLY","WORRIEDLY","WRONGLY","YAWNINGLY","YEARLY","YEARNINGLY","YESTERDAY","YIELDINGLY","YOUTHFULLY")

随机给动词增加副词

##  [1] "19YOM-SHOULDER STRAIN-WAS TACKLED WHILE CARELESSLY PLAYING FOOTBALL W/ FRIENDS "                      
##  [2] "31 YOF FELL FROM TOILET HITITNG HEAD CARELESSLY SUSTAINING A CHI "                                    
##  [3] "ANKLE STR. 82 YOM STRAINED ANKLE CARELESSLY GETTING OUT OF BED "                                      
##  [4] "TRIPPED OVER CAT AND LANDED ON HARDWOOD FLOOR. LACERATION ELBOW, LEFT. 33 YOF*"                       
##  [5] "10YOM CUT THUMB ON METAL TRASH CAN DX AVULSION OF SKIN OF THUMB "                                     
##  [6] "53 YO F TRIPPED ON CARPET AT HOME. DX HIP CONTUSION "                                                 
##  [7] "13 MOF CARELESSLY TRYING TO STAND UP HOLDING ONTO BED FELL AND HIT FOREHEAD ON RADIATOR DX LACERATION"
##  [8] "14YR M CARELESSLY PLAYING FOOTBALL; DX KNEE SPRAIN "                                                  
##  [9] "55YOM RIDER OF A BICYCLE AND FELL OFF SUSTAINED A CONTUSION TO KNEE "                                 
## [10] "5 YOM CARELESSLY ROLLING ON FLOOR DOING A SOMERSAULT AND SUSTAINED A CERVICAL STRA IN"
##  [1] "19YOM-SHOULDER STRAIN-WAS TACKLED WHILE KINDHEARTEDLY PLAYING FOOTBALL W/ FRIENDS "               
##  [2] "31 YOF FELL FROM TOILET HITITNG HEAD UNIMPRESSIVELY SUSTAINING A CHI "                            
##  [3] "ANKLE STR. 82 YOM STRAINED ANKLE READILY GETTING OUT OF BED "                                     
##  [4] "TRIPPED OVER CAT AND LANDED ON HARDWOOD FLOOR. LACERATION ELBOW, LEFT. 33 YOF*"                   
##  [5] "10YOM CUT THUMB ON METAL TRASH CAN DX AVULSION OF SKIN OF THUMB "                                 
##  [6] "53 YO F TRIPPED ON CARPET AT HOME. DX HIP CONTUSION "                                             
##  [7] "13 MOF LAZILY TRYING TO STAND UP HOLDING ONTO BED FELL AND HIT FOREHEAD ON RADIATOR DX LACERATION"
##  [8] "14YR M MONTHLY PLAYING FOOTBALL; DX KNEE SPRAIN "                                                 
##  [9] "55YOM RIDER OF A BICYCLE AND FELL OFF SUSTAINED A CONTUSION TO KNEE "                             
## [10] "5 YOM GRACEFULLY ROLLING ON FLOOR DOING A SOMERSAULT AND SUSTAINED A CERVICAL STRA IN"

Replacement combined with backreferences can be really useful for reformatting text data.

附录

Unicode 的章节可以进附录

通过\p{name} impala应该是不支持的 https://grokbase.com/t/cloudera/impala-user/137tdg0thq/unicode-string-issue-with-impala

Vietnamese 越南语

## [1] "Nguy<U+1EC5>n Nh<U+1EA1>c" "Nguy<U+1EC5>n Hu<U+1EC7>" "Nguy<U+1EC5>n Quang To<U+1EA3>n"
## [1] "Nguye<U+0302><U+0303>n Nha<U+0323>c" "Nguye<U+0302><U+0303>n Hue<U+0323><U+0302>" "Nguye<U+0302><U+0303>n Quang Toa<U+0309>n"
## Adele
## Adèle
## Ade<U+0300>le

当两个Unicode时,用.是识别不出来的,需要使用\X

5 Chapter 5

参考 Wickham (2019)

这个老师的文本处理非常优秀,应该 follow

的确是针对小说进行过分析。

## FIRST ACT
## 
## 
## SCENE
## 
## 
## Morning-room in Algernon's flat in Half-Moon Street.  The room is
## luxuriously and artistically furnished.  The sound of a piano is heard in
## the adjoining room.
## 
## [Lane is arranging afternoon tea on the table, and after the music has
## ceased, Algernon enters.]
## 
## Algernon.  Did you hear what I was playing, Lane?
## 
## Lane.  I didn't think it polite to listen, sir.
## 
## Algernon.  I'm sorry for that, for your sake.  I don't play
## accurately--any one can play accurately--but I play with wonderful
## expression.  As far as the piano is concerned, sentiment is my forte.  I

Why does Charlotte Wickham says stri_read_lines() is better than readLines()?

提供了处理文本的函数,而不需要在data.frame去实现。

## [1] "Algernon.  I'm sorry for that, for your sake.  I don't play"             
## [2] "accurately--any one can play accurately--but I play with wonderful"      
## [3] "expression.  As far as the piano is concerned, sentiment is my forte.  I"
## [4] "keep science for Life."                                                  
## [5] "Lane.  Yes, sir."                                                        
## [6] "Algernon.  And, speaking of the science of Life, have you got the"
##  [1] "Algernon."   "Lane."       "Jack."       "Cecily."     "Ernest."    
##  [6] "University." "Gwendolen."  "July."       "Chasuble."   "Merriman."  
## [11] "Sunday."     "Mr."         "London."     "Cardew."     "Opera."     
## [16] "Markby."     "Oxonian."

stri_read_lines 更好 总结一下

or takes multiple character vector inputs and returns a character vector of the inputs separated by pipes. %|% is an operator interface to this function. or1 takes a single character vector and returns a string collapsed by pipes.

## [1] "Algernon."       "Lane."           "Jack."           "Cecily."        
## [5] "Gwendolen."      "Lady Bracknell." "Miss Prism."     "Chasuble."      
## [9] "Merriman."
## who
##       Algernon.         Cecily.       Chasuble.      Gwendolen. 
##             201             154              42             102 
##           Jack. Lady Bracknell.           Lane.       Merriman. 
##             219              84              21              17 
##     Miss Prism. 
##              41

Jack and Algernon [Speaking together.]这个问题需要解决。

这个的处理不够strong,我需要知道每一步发生的逻辑,这样之后才能精进

5.1 ignore case

## [1] "79yOf Fractured fingeR tRiPPED ovER cAT ANd fell to FlOOr lAst nIGHT AT HOME*"                                                               
## [2] "21 YOF REPORTS SUS LACERATION OF HER LEFT HAND WHEN SHE WAS OPENING A CAN OF CAT FOOD JUST PTA. DX HAND LACERATION%"                         
## [3] "87YOF TRIPPED OVER CAT, HIT LEG ON STEP. DX LOWER LEG CONTUSION "                                                                            
## [4] "bLUNT CHest trAUma, R/o RIb fX, R/O CartiLAgE InJ To RIB cAge; 32YOM walKiNG DOG, dog took OfF aFtER cAt,FelL,stRucK CHest oN STepS,hiT rIbS"
## [5] "42YOF TO ER FOR BACK PAIN AFTER PUTTING DOWN SOME CAT LITTER DX: BACK PAIN, SCIATICA"                                                        
## [6] "4YOf DOg jUst hAd PUpPieS, Cat TRIED 2 get PuPpIes, pT THru CaT dwn stA Irs, LoST foOTING & FELl down ~12 stePS; MInor hEaD iNJuRY"
## character(0)
## [1] "Cat" "CAT" "cAt"

5.2 stri_trans_totitle()

## 79yOf Fractured fingeR tRiPPED ovER cAT ANd fell to FlOOr lAst nIGHT AT HOME*
## 21 YOF REPORTS SUS LACERATION OF HER LEFT HAND WHEN SHE WAS OPENING A CAN OF CAT FOOD JUST PTA. DX HAND LACERATION%
## 87YOF TRIPPED OVER CAT, HIT LEG ON STEP. DX LOWER LEG CONTUSION 
## bLUNT CHest trAUma, R/o RIb fX, R/O CartiLAgE InJ To RIB cAge; 32YOM walKiNG DOG, dog took OfF aFtER cAt,FelL,stRucK CHest oN STepS,hiT rIbS
## 42YOF TO ER FOR BACK PAIN AFTER PUTTING DOWN SOME CAT LITTER DX: BACK PAIN, SCIATICA
## [1] "79yof Fractured Finger Tripped Over Cat And Fell To Floor Last Night At Home*"                                                               
## [2] "21 Yof Reports Sus Laceration Of Her Left Hand When She Was Opening A Can Of Cat Food Just Pta. Dx Hand Laceration%"                         
## [3] "87yof Tripped Over Cat, Hit Leg On Step. Dx Lower Leg Contusion "                                                                            
## [4] "Blunt Chest Trauma, R/O Rib Fx, R/O Cartilage Inj To Rib Cage; 32yom Walking Dog, Dog Took Off After Cat,Fell,Struck Chest On Steps,Hit Ribs"
## [5] "42yof To Er For Back Pain After Putting Down Some Cat Litter Dx: Back Pain, Sciatica"
## [1] "79yof Fractured Finger Tripped Over Cat And Fell To Floor Last Night At Home*"                                                               
## [2] "21 Yof Reports Sus Laceration Of Her Left Hand When She Was Opening A Can Of Cat Food Just Pta. Dx Hand Laceration%"                         
## [3] "87yof Tripped Over Cat, Hit Leg On Step. Dx Lower Leg Contusion "                                                                            
## [4] "Blunt Chest Trauma, R/O Rib Fx, R/O Cartilage Inj To Rib Cage; 32yom Walking Dog, Dog Took Off After Cat,Fell,Struck Chest On Steps,Hit Ribs"
## [5] "42yof To Er For Back Pain After Putting Down Some Cat Litter Dx: Back Pain, Sciatica"
## [1] "79yof fractured finger tripped over cat and fell to floor last night at home*"                                                               
## [2] "21 yof reports sus laceration of her left hand when she was opening a can of cat food just pta. Dx hand laceration%"                         
## [3] "87yof tripped over cat, hit leg on step. Dx lower leg contusion "                                                                            
## [4] "Blunt chest trauma, r/o rib fx, r/o cartilage inj to rib cage; 32yom walking dog, dog took off after cat,fell,struck chest on steps,hit ribs"
## [5] "42yof to er for back pain after putting down some cat litter dx: back pain, sciatica"

整理下笔记,真的非常有用的学习

ppt 上面推荐的书,可以看一下

5.3 完成证书

参考 DataCamp

附录

参考文献

Wickham, Charlotte. 2019. “String Manipulation in R with Stringr.” DataCamp. 2019. https://www.datacamp.com/courses/string-manipulation-in-r-with-stringr.