0

I am trying to run this code in which I need to get subset of my data set but whenever I try running the code I get the error:

Error in subset.default(., select = c("Fluconazole (16 ug/ml)", "Fluconazole (32 ug/ml)",  : 
  argument "subset" is missing, with no default

This is the code I run

df.fluco.hmf <- 'Phenotyping.All.scaled2.txt' %>% 
  subset(select = c( 'Fluconazole (16 ug/ml)', 
                     'Fluconazole (32 ug/ml)',
                     'Fluconazole (64 ug/ml)',
                     'HMF (31.7 mM)',
                     'HMF (39.6 mM)',
                     'HMF (47.6 mM)')) %>% 
  as.data.frame()

and then I get this with the error message:

> df.fluco.hmf <- 'Phenotyping.All.scaled2.txt' %>% 
> +   subset(select = c( 'Fluconazole (16 ug/ml)', 
> +                      'Fluconazole (32 ug/ml)',
> +                      'Fluconazole (64 ug/ml)',
> +                      'HMF (31.7 mM)',
> +                      'HMF (39.6 mM)',
> +                      'HMF (47.6 mM)')) %>% 
> +   as.data.frame()
> 
> Error in subset.default(., select = c("Fluconazole (16 ug/ml)",
> "Fluconazole (32 ug/ml)",  :    argument "subset" is missing, with no
> default
Dave2e
  • 22,192
  • 18
  • 42
  • 50
  • 1
    You are using the subset function incorrectly. It is difficult to provide additional help without a sample of "Phenotyping.All.scaled2.txt", The `%in%` function is what you might be looking for. – Dave2e Feb 06 '23 at 23:05
  • Hi I can provide you with the data but I don't know how to upload file here – Qurrat ul ain Rana Feb 06 '23 at 23:45
  • Can I email you the data file or is there any option over here where I can show you the dat. Thank You – Qurrat ul ain Rana Feb 06 '23 at 23:47
  • I am unable to do this. Can you explain it a bit. i am actually very new to R so it gets difficult to me to understand – Qurrat ul ain Rana Feb 07 '23 at 01:00
  • Maybe start here: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example. I am sure if you are even reading the data in correctly to start. If necessary take a screen shot a post the data that way to start. You can always delete the question later. – Dave2e Feb 07 '23 at 03:58
  • You are piping the string "Phenotyping.All.scaled2.txt" into subset function not a data object – asaei Feb 07 '23 at 04:25

0 Answers0