{"id":32211973,"url":"https://github.com/entropyorg/p5-statistics-nicer","last_synced_at":"2025-12-12T02:39:02.034Z","repository":{"id":16269198,"uuid":"19017421","full_name":"EntropyOrg/p5-Statistics-NiceR","owner":"EntropyOrg","description":"∫ :bar_chart::star: interface to the R programming language \u003chttp://www.r-project.org/\u003e","archived":false,"fork":false,"pushed_at":"2022-01-08T05:35:01.000Z","size":141,"stargazers_count":15,"open_issues_count":21,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-22T06:57:06.275Z","etag":null,"topics":["cpan"],"latest_commit_sha":null,"homepage":"http://p3rl.org/Statistics::NiceR","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EntropyOrg.png","metadata":{"files":{"readme":"README.pod","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-22T04:46:31.000Z","updated_at":"2023-12-21T01:45:00.000Z","dependencies_parsed_at":"2022-08-04T08:45:15.577Z","dependency_job_id":null,"html_url":"https://github.com/EntropyOrg/p5-Statistics-NiceR","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/EntropyOrg/p5-Statistics-NiceR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EntropyOrg%2Fp5-Statistics-NiceR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EntropyOrg%2Fp5-Statistics-NiceR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EntropyOrg%2Fp5-Statistics-NiceR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EntropyOrg%2Fp5-Statistics-NiceR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EntropyOrg","download_url":"https://codeload.github.com/EntropyOrg/p5-Statistics-NiceR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EntropyOrg%2Fp5-Statistics-NiceR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280395519,"owners_count":26323517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpan"],"created_at":"2025-10-22T06:57:02.658Z","updated_at":"2025-10-22T06:57:07.506Z","avatar_url":"https://github.com/EntropyOrg.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"=pod\n\n=encoding UTF-8\n\n=head1 NAME\n\nStatistics::NiceR - interface to the R programming language\n\n=head1 VERSION\n\nversion 0.03\n\n=head1 SYNOPSIS\n\n    use Statistics::NiceR;\n\n    my $r = Statistics::NiceR-\u003enew();\n\n    say $r-\u003epnorm( [ 0 .. 3 ] )\n    # [0.5 0.84134475 0.97724987  0.9986501]\n\n=head1 DESCRIPTION\n\nThis module provides an interface to the R programming language for statistics\nby embedding the R interpreter using its C API. This allows direct access to\nR's functions and allows sending and receiving data efficiently.\n\n=head2 CONVERSION\n\nIn order to give the module a hassle-free interface, there is a mechanism to\nconvert Perl types[^1] to R types[^2] and vice-versa for the values sent to and\nfrom the R interpreter.\n\nCurrently, the conversion is handled by the modules under the\nL\u003cStatistics::NiceR::DataConvert\u003e namespace. It is currently undocumented how\nto extend this to more types or how to change the default behaviour, but this\nwill be addressed in future versions.\n\n[^1]: Such as strings, numbers, and arrays.\n\n[^2]: Such as integers, numerics, data frames, and matrices.\n\n=head1 METHODS\n\n=head2 new\n\n    new()\n\nCreates a new instance of a wrapper around the R interpreter.\n\nExample\n\n    use Statistics::NiceR;\n\n    my $r = Statistics::NiceR-\u003enew();\n\n=head2 eval_parse\n\n    eval_parse( Str $r_code )\n\nA convenience function that allows for evaluating arbitrary R code.\n\nThe return value is the last line of the code in C\u003c$r_code\u003e.\n\nExample:\n\n    use Statistics::NiceR;\n\n    my $r = Statistics::NiceR-\u003enew();\n    my $dataframe = $r-\u003eeval_parse( q\u003c iris[1:20,1:4] \u003e );\n\n=for comment TODO change this wording when the Statistics::NiceR::DataConvert module is\ndocumented and when changing the converter behaviour is documented for\nStatistics::NiceR\n\n=head2 CALLING R FUNCTIONS\n\nR functions can be called by using the name of the function as a method call.\nFor example, to call the L\u003cpnorm|https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Normal.html\u003e\nfunction (PDF of the normal distribution), which has the R function signature\n\n    pnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)\n\none could run\n\n    use Statistics::NiceR;\n    my $r = Statistics::NiceR-\u003enew();\n\n    say $r-\u003epnorm( 0 ) # N( μ = 0, σ² = 1) at x = 0\n    # 0.5\n\n    say $r-\u003epnorm( 5, 1, 2 ) # N( μ = 1, σ² = 2) at x = 5\n    # 0.977249868051821\n\nSince R can have identifiers that contain a period (\".\") in their name and Perl\ncan not, C\u003cStatistics::NiceR\u003e maps\n\n=over 4\n\n=item * a single underscore in the Perl function name (\"_\") to a period in the R function name (\".\")\n\n=item * two consecutive underscores in the Perl function name (\"__\") to a single underscore in the R function name (\"_\").\n\n=back\n\nSo in order to call R's C\u003cas.Date\u003e function, one could run:\n\n    use Statistics::NiceR;\n    my $r = Statistics::NiceR-\u003enew();\n\n    say $r-\u003eas_Date( \"02/27/92\", \"%m/%d/%y\" ); # one underscore\n    # [1] \"1992-02-27\"\n\nor to call R's C\u003cl10n_info\u003e function, one could run:\n\n    use Statistics::NiceR;\n    my $r = Statistics::NiceR-\u003enew();\n\n    say $r-\u003el10n__info(); # two underscores\n    # $MBCS\n    # [1] TRUE\n    #\n    # $`UTF-8`\n    # [1] TRUE\n    #\n    # $`Latin-1`\n    # [1] FALSE\n\n=for comment TODO Need to document how to call functions with named arguments.\n\n=head1 INSTALLATION\n\nOn a system with a package manager, it would be best to install the R base\npackage using the package manager.\n\n=head2 Windows\n\nFor Windows, both the L\u003cR base|http://cran.r-project.org/bin/windows/base/\u003e and\nL\u003cRtools|http://cran.r-project.org/bin/windows/Rtools/\u003e are necessary.\n\n=head1 SEE ALSO\n\n=over 4\n\n=item * L\u003cThe R Project for Statistical Computing|http://www.r-project.org/\u003e\n\n=item * Browse and download additional R packages: L\u003cThe Comprehensive R Archive Network|http://cran.r-project.org/\u003e\n\n=item * L\u003cR Tutorial: R Introduction|http://www.r-tutor.com/r-introduction\u003e\n\n=back\n\nFor developers:\n\n=over 4\n\n=item * L\u003cWriting R Extensions|http://cran.r-project.org/doc/manuals/r-release/R-exts.html\u003e\n\n=item * L\u003cAdvanced R by Hadley Wickham: R’s C interface|http://adv-r.had.co.nz/C-interface.html\u003e\n\n=back\n\n=head1 AUTHOR\n\nZakariyya Mughal \u003czmughal@cpan.org\u003e\n\n=head1 COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2014 by Zakariyya Mughal.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n\n=cut\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentropyorg%2Fp5-statistics-nicer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fentropyorg%2Fp5-statistics-nicer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentropyorg%2Fp5-statistics-nicer/lists"}