[datatable-help] Error in eval(expr, envir, enclos) : object 'BlaBla' not found

Frank Erickson FErickson at psu.edu
Thu Aug 29 16:44:53 CEST 2013


Try "BlaBla" instead of list(BlaBla)

(oops, forgot to reply to the mailing list the first time I sent this.
Sorry for the double email, Kostia.)


On Thu, Aug 29, 2013 at 9:36 AM, Kostia Kofman <kofmank at gmail.com> wrote:

> Hi,
>
> I'm new to R and data.table and having some difficulties with a certain
> function that I wrote.
>
> the function code:
>
> freq_per = function(data,byWhat,month){
>     for (i in 1:length(month)){
>         data = data.table(data)
>         data[,percent :=sum(freq),by = byWhat]
>         data[,percent := (freq/percent)*100]
>         data = data.frame(data)
>         data$percent = format(round(data$percent),nsmall = 2)
>     }
>     data
>
> }
>
> I have tried to call the function with freq_per(data,list(BlaBla),month)
> and get the error message from the topic.
>
> I have tried to create a global variable with byWhat = list(BlaBla), it
> didn't work because the object 'BlaBla' not found.
>
> I also tried to use keyby instead of by with  c(colnames(data)[1]), but
> the results that I got are not right.
>
> anybody has an idea how to overcome the problem?
>
> Thanks.
>
>
>
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20130829/aa8125a1/attachment.html>


More information about the datatable-help mailing list