So I have a dataset which I would like to add a new row to (it has 70+ columns in it). If possible I would like the first column to have the name of the city and then every other column in that row to just have a dash.
Here is an example data:
mydata = data.frame (Column1 =c("1","1","1","1","1","1","1",'1',"1","1"),
Column2 = c("2000-01-01","2000-01-05","2000-02-02", "2000-02-12",
"2000-02-14","2000-05-13", "2000-05-15", "2000-05-17",
"2000-05-16", "2000-05-20"),
Column3 = c("A","A","B","B","B","A","A","A","C","C"))
Please see my code below. This code allows me to add a row which gives me Toronto into the first column, but im struggling to add the "-" to the other columns. I would rather NOT have to list out every single column as mine has more than 70 columns.
mydata <- mydata %>% bind_rows(list(`Column1` = "TORONTO"),.)
I tried the following but kept getting errors.
mydata <- mydata %>% bind_rows(list(`Column1` = "TORONTO"),col(2:ncol) = "-")
```
Any help would be appreciated!