Hi, you should post a reproducible example if you want to have an answer.

This error is generated when you try to copy an object in another of the wrong size.

> a <- data.frame(A=1:2)
> dimnames(a)
[[1]]
[1] "1" "2"

[[2]]
[1] "A"

> dn <- list(c("3", "4"), c("B", "D"))
> dimnames(a) <- dn
Erreur dans `dimnames<-.data.frame`(`*tmp*`, value = list(c("3", "4"), c("B",  :
  'dimnames' incorrect pour ce tableau de données

Marc

Le 21/06/2022 à 15:09, Muhammad Zubair Chishti a écrit :
Hi, Dear Professor,
When I run a code in R, I face the following error:
Error in dimnames(x) <- dn :
   length of 'dimnames' [2] not equal to array extent

Kindly help how to handle this.

Regards
Chishti

        [[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.

__________________________________________________________
Marc Girondot, Pr

Laboratoire Ecologie, Systématique et Evolution
Equipe de Processus Ecologiques et Pressions Anthropiques
CNRS, AgroParisTech et Université Paris-Saclay, UMR 8079
Bâtiment 362
91405 Orsay Cedex, France

Tel:  +33 (0)1.69.15.72.30   Mobile: +33 (0)6.20.18.22.16
e-mail: marc.giron...@universite-paris-saclay.fr
        marc.giron...@gmail.com
Web: https://www.ese.universite-paris-saclay.fr/epc/conservation/index.html
Skype: girondot

______________________________________________
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.

Reply via email to