Re: [R] testing my package : unstated dependency to self in package tests
That worked. Thanks. From: Michael Dewey Sent: Sunday, February 16, 2020 5:54 PM To: Servet Ahmet Çizmeli ; r-help@r-project.org Subject: Re: [R] testing my package : unstated dependency to self in package tests When something similar happened to me I found it went away when I added Suggests: to the DESCRIPTION file. Whether this will work for you I have no idea. Michael On 16/02/2020 11:03, Servet Ahmet Çizmeli wrote: > I am updating my CRAN package geoSpectral. I get the following Warning during > R CMD check : > > ... > * checking for unstated dependencies in �tests� ... WARNING > 'library' or 'require' call not declared from: �geoSpectral� > > > > All the .R files I have under the testhat directory begin by : > library(geoSpectral) > library(testthat) > > and there I call package functions directly (without the prefix geoSpectal:: > ) > See > https://github.com/cran/geoSpectral/blob/master/tests/testthat/Spectra_tests.R > > Searching the web, I found examples where the same Warning has been issued > for some other packages. But in my case the package in question is my own > package I am testing > > Confused and at loss. Anyone with ideas? > regards > Servet > >[[alternative HTML version deleted]] > > > > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Michael http://www.dewey.myzen.co.uk/home.html [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] testing my package : unstated dependency to self in package tests
I am updating my CRAN package geoSpectral. I get the following Warning during R CMD check : ... * checking for unstated dependencies in �tests� ... WARNING 'library' or 'require' call not declared from: �geoSpectral� All the .R files I have under the testhat directory begin by : library(geoSpectral) library(testthat) and there I call package functions directly (without the prefix geoSpectal:: ) See https://github.com/cran/geoSpectral/blob/master/tests/testthat/Spectra_tests.R Searching the web, I found examples where the same Warning has been issued for some other packages. But in my case the package in question is my own package I am testing Confused and at loss. Anyone with ideas? regards Servet [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] CRAN package submission failed on solaris : timezone problem
Hi everyone I just submitted my new package to CRAN. All checks passed on all platforms, except one in solaris : as(df2, "Spectra") Error: tz1.set == tz2.set is not TRUE More details on : https://cran.r-project.org/web/checks/check_results_geoSpectral.html In this package I defined an S4 class named "Spectra" that provides a slot with xts object and another slot with a POSIXct object. Example of the setAs method fails while I coerce a data.frame to Spectra. I tried to replicate the problem on my ubuntu-windows-mac machines and no luck. I then created a solaris virtual machine and installed everything, I still cannot replicate the error. All checks pass on the VM too. Searching this list gave nothing. When I google the error message "Error: tz1.set == tz2.set is not TRUE", my package name comes first... which leads me to think that not that many people already had a similar problem. I also changed the timezone of the solaris VM to an arbitrary timezone. No luck. I am at loss. I can't replicate the problem that occurred in CRAN's solaris servers. Can you please help me? regards Servet [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] UUIDgenerate() withn a s4 class produces the same uuid at each instance
Hello When I create a new instance of an S4 class in R, I would like the newly created object to have a unique id field. I try to achieve it through UUIDgenerate() from the uuid package. The problem is that I obtain the same UUID at every new object instance : library(uuid) setClass("C", representation=representation( id = "character" ), prototype = prototype( id = UUIDgenerate(use.time = TRUE)) ) new("C") An object of class "C" Slot "id": [1] "1e07d7c2-2d71-11e6-b5e1-e1f59d8ccf09" new("C") An object of class "C" Slot "id": [1] "1e07d7c2-2d71-11e6-b5e1-e1f59d8ccf09" new("C") An object of class "C" Slot "id": [1] "1e07d7c2-2d71-11e6-b5e1-e1f59d8ccf09" Calling UUIDgenerate() successively at the R command line produces different UUIDS each time. Where do I go wrong? Thanks Servet [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] stupid regexp question
Both methods solve my problem. Thanks a lot to Gabor and David! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] stupid regexp question
Hello, I have a stupid regexp question. I have a large data frame of strings. I would like to convert all occurences of : "W.m^{-2}" to "W/m2" I make the following test : gsub(glob2rx("W.m^{-2}"), "W/m2", "W.m^{-2}") but it does not seem to work. I don't know how to do it otherwise as I could never learn how to deal with the special characters (like .^{}) in regexps. Thanks from advance for your kindly help servet __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] plotting with varying dot sizes
I think I located the problem. the data frame associated with my spatial object (Insitu_sp) contains some NAs. And in this case, the function plot does not like NAs. It simply behaved strangely. The code below did the trick : idx = is.na(Insitu[,"SPM"]) ptsize = 0.35*(sqrt(Insitu[!idx,"SPM"])+1) plot(Insitu_sp[!idx,"SPM"],col="red",pch=19,cex=ptsize) Does the symbols function supports spatial (sp) objects? I could not manage to make it work with my sp data. Quoting Greg Snow : > The symbols function may work better than plot for this situation. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] plotting with varying dot sizes
Dear all, I am trying to plot on a spatial map the punctual measurements of the data located in the file (https://opengeo.metu.edu.tr/test.csv). I'd like to have the dots in some way proportional to the magnitudes of the measurements. I have difficulties with the code given below: The dot sizes do not vary not proportionally when varying the coefficient ("0.725"). It either plots the dots extremely big or extremely small. Successively running the plot command from the command line gives each time different results in an unpredictably random way. Is this a bug or am I missing something? Servet Running R version 2.8.1 (2008-12-22) on Ubuntu 9.10. ** library(sp) Insitu = read.table("test.csv", skip=3,sep=",") Header = read.table("test.csv", skip=1,sep=",",nrows=1) names(Insitu)= as.character(as.matrix(Header)) CRS_4326 = CRS("+init=epsg:4326") Insitu_sp <- SpatialPointsDataFrame(cbind(Insitu[,"Boylam"],Insitu[,"Enlem"]), data=Insitu, proj4string=CRS_4326) plot(Insitu_sp[,"SPM"],col="black",pch=19,cex=0.725*sqrt(Insitu["SPM"])) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.