Movatterモバイル変換


[0]ホーム

URL:


dunlin:Tools for Clinical Trial Data Wrangling

Check 🛠Docs 📚Code Coverage 📔

GitHub forksGitHub repo stars

GitHub commit activityGitHub contributorsGitHub last commitGitHub pull requestsGitHub repo sizeGitHub language countProject Status: Active – The project has reached a stable, usable state and is being actively developed.Current VersionOpen Issues

dunlin provides a variety of data tools to reformat andmanipulate a subset of the tables in a data set.

Installation

# install.packages("pak")pak::pak("insightsengineering/dunlin@*release")

Alternatively, you might also use the development version.

# install.packages("pak")pak::pak("insightsengineering/dunlin")

Usage

library(dunlin)df1<-data.frame("id"=c("a","b",NA,"a","k","x"),"id2"=factor(c("f1","f2",NA,NA,"f1","f1")),"val"= letters[1:6])df2<-data.frame("id"=c("a","b",NA,"a","k","x"),"id2"=factor(c("f1","f2",NA,NA,"f1","f1")),"num"=1:6)db<-list(df1 = df1,df2 = df2)prop_db<-propagate(db,"df1","val",c("id","id2"))

which returnsprop_db as

 $df1    id  id2 val1    a   f1   a2    b   f2   b3 <NA> <NA>   c4    a <NA>   d5    k   f1   e6    x   f1   f$df2    id  id2 num val1    a   f1   1   a2    b   f2   2   b3 <NA> <NA>   3   c4    a <NA>   4   d5    k   f1   5   e6    x   f1   6   f
new_format<-list(df1 =list(id =rule("No ID available"=c("",NA,"<Missing>")),id2 =rule("<Missing>"=c("",NA,"<Missing>"))  ))res<-reformat(prop_db, new_format,.na_last =TRUE)

which result inres as

$df1               id       id2 val1               a        f1   a2               b        f2   b3 No ID available <Missing>   c4               a <Missing>   d5               k        f1   e6               x        f1   f$df2    id  id2 num val1    a   f1   1   a2    b   f2   2   b3 <NA> <NA>   3   c4    a <NA>   4   d5    k   f1   5   e6    x   f1   6   f

Stargazers and Forkers

Stargazers over time

Stargazers over time

Stargazers

Stargazers repo roster for dunlin

Forkers repo roster for dunlin


[8]ページ先頭

©2009-2025 Movatter.jp