logo
down
shadow

R error: attempt to apply non-function , randomForest , rfImpute


R error: attempt to apply non-function , randomForest , rfImpute

By : ocnphys
Date : November 22 2020, 09:00 AM
Hope that helps na.action does not work like that, it takes a function such as na.fail or na.omit as input.
Try to use rfImpute as in documented example
code :
data(iris)
iris.na <- iris
set.seed(111)
## artificially drop some data values.
for (i in 1:4) iris.na[sample(150, sample(20)), i] <- NA
set.seed(222)
iris.imputed <- rfImpute(Species ~ ., iris.na)
set.seed(333)
iris.rf <- randomForest(Species ~ ., iris.imputed)
print(iris.rf)


Share : facebook icon twitter icon
attempt to apply non-function Error in R

attempt to apply non-function Error in R


By : totodunet
Date : March 29 2020, 07:55 AM
should help you out I see you're trying to apply non-standard argument evaluation using substitute() to allow specifying the target list component using an unquoted symbol as the second argument of foo(). Here's how to do that:
code :
foo <- function(lst,name.arg) {
    name.sym <- substitute(name.arg);
    if (typeof(name.sym) != 'symbol') stop('name must be a symbol.');
    name.str <- as.character(name.sym);
    lst[[name.str]] <- as.factor(lst[[name.str]]);
    lst;
};
lst <- list(CLICK_DT=c(as.Date('2015-07-01'),as.Date('2015-07-02')),CLICK=c(111,123));
lst;
## $CLICK_DT
## [1] "2015-07-01" "2015-07-02"
##
## $CLICK
## [1] 111 123
##
sapply(lst,class);
##  CLICK_DT     CLICK
##    "Date" "numeric"
lst <- foo(foo(lst,CLICK_DT),CLICK);
lst;
## $CLICK_DT
## [1] 2015-07-01 2015-07-02
## Levels: 2015-07-01 2015-07-02
##
## $CLICK
## [1] 111 123
## Levels: 111 123
##
sapply(lst,class);
## CLICK_DT    CLICK
## "factor" "factor"
Error in ggplotly: attempt to apply non-function

Error in ggplotly: attempt to apply non-function


By : Free car pictures
Date : March 29 2020, 07:55 AM
I hope this helps you . I would like to produce interactive ggplot graph using the function ggplotly , Use plotly_build instead. The following code works on my pc:
code :
set.seed(100)
d <- diamonds[sample(nrow(diamonds),1000),]

p <- ggplot(data = d,aes(x=carat,y=price))+
  geom_point(aes(text=paste("Clarity:",clarity)),size = 4)+
  geom_smooth(aes(color = cut,fill=cut))+facet_wrap(~cut)


gg <- plotly_build(p)
print(gg)
'lme' error R "attempt to apply non-function

'lme' error R "attempt to apply non-function


By : user3288495
Date : March 29 2020, 07:55 AM
like below fixes the issue I'm conducting lme analysis using on my dataset with the following code
code :
na.action = na.omit(Cleaned_data4t300919)
na.action=na.omit
Memory error using rfimpute from randomForest package in R

Memory error using rfimpute from randomForest package in R


By : tsargin
Date : March 29 2020, 07:55 AM
Any of those help I had the same problem using rfImpute on a MacMini with 16GB of RAM with a hyperthreaded quad core. For your everyday data analysis problems there's not much that it can't handle. The problem is that rfImpute works by generating a proximity matrix. The proximity matrix is N x N, which for your application means that rfImpute creates a background object that has 13300^2 entries. In my case it was 93000^2.
One thing that you can do is split the data up into K different segments and apply rfImpute to each slice, manually recombining afterwards:
Error:attempt to apply non-function

Error:attempt to apply non-function


By : David
Date : March 29 2020, 07:55 AM
Does that help You're missing *s in the last two terms of your expression, so R is interpreting (e.g.) 0.207 (log(DIAM93))^2 as an attempt to call a function named 0.207 ...
For example:
Related Posts Related Posts :
  • How to sort groups within sorted groups?
  • How to get randomForest model output in probability using Caret?
  • how to plot a data frame into R
  • Calculate mean of a range of rows
  • How to sum the values in a text file?
  • Looking up polygons in a shapefile that point belong in... why does it work with some shapefiles, not with others?
  • R creating a list using variable columns from df
  • Determine programmatically if a function call refers to your own function or a package's (or base R's) function?
  • Adding Special Characters to a plot in R
  • How to dynamically change R .libPaths() based on hostname?
  • Print arguments of a function in R
  • Creating Variables via A loop in r
  • How to randomly divide an integer into a fixed number of integers, such that the obtained tuples are uniformly distribut
  • Remove columns using column name based on levels of factors
  • What units are the 'width = ' in geom_bar(aes = ) and position_dodge(width = ) rendered in?
  • Assigning Dates to Fiscal Year
  • conditional removal from data frame
  • Getting variables out of a function in R
  • Bar colors in ggplot2 geom_bar not applied correctly (R)
  • Create a vector in a dataframe based on matching a second vector to a row name in another object
  • Convert julian day to mm/dd and add year from another column in dataframe in r
  • Change SMOTE parameters inside CARET k-fold cross-validation classification
  • rollapply classes each segment the same
  • rename the header of the spliting group in r
  • Summary stats by factor level for multiple variables
  • Processing Rmarkdown inside chunks
  • R: how to join the duplicate rows in one dataframe
  • Creating a unified time-series, with dates coming from different (natural) languages
  • assign multiple color to each vertex in igraph
  • How do I add shading and color to the confidence intervals in ggplot 2 generated Kaplan-Meier plot?
  • How to generate spatial points with a pattern
  • ggplot2 + stat_contour variable binwidth
  • Add fake data to a data frame based on variable condition
  • Utilizing a character vector inside a function
  • match fundction with data frames that are differently constructed
  • Overlaying plots with a horizontal date in R
  • lapply'ing a for loop returns NULL
  • Dynamically add UI elements and gather their input in a dataframe in shiny
  • All the possible outcomes
  • How to Use corrplot with method="number" and Drop Leading Zero?
  • cbind converting factor to numeric
  • create names of loop when iterating data frame
  • R reading multiple raster files gives error in for loop
  • Debugging into and changing R-functions in packages
  • Categorical variables in R - which one does R pick as reference?
  • Create new data frame based on values from another data frame
  • Subplots using Plotly in R (bug fixed)
  • WinBUGS error 'expected key word END' caused by wrong exponential code (not length of data)
  • Predict with gls
  • R list to wide (sparse) data frame
  • Installing ZeligMultilevel. Error : object ‘describe’ is not exported by 'namespace:Zelig'
  • How to use a variable created in a function in your console
  • Dynamic grid plots in shiny R
  • Display unicode in R
  • value of NULL after inserting value
  • Model multiple imputation with interaction terms
  • Dynamically Splitting and naming the dataframe
  • Cross-correlation of 5 time series (distance) and interpretation
  • Grouping columns based on pairwise equality
  • Checking if multiple variables are all the same value in R
  • shadow
    Privacy Policy - Terms - Contact Us © animezone.co