【发布时间】:2020-03-06 04:33:05
【问题描述】:
我希望读取一个文件并在 R 中处理它。它遵循以下格式:
tibble(row=8,name="Shawn",state="Arizona", age=45,
comments="father=Alex;NSM;GNO;One:0.9995,0.13|Two:0.9991,0.55|Three:0.9996,0.33|Four:0.9986,0.22|Five:0.9987,0.22")
# A tibble: 1 x 5 row name state age comment <dbl> <chr> <chr> <dbl> <chr> 1 8 Shawn Arizona 45 father=Alex;NSM;GNO;One:0.9995,0.13|Two:0.9991,0.55|Three:0.9996,0.33|Four:0.9986…
我想用
替换最后一列comment
One:0.9995|Two:0.9991|Three:0.9996|Four:0.9986|Five:0.9987
然后用1减去浮点数:
comment
One:0.0005|Two:0.0009|Three:0.0004|Four:0.0014|Five:0.0013
【问题讨论】: