如何从R中的一行中进行多行?
我目前有一个数据集,该数据集在一排中包含所有信息(如果我转置)。 The very first items in the data are actually column names:
Country | Population | O+ | A+ | B+ | AB+ | O- | A- | B- | AB- |
---|---|---|---|---|---|---|---|---|---|
Albania | 3,074,579 | 32.1% | 31.2% | 14.5% | 5.2% | 6.0% | 5.5% | 2.6% | 0.9% |
Algeria | 43,576,691 | 5019 | 40.0% | 30.0 % | 15.0% | 4.25% | 6.6%2.6% | 2.3% | 1.1% |
阿根廷 | 45,479,118 | 8017 | 48.9% | 2.45% | % | 3.16% | 0.8% 0.8% | 0.25% | ... |
亚美尼亚 | 3,021,324 | 8870 | 29.0%29.0 | %46.3% | 46.3%12.0% | 5.6%5.6% | 2.0 | ... | 4.9 |
% 是现在,我的表在一个单列中具有所有这些值(如果我转置,则行)。
我如何确保在每个国家 /地区有一个新的行?
我真的只是想通过找到在此之后但在这里试图这样做,我遇到了这个问题。对任何一项帮助都将不胜感激!
谢谢。
I currently have a data set that has all information within one single row (or column if I transpose). The very first items in the data are actually column names:
Country | Population | O+ | A+ | B+ | AB+ | O- | A- | B- | AB- |
---|---|---|---|---|---|---|---|---|---|
Albania | 3,074,579 | 32.1% | 31.2% | 14.5% | 5.2% | 6.0% | 5.5% | 2.6% | 0.9% |
Algeria | 43,576,691 | 5019 | 40.0% | 30.0% | 15.0% | 4.25% | 6.6% | 2.3% | 1.1% |
Argentina | 45,479,118 | 8017 | 48.9% | 2.45% | 4.9% | 3.16% | 0.8% | 0.25% | ... |
Armenia | 3,021,324 | 8870 | 29.0% | 46.3% | 12.0% | 5.6% | 2.0% | ... | ... |
The problem is that right now, my table has all these values within ONE single column (or row if I transpose).
How can I make sure to have a new row at each country?
I'm truly just trying to web scrape the blood type distribution by country table found here but after attempting to do so, I have encountered this problem. Help on either would be appreciated!
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该起作用
This should work