Monday, December 18, 2017

How do you store the values of a table with three columns or more columns in R?

Let us say you want to work this table in R.
Table with three columns
Col1 Col2  Col3AA
A      50      40
B      70      60
C      25      75

In a previous post we described another way.

You can also directly assign the table using the tabel.read() as shown:

You could directly enter the text as shown:
--------------------
<- br="" header="TRUE," read.table="" text="<br>+ Col1   Col2   Col3<br>+ A      50     40<br>+ B      70     60<br>+ C      25     75<br>+ ">
--------------------
Note that while typing the text of your data, you need to put in the white spaces yourself. You cannot just copy the table shown earlier (Table with three columns) and paste it. The R Editor takes away the white spaces.
<- br="" header="TRUE," read.table="" text="<br>+ Col1   Col2   Col3<br>+ A      50     40<br>+ B      70     60<br>+ C      25     75<br>+ ">

No comments: