Error In Evalexpr Envir Enclos Could Not Find Function
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the ggproto workings and policies of this site About Us Learn more about
Stat_ellipse Ggplot2
Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions directlabels Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. error in eval(expr envir enclos) Join them; it only takes a minute: Sign up wrote function in R, receiving error “Error in eval(expr, envir, enclos) : …” up vote 0 down vote favorite writing code for homework. The code goes in fine, but when I try the function, I receive this #'ed error (which I do not understand). The code is supposed to take a dataframe of coordinates, keep the coords, and add columns denoting which hemisphere the coordinates is part of. So the question is how do I change the function/code to get rid of the error? Also, the code uses packages sp and foreach. Here's the dataframe input and my errored output: set.seed(10) n <- 10 df <- data.frame(xpos=runif(n,0,360),ypos=runif(n,-90,90)) df outHemisphere <- hemisphereSummary(df=df) outHemisphere # Error in eval(expr, envir, enclos) : argument is missing, with no default Here's what the output is supposed to be (after the set seed and df are in workspace): outHemisphere <- hemisphereSummary(df=df) outHemisphere # coordinates EWhemisphere NShemisphere #1 (182.692, 27.298) W N #2 (110.437, 12.1928) E N #3 (153.687, -69.5684) E S #4 (249.517, 17.2666) W N #5 (30.6489, -25.551) E S #6 (81.1572, -12.8143) E S #7 (98.831, -80.6574) E S #8 (98.0298, -42.448) E S #9 (221.699, -18.2177) W S #10 (154.682, 60.5041) E N Here's my code/functions for the assignment, which inputs without errors: hemisphereSummary <- function(df, projargs="+proj=longlat +datum=WGS84") { # install.packages("foreach") # install.packages("sp") library("foreach") library("sp") if(class(df)!="data.frame") s
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack http://stackoverflow.com/questions/19415774/wrote-function-in-r-receiving-error-error-in-evalexpr-envir-enclos Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error in eval(expr, envir, enclos) : could not find function “eval” up vote 3 down vote favorite I am working on the Kaggle Digit Recognizer problem.when I tried http://stackoverflow.com/questions/35462240/error-in-evalexpr-envir-enclos-could-not-find-function-eval the given code I got the error. Error in eval(expr, envir, enclos) : could not find function "eval" library(ggplot2) library(proto) library(readr) train <- data.frame(read_csv("../input/train.csv")) labels <- train[,1] features <- train[,-1] rowsToPlot <- sample(1:nrow(train), 49) rowToMatrix <- function(row) { intensity <- as.numeric(row)/max(as.numeric(row)) return(t(matrix((rgb(intensity, intensity, intensity)), 28, 28))) } geom_digit <- function (digits, labels) GeomRasterDigit$new(geom_params = list(digits=digits),stat = "identity", position = "identity", data = NULL, inherit.aes = TRUE) I am getting the error when I run the following segment. GeomRasterDigit <- proto(ggplot2:::GeomRaster, expr={ draw_groups <- function(., data, scales, coordinates, digits, ...) { bounds <- coord_transform(coordinates, data.frame(x = c(-Inf, Inf), y = c( - Inf, Inf)), scales) x_rng <- range(bounds$x, na.rm = TRUE) y_rng <- range(bounds$y, na.rm = TRUE) rasterGrob(as.raster(rowToMatrix(digits[data$rows,])), x_rng[1], y_rng[1], diff(x_rng), diff(y_rng),default.units = "native", just =c("left","bottom"), interpolate = FALSE) } }) Link for the complete code : https://www.kaggle.com/benhamner/digit-recognizer/example-handwritten-digits/code r ggplot2 share|improve this question edited Feb 21 at 20:53 kdauria 2,88211132 asked Feb 17 a
Sign in Pricing Blog Support Search GitHub This repository Watch 211 Star 1,450 Fork 574 hadley/dplyr Code Issues 168 Pull requests 15 Projects 0 Pulse https://github.com/hadley/dplyr/issues/828 Graphs New issue function distinct no longer available #828 Closed gtanalytics opened this Issue Dec 3, 2014 · 5 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 3 participants gtanalytics commented Dec 3, 2014 I have a dataframe like this sessionId nb_recherches session_duration session_time nb_clics 1: 1711217595109891860186330562560 52 31272665 1.405582e+12 24 error in 2: 1711217595109891860186330562560 37 14602898 1.404196e+12 14 3: 1711217595109891860186330562560 36 15882591 1.404214e+12 8 4: 1711217595109891860186330562560 33 12359598 1.406012e+12 20 5: 1711217595109891860186330562560 31 28656216 1.407742e+12 13 6: 1711217595109891860186330562560 19 1766859 1.405847e+12 3 Before updating dplyr package, this function to select distinct element from dataframe worked well df_work = data_session %>% distinct(sessionId) But now, It seems that there is no distinct function anymore into error in evalexpr a dplyr package df_work = data_session %>% distinct(sessionId) Error in eval(expr, envir, enclos) : could not find function "distinct" Any issue about this? Thanks Owner hadley commented Dec 5, 2014 Works for me. Maybe you accidentally created an object called distinct? hadley closed this Dec 5, 2014 gtanalytics commented Dec 5, 2014 Thanks for your reply, I listed all the functions available in the package in the new R session and I seems that there is no distinctfunction. May be I missed something > lsf.str("package:dplyr") %.% : function (lhs, rhs) %>% : function (lhs, rhs) anti_join : function (x, y, by = NULL, copy = FALSE, ...) arrange : function (.data, ...) as.tbl : function (x, ...) as.tbl_cube : function (x, ...) bench_tbls : function (tbls, op, ..., times = 10) build_sql : function (..., .env = parent.frame(), con = NULL) chain : function (..., env = parent.frame()) chain_q : function (calls, env = parent.frame()) changes : function (x, y) collapse : function (x, ...) collect : function (x, ...) compare_tbls : function (tbls, op, ref = NULL, compare = eq