This function extracts the "datasources" attribute from a connectors object.
datasources(connectors)
An object containing the data sources extracted from the "datasources" attribute.
The function uses the attr()
function to access the "datasources" attribute
of the connectors
object. It directly returns this attribute without any
modification.
# Assume we have a 'mock_connectors' object with a 'datasources' attribute
mock_connectors <- structure(list(), class = "connectors")
attr(mock_connectors, "datasources") <- list(source1 = "data1", source2 = "data2")
# Using the function
result <- datasources(mock_connectors)
print(result)
#> $source1
#> [1] "data1"
#>
#> $source2
#> [1] "data2"
#>