Search results

  1. gianmarco

    Submission of package to CRAN: problem grasping an Error

    Hello, I have submitted an R package to CRAN; the package is quite small, as it features just one function and three toy datasets. Before submitting to CRAN for evaluation, I have run a check within RStudio (hitting the 'check' button), and fortunately I got no error nor warnings nor notes. I...
  2. gianmarco

    Function out of my package only works after being copied/pasted...Why?

    Hello, as per title, I am trying to wrap my head around the issue I am experiencing. I am working on a function out of my 'GmAMisc' package; the function is part of a new version which is currently under construction. I am testing the new version, and I have hit 'install/reload', and all is...
  3. gianmarco

    inverting color palete used in a plot in R base

    Hello, I am trying to invert the color palette used when plotting a RasterLayer. See the attached example that can be reproduced with the code below: require(gdistance) r <- raster(system.file("external/maungawhau.grd", package="gdistance")) plot(r) The output is an image representing the...
  4. gianmarco

    peeling the onion: plotting only the inner 95% of 1000 cumulative frequency curves

    Hello, I am playing around with the function below, which (using the dataset appended further below) produces the attached plot. The functions requires the rgeos and spatstat packages. I put some comments to the code to explain what it is actually going on. To get the plot use: advNNa(springs)...
  5. gianmarco

    testing the association between points and any of the points belonging to another set of point: am I approaching it correctly?

    Hello, I am trying to put togheter an R function to test if points in a given area tend to occur closer to any point belonging to another set of point, or if they are distributed irrepsective of the distance from the latter. I would like to have some feedback on the method I applied, especially...
  6. gianmarco

    function trows an error at first, but runs smoothly after being copy/pasted

    I am building a new version of a package of mine, and I came across a strange behavior of a function. This poped up after I made some change to the code. If I install the package (using, as usual, library(GmAMisc)) and run a function, an error is returned: If I visualize the code, copy and...
  7. gianmarco

    making R computing large factorials

    I am writing a function in R to test whether a set of points falls inside a set of polygons more often than would be expected by chance. The calculation of p value entails using factorials: p.x <-...
  8. gianmarco

    issue in installing my own R package (possible problem with one of its dependencies)

    Hello, I have just found out that I cannot install my R package, which sits on GiHub. library(devtools) install_github("gianmarcoalberti/CAinterprTools@v0.17") When I try to install it, at first it seems that all is ok, and the various dependencies are loaded; then the procedure gets stuck and...
  9. gianmarco

    R package creating: function does not show up listed in the package table of content

    I am creating an R package in R studio using 'devtools' and 'roxygen2' as I happened to do in the past. It features 13 functions and 4 datasets. I have a problem with the documentation for one of the functions. If I type ?modelvalid, I get the help document in the RStudio help panel; all seems...
  10. gianmarco

    reshaping dataframe to matrix

    Hello, I am admittedly very dumb when it comes at reshaping data in R. So, I would appreciate to have some suggestion on what follows. I got the appended dataset with three columns: the first 2 contains codes for sites, the last column is the distance (in meters) between each pairs of sites...
  11. gianmarco

    dataframe: proportion of the occurrence of a given ordering

    Hello! Suppose I have a dataframe as the one below: Geology Biochemistry Chemistry Zoology Physics Engineering 1 6 1 2 5 4 3 2 3 4 6 5 1 2 3 6 2 3 4 5...
  12. gianmarco

    regular t-test VS Welch's t: white paper

    Hi, I came accross this interesting white paper. Here is the link. It deals with the topic of the assumptions of traditional t-test and of its comparison with the Welch's t. The pros and cons of each are evaluated. I found it in the site of Minitab program. Nonetheless, I think it can prove...