Question: I have a layout as follows for mobile ..

```
    +------------------------+
    | (col-md-6)   Div 1     |
    +------------------------+
    | (col-md-6)   Div 2     |
    +------------------------+
    | (col-md-6)   Div 3     |
    +------------------------+
    | (col-md-6)   Div 4     |
    +------------------------+
    | (col-md-6)   Div 5     |
    +------------------------+
    | (col-md-6)   Div 6     |
    +------------------------+
    | (col-md-6)   Div 7     |
    +------------------------+

```

When the screen widens or goes on tablet the layout changes as expected to ...

```
+------------------------+------------------------+
| (col-md-6)   Div 1     | (col-md-6)   Div 2     |
+------------------------+------------------------+
| (col-md-6)   Div 3     | (col-md-6)   Div 4     |
+------------------------+------------------------+
| (col-md-6)   Div 5     | (col-md-6)   Div 6     |
+------------------------+------------------------+
| (col-md-6)   Div 7     |
+------------------------+        

```

But I would like the layout to look like ..

```
+------------------------+------------------------+
| (col-md-6)   Div 1     | (col-md-6)   Div 5     |
+------------------------+------------------------+
| (col-md-6)   Div 2     | (col-md-6)   Div 6     |
+------------------------+------------------------+
| (col-md-6)   Div 3     | (col-md-6)   Div 7     |
+------------------------+------------------------+
| (col-md-6)   Div 4     |
+------------------------+        

```

Is this possible?

Answer: 
The problem is not linked to data.frame, but simply that you cannot have in the same vector objects of class numeric and objects of class character. It is NOT possible.

The person who started the project before you should not have used the string "Error" to indicate a missing data. Instead, you should use NA :

```
x=c(1,2)
y=c("Error","Error")
c(x,y) # Here the result is coerced as character automatically by R. There is no way to avoid that.

```

Instead you should use

```
c(x,NA) # NA is accepted in a vector of numeric

```

**Note:** you should think a data.frame as a list of vectors which are the columns of the data.frame. Hence if you have 2 columns, *each column is an independent vector* and hence it is possible to have different class per column:

```
x <- c(1,2)
y <- c("Error","Error")
df=data.frame(x=x,y=y,stringsAsFactors=FALSE)
class(df$x)
class(df$y)

```

Now if you try to transpose the data.frame, of course the new column vectors will become c(1,"Error") and c(2,"Error") that will be coerced as character as we have seen before.

```
t(df)

```
You could do this:

```
x <- 1
y <- c("Error","Error")
df <- data.frame(c(list(), x, y), stringsAsFactors = FALSE)
> str(df)
'data.frame':   1 obs. of  3 variables:
 $ X1        : num 1
 $ X.Error.  : chr "Error"
 $ X.Error..1: chr "Error"

```

You just have to set proper column names.