How to make R import, read, and convert the reading of the cross data to a data frame (see figure)

2

Good morning,

I have a table that is not in the standard R reading format, that is, it has one column variable (time) and two in line with data arranged side by side (subject and treatment). Could someone give me a light on how to get R to import, read and convert this data that is crossed to a data frame?

    
asked by anonymous 05.11.2016 / 21:53

2 answers

0

Read is not a problem, you can use read.table with the parameter skip = 2, to skip the first 2 lines, and read the data from a csv file. You can then use reshape from reshape2 to put the bank in long format.

    
06.11.2016 / 16:45
0

Dear @ WeidsonC.deSouza, could you improve your questions? Put a larger piece of the spreadsheet and better explain what you want! In relation to reading the database and importing to the R you can use the code:

library(readr)
df <- read_delim("local_do_arquivo",";", escape_double = FALSE, trim_ws = TRUE,skip = 2)
    
07.11.2016 / 00:27