Hi,
Your issue is in a Rmardown document. If so, you can do something like this on your Rmarkdown:
count <- 3
cutoff <- 4
espn <- "http://espn.com"
yahoo <- "http://www.yahoo.com"
output<-NULL
name_output<-NULL
output <- if(count > cutoff){espn} else {yahoo}
name_output <- if(count > cutoff){'ESPN'} else {'YAHOO'}
[r name_output](r output)

It will Print Yahoo or ESPN depends on condition
Hope it help