我有以下代碼。它將 ID(在我的資料中)傳遞到鏈接。我想知道在此代碼中哪里可以使用 target="-blank" 在新瀏覽器中打開它?
DF <-data %>%
mutate( link = paste0("<a href='https://enhancer.lbl.gov/cgi-bin/imagedb3.pl?form=presentation&show=1&experiment_id=", ID, "&organism_id=1","'>Link</a>"))
output:
<a href='https://enhancer.lbl.gov/cgi-bin/imagedb3.pl?form=presentation&show=1&experiment_id=1912&organism_id=1'>Link</a>
uj5u.com熱心網友回復:
<h4>Simple Link Open in New Tab</h4>
<a href="https://www.youtube.com/c/hitechumair" target="_blank">Click Here</a>
<h4>Link with Button Open in New Tab</h4>
<button style="background-color:red;color:white;border-color:red;">
<a style="text-decoration:none;color:white;" href="https://www.youtube.com/c/hitechumair" target="_blank">Click Here</a></button>
<style>
button:hover{
background-color:black;
}
a:hover{
text-decoration:overline;}
</style>
uj5u.com熱心網友回復:
由于您使用閃亮,您可以使用tags$a:
tags$a(
href = paste0("https://enhancer.lbl.gov/cgi-bin/imagedb3.pl?form=presentation&show=1&experiment_id=", ID, "&organism_id=1"),
target = "_blank",
"Link"
)
根據您的評論:
DF <- data %>%
mutate(
link = as.character(tags$a(
href = paste0("https://enhancer.lbl.gov/cgi-bin/imagedb3.pl?form=presentation&show=1&experiment_id=", ID, "&organism_id=1"),
target = "_blank",
"Link"
))
)
uj5u.com熱心網友回復:
link = paste0("<a ",'target="_blank"',' href="https://enhancer.lbl.gov/cgi-bin/imagedb3.pl?form=presentation&show=1&experiment_id=', ID, '&organism_id=1">Link</a>')
希望這可以幫助!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/508207.html
