0

This is my first attempt at posting an issue and as a disclaimer I'm a complete 'R' beginner, so I'm apologizing in advance for any mistakes I'm making here.

I have a script I'm modifying to run on my computer (I didn't write it myself, it came as a supplement from an article) and I've run into a few problems, the first seems to be an error summarise_each() is deprecated. Here is my code, followed by the error:

library(dplyr)

scales<-plotMultiScale1(all_tracks, radius, xmax = max(radius), Resti = 1.9)

Error:

summarise_each() is deprecated.
Use summarise_all(), summarise_at() or summarise_if() instead.
To map funs over a selection of variables, use summarise_at()
Error in combine_vars(vars, ind_list) : Position must be between 0 and n

Here is an example of "all_tracks" as printed out in the console:

364 12.5102888 0.408184999 0.22795696 -0.1802280388 223.583333 12.5102888 0.408184999 0.22040897 -1.877760e-01
365 12.5102888 0.408184999 0.22795696 -0.1802280388 223.583333 12.5102888 0.408184999 0.22040897 -1.877760e-01
366 12.5102888 0.408184999 0.22795696 -0.1802280388 223.583333 12.5102888 0.408184999 0.22040897 -1.877760e-01
[ reached getOption("max.print") -- omitted 3185 rows ]

And this is "radius" printed out:

[[2]]
[1] 0.001 0.010 0.050 0.100 0.200 0.300 0.400 0.500 0.600 0.700 0.800 0.900 1.000 1.100 1.200 1.300 1.400 1.500 1.600 1.700 1.800 1.900 2.000 2.100 2.200 2.300 2.400 2.500 2.600 2.700
[31] 2.800 2.900 3.000 3.100 3.200 3.300 3.400 3.500 3.600 3.700 3.800 3.900 4.000 4.100 4.200 4.300 4.400 4.500 4.600 4.700 4.800 4.900 5.000

I also get this message after running

>library(dplyr):

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

filter, lag
The following objects are masked from ‘package:base’:

intersect, setdiff, setequal, union

I hope that's enough information to go by, any assistance is greatly appreciated.

Marius
  • 58,213
  • 16
  • 107
  • 105
  • 1
    FYI: formatting of the question is minor, but you can make it easier to read by using backticks only inline; code blocks can be indented by highlighting and pressing `Ctrl-k`. – r2evans Jan 17 '18 at 23:49
  • 1
    If `plotMultiScale1` is written by someone else, then you need to either figure out how to edit it and fix it yourself, or hope that the original author writes an updated version. I don't think we can help you if we don't have access to the code of `plotMultiScale1`. – Marius Jan 17 '18 at 23:50
  • A deprecation is not an error, it is (effectively) a warning that the function will be going away at some point in the planned future. The error you received is unrelated (I believe). As for the rest of your question, it's rather difficult to see `all_tracks` in its current form, incl not having headers. It is considerably easier to help when it is in an easily-consumable format. Some techniques are listed at https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and https://stackoverflow.com/help/mcve. – r2evans Jan 17 '18 at 23:51
  • Your last comment (about the `masked` messages) are merely informational, though they should be on the order of "warnings" since they can (if ignored) end up with odd behavior. What this tells you is that if you normally rely on either of `filter`,`lag` from base R (`stats` package) and just recently loaded `dplyr`, your code may no longer work as desired, since those names are now pointing to `dplyr::filter`, etc. You can suppress these messages, but I generally advise against it unless/until you are much more comfortable with this type of effect. – r2evans Jan 17 '18 at 23:53
  • I've gotten in touch with the creator of the script so hopefully that helps. Here is a bit more background script. Perhaps my problem is that my files aren’t saving properly for some reason and that’s the problem? – Orla Osborne Jan 19 '18 at 00:03
  • `dyn.load("RST_residenceRadii.dll") source("RST_functions_all.R")MoveResid<-list(all_tracks, radius, threshold, time_units, bandIDs) saveRDS(MoveResid,file = ("GHAL_23059_allscales.rda")) MoveResid<-readRDS("GHAL_23059_allscales.rda") all_tracks<-MoveResid[[1]]; radius<-MoveResid[[2]]; threshold<-MoveResid[[3]] time_units<-MoveResid[[4]]; bandIDs<-MoveResid[[5]] rm(MoveResid) library(dplyr) pdf("GHAL_23059_MultiScale.pdf") scales<-plotMultiScale1(all_tracks, radius, xmax = max(radius), Resti = 1.9) ` – Orla Osborne Jan 19 '18 at 00:12

0 Answers0