Matrix browsing

Hello everyone i have a matrix which contains 7 columns first one is time in seconds, second one time in minutes, Columns 3 to 6 describe the result obtained per test. It has 6 test for whole data, Is there a way i can select from the matriz only the data of test 3 por example? (Every test describes the obtained results of values per time)

R1

Thank you

Yes, you can do this with the aid of some packages.
Below you will find a stylized example

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(purrr)
library(magrittr)
#> 
#> Attaching package: 'magrittr'
#> The following object is masked from 'package:purrr':
#> 
#>     set_names

p <- data.frame(
  stringsAsFactors = F,
  time_min = 1:6,
  CH001 = c(0.1,-0.1,0,0.2,0.1,0.1),
  Test = c("Test1","Test1","Test1","Test2","Test2","Test2" )
)

tests <- unique(p$Test)

purrr::walk(tests,
    function (thistest)
      {
      thistestdata <- p %>%
        filter(Test == thistest)
      plot(thistestdata$time_min, thistestdata$CH001,
           main=thistest)
    })


Created on 2021-07-15 by the reprex package (v2.0.0)

Hi!

There are many approaches you can follow for this but to give you more specific examples, some sample data would be useful.

Can you please share a small part of the data set in a copy-paste friendly format?

In case you don't know how to do it, there are many options, which include:

  1. If you have stored the data set in some R object, dput function is very handy.

  2. In case the data set is in a spreadsheet, check out the datapasta package. Take a look at this link.

Thank you im gonna prove it now

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.