Error in colnames

29 views
Skip to first unread message

jose lacayo

unread,
May 20, 2020, 9:41:01 PM5/20/20
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hello every body!! 

First I would like to say thank you for the creation on this amazing project becuase it will be a great opportunity to learn  computer visión using this amazing package. I think this is great for R users , becuase there are not  to many options of computer visión in R. 

I would like to see if I can get some help. I alreday have installed the FIELDimageR package sucessfully,  that is  why I started to use the examples provided in the website, but Im getting the next errors:

In the first example with the EX1_RGB.tif file when I run the next line I got this error:

# For heavy images (large, high resolution, etc.) please use: fast.plot=T
EX1.Crop <- fieldCrop(mosaic = EX1) 

Error in `colnames<-`(`*tmp*`, value = c("x", "y")) : attempt to set 'colnames' on an object with less than two dimensions


So then I tried another example from the website to see if I Will get a similar behaviour:

when I run the second example with the EX_StandCount.tif file I got the same error but in another line:

# Building the plot shapefile (ncols = 1 and nrows = 7)
EX.SC.Shape<-fieldShape(mosaic = EX.SC.RemSoil,ncols = 1, nrows = 7) Error in `colnames<-`(`*tmp*`, value = c("x", "y")) : attempt to set 'colnames' on an object with less than two dimensions

So, can maybe someone tell me how can I solve this problema or what Im doing wrong please

best regards

José Carlos 





fmatias

unread,
May 22, 2020, 12:29:40 PM5/22/20
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi Jose,

Thanks for asking.

This error is new to me. I need more information: which version of R and FIELDimageR are you using?

Also, could you send your script? 

Best
Filipe

jose lacayo

unread,
May 24, 2020, 12:28:32 AM5/24/20
to FIELD...@googlegroups.com
Hi Filipe 

Thanks to provide your help. Here I show the information required 

 1-The R versión Im running is :    3.5.0     2018-04-23
 
 2- The FieldimageR versión Im running is :   0.1.9  and I run this code to install it         

     install_github("filipematias23/FIELDimageR")

CODE FOR THE EXAMPLES :

I run the examples from the main website https://github.com/OpenDroneMap/FIELDimageR#Instal

FIRST EXAMPLE from the from the 2. Selecting the targeted field 

library("sp")
library("raster")
library("rgdal")
library("scales")
library(FIELDimageR)
library(raster)


#1 THIS CODE RUNS WELL
EX1<-stack("EX1_RGB.tif")
plotRGB(
EX1, r = 1, g = 2, b = 3) #2 HERE I GOT THE ERROR IN THIS PART EX1.Crop <- fieldCrop(mosaic = EX1) # For heavy images (large, high resolution, etc.) please use: fast.plot=T
Error in `colnames<-`(`*tmp*`, value = c("x", "y")) : attempt to set 'colnames' on an object with less than two dimensions

#3 I could not  run the rest of the code 


#1 Uploading file THIS CODE RUNS WELL
EX.SC<-stack("EX_StandCount.tif")
plotRGB(
EX.SC, r = 1, g = 2, b = 3) #2 Removing the soil THIS CODE RUNS WELL
EX.SC.RemSoil<- fieldMask(mosaic = EX.SC, Red = 1, Green = 2, Blue = 3, index = "HUE") #3 Building the plot shapefile (ncols = 1 and nrows = 7) HERE I GOT THE ERROR IN THIS PART

EX.SC.Shape<-fieldShape(mosaic = EX.SC.RemSoil,ncols = 1, nrows = 7) Error in `colnames<-`(`*tmp*`, value = c("x", "y")) : attempt to set 'colnames' on an object with less than two dimensions

#4 I could not  run the rest of the code

Best regards 

José Carlos 


--
You received this message because you are subscribed to the Google Groups "FIELDimageR: A R package to analyze orthomosaic images from field trials." group.
To unsubscribe from this group and stop receiving emails from it, send an email to FIELDimageR...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/FIELDimageR/8f1f258b-4e4f-44d1-8369-88b4bc0bae77%40googlegroups.com.

fmatias

unread,
May 24, 2020, 9:39:56 AM5/24/20
to FIELDimageR: A R package to analyze orthomosaic images from field trials.

Hi Jose,

 

Let's try the following steps:

 

1 - Upload R version: https://brieger.esalq.usp.br/CRAN/

2 - Upload RStudio: https://rstudio.com/products/rstudio/

3 - Install all packages bellow:

 

install.packages("sp")
install
.packages("raster")
install
.packages("rgdal")
install
.packages("scales")
install
.packages("devtools")
devtools
::install_github("filipematias23/FIELDimageR")


Let me know if it works.

Best,

Filipe Matias



jose lacayo

unread,
May 24, 2020, 7:20:30 PM5/24/20
to FIELD...@googlegroups.com
Hi Filipe 

First thank you very much for your help.

I alredy installed the versión of R and Rstudio and  Rtools. 

1-So now I have the R console versión to 4.0  for 2020-04-24

2- The Rsudio version 1.3.959

3- I reinstalled the packages list:

install.packages("sp")
install
.packages("raster")
install
.packages("rgdal")
install
.packages("scales")
install
.packages("devtools")
devtools
::install_github("filipematias23/FIELDimageR")

4-The bad news is that Im having the same problema, what other options can I try? 


Best Regards

José Carlos 

--
You received this message because you are subscribed to the Google Groups "FIELDimageR: A R package to analyze orthomosaic images from field trials." group.
To unsubscribe from this group and stop receiving emails from it, send an email to FIELDimageR...@googlegroups.com.

Danilo de Brito Garcia

unread,
May 24, 2020, 8:45:52 PM5/24/20
to FIELD...@googlegroups.com

Olá José,

Não posso ter certeza se vou ajudar, mas eu obtive o mesmo erro quando eu não tinha a instalação do FIELDImageR com sucesso. Inicialmente, eu tive um erro na instalação de um dos pacotes e não tinha visto. 

Você tem certeza que teve sucesso na instalação de todos os pacotes? Dentre todas as mensagens de instalação, podemos não perceber alguma mensagem de falha em algum dos pacotes.

Consegui instalar todos os pacotes corretamente uma vez que me certifiquei da desinstalação anterior, removendo a pasta do pacote, não somente usando a função “remove.packages(pkgs, lib)“.


--
Danilo

jose lacayo

unread,
May 24, 2020, 9:02:51 PM5/24/20
to FIELD...@googlegroups.com
Hi Danilo 

Thank you very much for your help I really apreciate it. It seems like a very good option because I m  just using  the examples from the website, so is not to normal it fails with these examples, but with your theory seems like it can be the  reasonable problem. 

I m goint to try this way and will let you know how is it going.


Best Regards for everybody 

José Carlos 




fmatias

unread,
May 25, 2020, 9:07:15 AM5/25/20
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Que legal, obrigado por participar da discussão Danilo.

Deixe-nos saber se conseguiu instalar Jose.

Obrigado a todos..!!!
Filipe Matias

jose lacayo

unread,
May 25, 2020, 10:23:21 PM5/25/20
to FIELD...@googlegroups.com
Hi Filipe and Danilo 

I tried to solve the problem removing and installing the package using the next two ways, but any of them could not solve the problem:


#1 First option 

devtools::install_github("filipematias23/FIELDimageR")

2# second option 

unzip("FIELDimageR-master.zip")
file.rename("FIELDimageR-master", "FIELDimageR")
shell("R CMD build FIELDimageR") # or system("R CMD build FIELDimageR")
install.packages("FIELDimageR_0.1.9.tar.gz",  type="source")

#3 The good news is that I found something interesting.  I installed this package in other computer and I got the same issue but I saw that even when I installed the package with the to ways above I noticed in the second computer the dependencies were not installed at all (Now i found I m havin the same problem in the first computer), so I had to installed them manually. the specific dependencies were:

1-Rlang

2-htmltools

3-digest

4-Rcpp

4# The bad new is that even when I installed them manually I still having the issue, but now Im pretty sure that  Danilo was right that I m having an installation problem. So I suspect some others dependencies are having problems to be install. I hope this information will be usefull to face the issue.

Best regards 

José Carlos 


--
You received this message because you are subscribed to the Google Groups "FIELDimageR: A R package to analyze orthomosaic images from field trials." group.
To unsubscribe from this group and stop receiving emails from it, send an email to FIELDimageR...@googlegroups.com.

fmatias

unread,
May 26, 2020, 9:54:22 AM5/26/20
to FIELDimageR: A R package to analyze orthomosaic images from field trials.

Hi Jose,

 

Thanks for sharing... I am sorry, I will be continuing looking for answers. 

If I have any idea or news, I will let you know.

 

Best,

Filipe

jose lacayo

unread,
Jun 3, 2020, 9:45:07 AM6/3/20
to FIELD...@googlegroups.com
Hi Filipe,

Thank you very much for your help!!. I hope we can solve it, because this package is amazing and  Im waiting to use its amazing features. 


Best regards 

José Carlos 

--
You received this message because you are subscribed to the Google Groups "FIELDimageR: A R package to analyze orthomosaic images from field trials." group.
To unsubscribe from this group and stop receiving emails from it, send an email to FIELDimageR...@googlegroups.com.

jose lacayo

unread,
Jul 5, 2020, 9:27:18 PM7/5/20
to FIELD...@googlegroups.com
Hi Filipe 

I have news for the problem that I was facing with the fieldcrop function and the  issue "attempt to set 'colnames' on an object with less than two dimensions"

. In summary the problem was that I was executing the examples of the FieldImagerR package in the R notebook format cause. I noticed that some functions like fieldMask for removing soil worked well, so I executed the examples in the  Rscrit and everything works very well. So basically the R notebook didn't  let me select the points to create the mask. 

Now I'm processing my own data and the functions in this package are amazing.

I really appreciate your help and support. 


I wish you best for you and your project

Best regards 

José Carlos 



--
You received this message because you are subscribed to the Google Groups "FIELDimageR: A R package to analyze orthomosaic images from field trials." group.
To unsubscribe from this group and stop receiving emails from it, send an email to FIELDimageR...@googlegroups.com.

fmatias

unread,
Jul 7, 2020, 4:05:28 PM7/7/20
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
You got this.
That is amazing, I am glad.
Thank you to let us know...!!!
All the best,
Filipe
Reply all
Reply to author
Forward
0 new messages