This takes a data frame containing ldf_resource
or ldf_interval
vectors
and converts those vectors into labels.
as_dataframe_of_labels(d, ...)
d | A linked data frame |
---|---|
... | Additional arguments passed to |
A data frame with labels in place of any ldf vectors
The labels will either be character vectors or factors depending on the value of
default.stringsAsFactors()
. This can be ridden by passing the argument
stringsAsFactors=F
.
uris <- c("http://example.net/id/apple", "http://example.net/id/banana", "http://example.net/id/carrot") labels <- c("Apple","Banana","Carrot") description <- data.frame(uri=uris, label=labels) linked_data_frame <- data.frame(fruit=resource(uris, description)) labelled_data_frame <- as_dataframe_of_labels(linked_data_frame, stringsAsFactors=FALSE)