Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用一个名为Forbes2000HSAUR 包提供的数据集。我可以绘制数据,但不能用相应的国家名称缩写每个点。这是我尝试过的代码:
Forbes2000
Forbes2000top50ccompanies <- head(Forbes2000[order(Forbes2000$profits, decreasing= T),], n = 50) plot(sales ~ assets,data=Forbes2000top50ccompanies)
这将为您提供国家名称前 4 个字母的标签,并使它们小于默认值:
with(Forbes2000top50ccompanies, text(x=assets, y=sales, labels=substr(Forbes2000top50ccompanies$country, 1, 4), cex=0.6) )