score:0
The error comes because you are applying max
on a dataframe which has mixed datatype (numeric, characters etc). The same error can be reproduced when you apply max
on iris
.
max(iris)
Error in FUN(X[[i]], ...) : only defined on a data frame with all numeric variables
I think you should apply log2
and max
function on one column in the dataframe. For example, if the column name is called col
you can do.
result <- lapply(raw, function(x) {
if(max(x$col) > 100)
x$col <- log2(x$col+1)
x
})
Source: stackoverflow.com
Related Query
- Error in FUN(X[[i]], ...) : only defined on a data frame with all numeric variables
- Trying to understand R error: Error in FUN(X[[i]], ...) : only defined on a data frame with all numeric variables
- How to fix ‘Error in FUN(X[[i]], ...) : only defined on a data frame with all numeric variables”
- Error: only defined on a data frame with all numeric variables with ddply on large dataset
- Error Standardising variables in R : 'only defined on a data frame with all numeric variables'
- How can I replace all the spaces between words with point in a data frame in r?
- How to see all rows of a data frame in a Jupyter notebook with an R kernel?
- How can I rename all columns of a data frame based on another data frame in R?
- How can I add a data frame as vertex attributes with matching ids in igraph?
- How can I create a histogram for all variables in a data set with minimal effort in R?
- How can I use variable names to refer to data frame columns with ddply?
- When I try to melt my data frame with mixed data types, I get NAs. How can I best resolve this?
- R - How can I generate difference of all combinations of columns in a data frame
- How can a data frame be transformed into a string with a csv format on R?
- Remove all columns or rows with only zeros out of a data frame
- How to split a data frame column with no defined delimiter
- Exporting R data frame to CSV - How can I quote all columns including numeric ones?
- How can I convert an R data frame with a single column into a corpus for tm such that each row is taken as a document?
- How can I select text from a row and column of a data frame without returning all Levels in R?
- Can eval be called within a data frame with variables defined in that data frame?
- In R, How do I filter a data frame to only include rows with >=2 non-NA values?
- How to create summary data frame with all possibilities in R
- How can I list only the data frame objects in R?
- How can I cast a data frame to a stars object with a time dimension?
- How can I normalize column values in a data frame for all rows that share the same ID given in another column?
- How can I add columns to a data frame with a value determined by values in other columns?
- How can I add a column with the mutate function from dplyr in this data frame to calculate the difference in weight compared to day 0?
- how can I make a data frame from a list with different row size?
- How to create empty data frame with column names specified in R?
- How to plot all the columns of a data frame in R
More Query from same tag
- R: independence test: access the p-value
- How to export the definition of an R object to plain text so that others can recreate it?
- How to format DT background *per row*?
- Odds ratio and confidence intervals from glmer output
- Encounter "Error: $ operator is invalid for atomic vectors" when using ggsave
- Assigning group ID with ddply
- Trying to make movie of 3D PCA plot (rgl) using movie3d
- Installing R kernel for Ipython on Windows
- Override DT default selection color when using bslib
- R: Loops, Dplyr and lubridate, how to combine them
- Using a loop to create multiple data frames in R
- When a certain value in one column, a new value in a new column
- loop for ggplot2 formula in r
- Writing dplyr function to pass to group_map
- heatmap2 : Error in axis(1, at = xv, labels = lv) : no locations are finite
- Error creating R data.table with date-time POSIXlt
- Time difference in years with lubridate?
- ggmap and plot shows different zone on map
- process logger files in R
- Melt and cast data table using pattern
- Read `data.table` with row filtering rather than read+subset
- Can you arrange a Flexdashboard by rows and columns?
- How do I avoid time leakage in my KNN model?
- addStyle function in openxlsx does not fill cells in excel spreadsheet with the right color
- Why expression after return's parenthesis is checked for lexical correctness, but is not evaluated?
- write function in R
- finding associations in dataset with list of string data in each cell in R
- Is there a way to bold part of a character string being passed to add_header_lines() when using the flextable package for R
- How to apply subplot to a list of plots with secondary y axis
- ggplot combining two plots from different data.frames