Installing a package with modified DESCRIPTION files throws MD5 checksum error

hi, I just tried to change some codes in package "openair", so I install [openair_2.6-5.tar.gz] from the CRAN website(https://cran.r-project.org/src/contrib/openair_2.6-5.tar.gz).
After that I changed the codes and compressed it into "openair.zip" in my computer, then I use

install.packages("E:/mypath/R/library/openair.zip", 
                 repos = NULL, type = "win.binary")

to install it, I failed. The error is

Warning in install.packages :
  cannot open compressed file 'openair/DESCRIPTION', 
  probable reason 'No such file or directory'
Error in install.packages : cannot open the connection

I just feel strange becuse I do have thie file DESCRIPTION in my openair.zip. I'm wondering how can this happen.

ok.. I did something wrong. I should creat a document file called "openair" first and put all files in it, then compressed it to .zip file.
But now I received new type of error that is

files ‘R/calendarPlot.R’, ‘R/checkPrep.R’ have the wrong MD5 checksums

these two R files have been changed before. So what's the problem, I know nothing about MD5 checksums.. how to correct that?

The MD5 checksum is a mechanism that you can use to ensure a file you downloaded is identical to the file originally made available to you (by the original uploader, in this case CRAN).

If you modify a single bit of the file, the MD5 checksum will change, and this is why you get this warning.

In your case, you know that you've modified the file, so you want to find a way to remove this warning. A package does not need the MD5 checksum line in the DESCRIPTION file - this gets added by CRAN.

I suggest you delete the line containing MD5 from your DESCRIPTION file and try to install the package again.

In this case I think it would be better if you fork the github repo, make the changes you want and then you install your own forked version with devtools::install_github()

Thanks a lot, andrescrcs.
I'm not quite familiar with github, and I only used it to upload and manage my codes.
I think I will try to learn that if I can't solve this on my own computer.

many thanks, Andrie.
I don't know why my long post reply I just wrote disappeared. I can breifly summarize that the DESCRIPTION file doesnt have MD5 line, and there is indeed a file named MD5 which is compressed with all R files and DESCRIPTION file. I delete two rows about 'calendarPlot.R' and 'checkPrep.R' in MD5 file, and when I install the package, R returns

package ‘openair’ successfully unpacked and MD5 sums checked

but when I do 'library(openair)', it says

Error in library(openair) : ‘openair’ is not a valid installed package

I'm so confused now... how can I get over this?

With the github approach you can solve the problem on your own computer.
The workflow would be as follows: fork > clone > modify (in your computer) > stage > commit > push > install from GitHub.

Many thanks, Andrie.
I find DESCRIOTION doesn't have any line containing 'MD5'. Actuall, it's like this

Package: openair
Type: Package
Title: Tools for the Analysis of Air Pollution Data
Version: 2.6-5
Date: 2019-04-05
Authors@R: c(person("David", "Carslaw", role = c("aut", "cre"), email =
    "david.carslaw@york.ac.uk"), person("Karl", "Ropkins", role =
    "aut", email = "K.Ropkins@its.leeds.ac.uk"))
ByteCompile: true
Depends: R (>= 3.2.0),
Imports: grid, rlang, dplyr, purrr, tidyr, mgcv, lattice, latticeExtra,
        lubridate, cluster, RColorBrewer, mapproj, hexbin, Rcpp,
        grDevices, graphics, methods, stats, MASS, utils
Suggests: KernSmooth, maps, mapdata, quantreg
LinkingTo: Rcpp
Maintainer: David Carslaw <david.carslaw@york.ac.uk>
Description: Tools to analyse, interpret and understand air
    pollution data. Data are typically hourly time series
    and both monitoring data and dispersion model output
    can be analysed.  Many functions can also be applied to
    other data, including meteorological and traffic data.
License: GPL (>= 2)
URL: http://davidcarslaw.github.io/openair/
BugReports: https://github.com/davidcarslaw/openair/issues
LazyLoad: yes
LazyData: yes
Encoding: UTF-8
RoxygenNote: 6.1.1
NeedsCompilation: yes
Packaged: 2019-04-08 13:57:29 UTC; davidcarslaw
Author: David Carslaw [aut, cre],
  Karl Ropkins [aut]
Repository: CRAN
Date/Publication: 2019-04-08 14:30:04 UTC

and I edit it with notepad++. I'm not sure if I open the file rightfully.
Anyway, there is a file called MD5 which is compressed with all R files and DESCRIPTION. I open it and delete these following two rows

10341ed697a9dc26d4f67b5dfdf63a4e *R/calendarPlot.R
9b839caa700ff274152fd82d1fea329e *R/checkPrep.R

now when I install the package, R would not cast any warnings or errors. It gives information that

package ‘openair’ successfully unpacked and MD5 sums checked

but when I use 'library(openair)' to load this package, R returns:

Error in library(openair) : ‘openair’ is not a valid installed package

I'm so confused, what should I do then?

Hi @Cesc! Your reply got caught by an automatic filter, since it contained email addresses. I’ve released it, and it now appears above.

thank you so much!
I'll try it and let you know if it works as soon as possible

thanks very much. got it

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.