简体   繁体   English

RStudio - 将新行附加到 .csv 文件的奇怪格式

[英]RStudio - weird formatting to append new row to .csv file

I am trying to append a new row of data to an existing .csv file but everytime I do so, it doesn't add it to a new row.我正在尝试将新的数据行附加到现有的 .csv 文件中,但每次这样做时,它都不会将其添加到新行中。 Instead, it just appends to the last row like so:相反,它只是附加到最后一行,如下所示:

它没有在它下面添加,而是在它旁边

Also, the first column is supposed to show the date but I'm not sure why it shows up as hashtags.此外,第一列应该显示日期,但我不确定为什么它显示为主题标签。 But in the column where it shows 33882020-09-24, it should end at 3388 and everything else after that should be in their respective column below.但是在显示 33882020-09-24 的列中,它应该以 3388 结尾,之后的所有内容都应该在下面各自的列中。

Here is what I have for my code.这是我的代码。 I've followed multiple forums on how to append to .csv files and did exactly what was shown so I am at a loss..我关注了多个关于如何附加到 .csv 文件的论坛,并完全按照显示的内容进行操作,所以我不知所措..

R 代码示例

Any suggestions would be greatly appreciated!任何建议将不胜感激! Thank you in advance!!先感谢您!!

For the data, is possible that the Rstudio don't recognise the number as a data (because you use -, and for R is a operation. Try don't use this symbol, but for example_) or try to write 24sept2020.对于数据,Rstudio 可能无法将数字识别为数据(因为您使用了 -,而 R 是一个操作。尽量不要使用此符号,而是例如_)或尝试编写 24sept2020。 For add a new row a found this info: How can a add a row to a data frame in R?为了添加新行,找到了以下信息: How can a add a row to a data frame in R?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM