Theoden
Theoden

Reputation: 297

Error installing a R package

I'm trying to follow the steps in:

https://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf

for installing a R package. All goes smoothly, until the part that I go to shell and run:

"R CMD INSTALL -l /path/to/library linmod"

Then I keep receiving the error:

"error reading file '~/linmod/DESCRIPTION"

the file is there, when I gedit the same address the file opens. When I test the following line in shell:

R CMD check ./linmod linmod"

I receive the following error:

 Error : file **'~/linmod/DESCRIPTION' is not in valid DCF format 
 EXISTS but not correct format****

I think the problem should be with the description file. however I'm basically copy pasting what is said in the paper.

The following is the content of my DESCRIPTION file:

Package: linmod
Title: Linear Regression
Version: 1.0
Date: 2008-05-13
Author: Friedrich Leisch
Maintainer: Friedrich Leisch <[email protected]>
Description: This is a demo package for the tutorial "Creating R
Packages" to Compstat 2008 in Porto.
Suggests: MASS
License: GPL-2

Where am I making a mistake?

Cheers

Upvotes: 3

Views: 1287

Answers (2)

LMc
LMc

Reputation: 18742

I had this issue too using renv and this GitHub issue did not help. The error prints the location of the DESCRIPTION file. Using that location I did:

desc::desc_reformat_fields('/path/to/DESCRIPTION')

Upvotes: 0

Lev Kuznetsov
Lev Kuznetsov

Reputation: 3728

Put 4 spaces in front of the second line for "Description"

If you need multiple lines for a field you need to indent

Upvotes: 7

Related Questions