is it preferable to use one table for all data or store each case individually? For example, I have file with data on 3 cars, 3 boats, 3 motorcycles:
type speed  power  capacity  price
car    120    100         4     10
       160    150         5     20
       180    200         7     25
boat    60    120         8     15
        50    150         10    25
        80    340         12    45
moto   140    150         2     10
       160    200         1     30
       100    120         3     8

For manipulating with this data in R, should I use this one file, or transform it to this:
type speed  power  capacity  price
car    120    100         4     10
car    160    150         5     20
car    180    200         7     25
boat    60    120         8     15
boat    50    150         10    25
boat    80    340         12    45
moto   140    150         2     10
moto   160    200         1     30
moto   100    120         3     8  

Or better to use 3 different files?
 A: The bottom format is often called a "long format", and is often the best way to structure data for analysis because it makes everything explicit.
Both tables obviously contain the same data, but some of the type data only implicitly present in the top table. For example, we need to infer that row #2 describes a car from the total number of rows, the description ("I have file with data on 3 cars, 3 boats, 3 motorcycles"), and the parallel structure between rows #1, #4, and #7. This introduces an annoying dependency between the rows: to find the type of row $n$, you need to find the first non-empty type "above" it in the table and propagate it downwards. It also introduces the possibility for errors: if we weren't careful, we might conclude that the type information is missing for the remaining rows. Similarly, if the data were divided across three files, we'd have a similar implicit dependency on the file name
In contrast, everything is laid out explicitly in the long format. There is no need to deduce anything: if you need the type of the $n$th example, you just look at the $n$th entry of type. This layout also mirrors many of the things you're going to do with the data. For example, a regression expresses one column of the table (e.g., the price), as a combination of the remaining columns. It also allows you to extract subsets of the table, which you might do during cross validation.
The major disadvantage of the long format is that it contains more redundancy--you had to type "car" three times more often when producing the bottom table.
Most data analysis packages have functions for converting data to and from "long" format, which is often called "melting" the data. In R, you may want to look at tidyr or reshape2 packages. In python, pandas has similar functions, and stata has reshape long. You may need to write a little bit of custom code though, depending on exactly how the implicit data is structured. 
