I have a vector of characters. Each element of the vector has a name attribute which represents the row index of a data frame and the column index of a data frame, separated by a period. Here's a toy data set:

```
# Create vector of characters
a <- c("foo","bar","dog","cat")

# Assign attributes. The data frame is 2x2:
attr(a, "names") <- c("1.1", "1.2", "2.1", "2.2") 

```

I am trying to use the attribute names to convert the vector into a data frame, where each element in the data frame is the value in the vector and the element's row is the number before the period in the attribute name and the element's column is the number after the decimal in the attribute name. The toy example's output should look like:

```
data.frame(var1 = c("foo","dog"), var2 = c("bar", "cat"))

```

My actual vector is quite large so I am looking to do this efficiently.