Question: I have a 1 column dataframe with a series of URLs in its only column (could be a vector just the same). For the sake of this example, we'll keep each URL the same:

```
urls<-as.data.frame(c("https://en.wikipedia.org/wiki/List_of_counties_in_California", "https://en.wikipedia.org/wiki/List_of_counties_in_California","https://en.wikipedia.org/wiki/List_of_counties_in_California"))
colnames(urls)<-"col1"
urls$col1<-as.character(urls$col1)

```

I also have a function I have written that scrapes a table from those urls:

```
wiki_scrape <- function(x){
  x_url <- x %>%
    read_html() %>%
    html_nodes(xpath='//*[@id="mw-content-text"]/div/table[2]') %>%
    html_table() %>%
    .[[1]] %>%
    select(County)
  return(x_url) 
}

```

The result of `wiki_scrape(urls[1,1])` is a dataframe of 58 observations. I would like to run this function `wiki_scrape` in an iterative fashion over the entire vector `urls` (and not just `urls[1,1]`) and append each resulting dataframe to the previous resulting dataframe. In this example, `urls` has 3 urls listed so I want my resulting dataframe to be 174 observations long (3\*58 = 174 with 58 being the length of one dataframe scraped using `wiki_scrape`).

Answer: 
The date you get is actually a decimal year, so the month is in there still. If you want to have two columns, year and month, you can try something like:

```
res <- data.frame(as.matrix(Seatbelts), date=time(Seatbelts))
res$year <- trunc(res$date)
res$month <- (res$date - res$year) * 12 + 1
res

##  DriversKilled drivers front rear   kms PetrolPrice VanKilled law     date year month
## 1           107    1687   867  269  9059   0.1029718        12   0 1969.000 1969     1
## 2            97    1508   825  265  7685   0.1023630         6   0 1969.083 1969     2
## 3           102    1507   806  319  9963   0.1020625        12   0 1969.167 1969     3
## 4            87    1385   814  407 10955   0.1008733         8   0 1969.250 1969     4
## 5           119    1632   991  454 11823   0.1010197        10   0 1969.333 1969     5
## 6           106    1511   945  427 12391   0.1005812        13   0 1969.417 1969     6

```
I may have misunderstood the ask, but to get the output of month & year, & month year date, you could convert to `xts` format first and then to dataframe - the latter conversion is far better documented generally than a `ts` object. The operations following are fairly rudimentary - extracting text into new columns.

```
library(xts)
library(tidyverse)

tsx <- as.xts(datasets::Seatbelts)
df <- data.frame(date=index(tsx), coredata(tsx)) %>%
  mutate(date_chr = as.character(date),
         month    = substr(date, 1, 3),
         year     = substr(date, 5, 8))

      date DriversKilled drivers front rear   kms PetrolPrice VanKilled law date_chr month year
1 Jan 1969           107    1687   867  269  9059   0.1029718        12   0 Jan 1969   Jan 1969
2 Feb 1969            97    1508   825  265  7685   0.1023630         6   0 Feb 1969   Feb 1969
3 Mar 1969           102    1507   806  319  9963   0.1020625        12   0 Mar 1969   Mar 1969
4 Apr 1969            87    1385   814  407 10955   0.1008733         8   0 Apr 1969   Apr 1969
5 May 1969           119    1632   991  454 11823   0.1010197        10   0 May 1969   May 1969
6 Jun 1969           106    1511   945  427 12391   0.1005812        13   0 Jun 1969   Jun 1969

```