File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 3
3
library(tidyverse )
4
4
library(archive )
5
5
library(xml2 )
6
+ library(bit64 )
6
7
7
8
archive_path <- " /Users/quatrava/Downloads/ISAS-FSD-idevfsd-2025-03-28-11-36-24-881.xml.zip"
8
9
@@ -58,7 +59,16 @@ props_tibble <- function(objects_nodeset) {
58
59
pkeys = xml_attr(props , ' name' ),
59
60
pvals = xml_text(props )) %> %
60
61
pivot_wider(names_from = pkeys , values_from = pvals ) %> %
61
- select(- row )
62
+ select(- row ) %> %
63
+ mutate(across(any_of(c(" position" )) |
64
+ ends_with(" version" , ignore.case = TRUE ),
65
+ as.integer ),
66
+ across(any_of(c(" longValue" )),
67
+ as.integer64 ),
68
+ across(any_of(c(" contentStatus" , " relationName" , " targetType" )),
69
+ as.factor ),
70
+ across(ends_with(" date" , ignore.case = TRUE ),
71
+ parse_datetime ))
62
72
}
63
73
64
74
# ' Format the “props” that have a `class` for each node in a nodeset, into a tibble
@@ -144,7 +154,8 @@ bodies <- {
144
154
type = case_when(
145
155
bodyType == 0 ~ " SpaceDescription" ,
146
156
bodyType == 1 ~ " CustomContentEntityObject" ,
147
- bodyType == 2 ~ " PageEtc" )) %> %
157
+ bodyType == 2 ~ " PageEtc" ) %> %
158
+ as_factor ) %> %
148
159
mutate(ns %> % classful_props_tibble )
149
160
}
150
161
You can’t perform that action at this time.
0 commit comments