# Create a URL object from a base URL string and a list of parameters
base.url <- c("https://www.uniprot.org", "uniprot")
params <- c(query="reviewed:yes+AND+organism:9606",
columns='id,entry name,protein names',
format="tab")
url <- sched::URL$new(url=base.url, params=params)
# Print the URL converted to a string
print(url$toString())
## ------------------------------------------------
## Method `URL$new`
## ------------------------------------------------
# Create a URL object
url <- sched::URL$new("https://www.my.server/", c(param1=12,
param2='abc'))
## ------------------------------------------------
## Method `URL$getDomain`
## ------------------------------------------------
# Create a URL object
url <- sched::URL$new("https://www.my.server/",
c(param1=12, param2='abc'))
# Extract the domain name
print(url$getDomain())
## ------------------------------------------------
## Method `URL$setUrl`
## ------------------------------------------------
# Create an empty URL object
url <- sched::URL$new()
# Set the URL
url$setUrl('https://www.my.server/')
# Convert the URL to a string
print(url$toString())
## ------------------------------------------------
## Method `URL$setParam`
## ------------------------------------------------
# Create an URL object
url <- sched::URL$new('https://www.my.server/')
# Set a parameter
url$setParam('a', 12)
# Convert the URL to a string
print(url$toString())
## ------------------------------------------------
## Method `URL$print`
## ------------------------------------------------
# Create an URL object
url <- sched::URL$new('https://www.my.server/')
# Print the URL object
print(url)
## ------------------------------------------------
## Method `URL$toString`
## ------------------------------------------------
# Create an URL object
url <- sched::URL$new('https://www.my.server/', c(a=12))
# Convert the URL to a string
print(url$toString())
Run the code above in your browser using DataLab