The dataset (xl file) is a simple matrix containing expression values.
Some columns are missing some data, so i wish to determine if my data first of all do miss any data, so i can remove the columns afterwards.
For some reason it gives me a evalutaion error eventhough it loads the files fine..
Have anyone encountered a simular problem to mine?
# Load libraries
> # ------------------------------------------------------------------------------
> library('tidyverse')
> library('readxl')
>
> # Load data
> # ------------------------------------------------------------------------------
> f = 'C:/Users/Torsten/Desktop/Bachelor/data/_raw/data_file.xlsx'
> all_markers = read_excel(path = f, col_names = FALSE, sheet = 'all markers')
New names:
* `` -> `..1`
* `` -> `..2`
* `` -> `..3`
* `` -> `..4`
* `` -> `..5`
* ... and 83 more
> q_pcr = read_excel(path = f, col_names = FALSE, sheet = 'Q-PCR', skip = 1)
New names:
* `` -> `..1`
* `` -> `..2`
* `` -> `..3`
* `` -> `..4`
* `` -> `..5`
* ... and 28 more
>
> # Wrangle data
> # ------------------------------------------------------------------------------
>
> # Check missingness in variables
> all_markers %>% summarise_all(function(x){sum(is.na(x))}) %>%
+ select_if(function(x){ifelse(x>0,TRUE,FALSE)}) %>% print
Error in summarise_impl(.data, dots) :
Evaluation error: ..1 used in an incorrect context, no ... to look in.
If you're reading this into R using readxl::read_excel(), it will by default try to convert your object into a data frame (more specifically a tibble — you can tell what the return object will be by looking at the value in a function reference).
So, what's happening is that readxl is attempting name repair, and giving your columns names, rather than keeping it as a matrix:
You can read your sheet in from a csv and convert it to a matrix, or read it in as an Excel file and do the same. See this thread on Stack Overflow:
If you need further assistance, could you please turn this into a self-contained reprex (short for reproducible example)? It will help us help you if we can be sure we're all working with/looking at the same stuff.
If you run into problems with access to your clipboard, you can specify an outfile for the reprex, and then copy and paste the contents into the forum.