Problem in ENFA: infinite or missing values

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem in ENFA: infinite or missing values

Perry Beasley-hall
Hello everyone,
I'm trying to do an ENFA using the package adehabitatHS. I'm following the example code and am creating the 'pr' file using:

pr <- slot(count.points(species, map), "data")[,1]

Where 'species' is a .csv file with two columns of latitude and longitude, and 'map' is a SpatialGridDataFrame file of 23 .asc inputs. For reference, I'm importing my .asc files using readGDAL and then using the cbind command to put them into the 'map' file.

I encounter the following warning message when trying to create 'pr':

1: In points2grid(points, tolerance, round) :
  grid has empty column/rows in dimension 1
2: In points2grid(points, tolerance, round) :
  grid has empty column/rows in dimension 2

I assumed this would be alright, but I'm getting the subsequent error when I attempt the enfa command:

enfa1 <- enfa(pc, pr, scannf = FALSE)

Error in eigen(Se) : infinite or missing values in 'x'

Some searching online has told me that this might mean not all of my rows in the 'species' .csv correspond to variables in the 'map' file, but I don't think this is the case for my dataset.

Can anyone help me with this issue? Many thanks in advance.
____

Perry Beasley-Hall
PhD Candidate
School of Life and Environmental Sciences

THE UNIVERSITY OF SYDNEY
Room 329, Edgeworth David Building A11
Sydney NSW 2006, Australia
E-mail: [hidden email]
Phone: +61 420 494 584

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Problem in ENFA: infinite or missing values

Michael Sumner-2
Can you you put together a reproducible example ( reprex)? I'm happy to
help but the set up is too onerous.

I'd recommend using raster to count points and for gridded data generally
but the advice is perhaps too abstract without an example. cellFromXY gives
the right output for a point in cell count as a grouped aggregate summary,
 but it's a module requiring to be embedded in a workflow (which means it's
super powerful, efficient and flexible) rather than a high level solution
requiring no further composition.

Cheers, Mike


On Fri, 19 May 2017, 16:51 Perry Beasley-hall <
[hidden email]> wrote:

> Hello everyone,
> I'm trying to do an ENFA using the package adehabitatHS. I'm following the
> example code and am creating the 'pr' file using:
>
> pr <- slot(count.points(species, map), "data")[,1]
>
> Where 'species' is a .csv file with two columns of latitude and longitude,
> and 'map' is a SpatialGridDataFrame file of 23 .asc inputs. For reference,
> I'm importing my .asc files using readGDAL and then using the cbind command
> to put them into the 'map' file.
>
> I encounter the following warning message when trying to create 'pr':
>
> 1: In points2grid(points, tolerance, round) :
>   grid has empty column/rows in dimension 1
> 2: In points2grid(points, tolerance, round) :
>   grid has empty column/rows in dimension 2
>
> I assumed this would be alright, but I'm getting the subsequent error when
> I attempt the enfa command:
>
> enfa1 <- enfa(pc, pr, scannf = FALSE)
>
> Error in eigen(Se) : infinite or missing values in 'x'
>
> Some searching online has told me that this might mean not all of my rows
> in the 'species' .csv correspond to variables in the 'map' file, but I
> don't think this is the case for my dataset.
>
> Can anyone help me with this issue? Many thanks in advance.
> ____
>
> Perry Beasley-Hall
> PhD Candidate
> School of Life and Environmental Sciences
>
> THE UNIVERSITY OF SYDNEY
> Room 329, Edgeworth David Building A11
> Sydney NSW 2006, Australia
> E-mail: [hidden email]
> Phone: +61 420 494 584
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Dr. Michael Sumner
Software and Database Engineer
Australian Antarctic Division
203 Channel Highway
Kingston Tasmania 7050 Australia

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Problem in ENFA: infinite or missing values

Mathieu Basille-3
In reply to this post by Perry Beasley-hall
Hey Perry,

It is not clear to me where the problem lies without more
details/explanations. As Mike said, can you come up with a reproducible
example? If you can't make it minimal, see if you can send me the data
privately, I'll try to investigate on my side.

Cheers,
Mathieu.


On 05/19/2017 02:51 AM, Perry Beasley-hall wrote:

> Hello everyone,
> I'm trying to do an ENFA using the package adehabitatHS. I'm following the example code and am creating the 'pr' file using:
>
> pr <- slot(count.points(species, map), "data")[,1]
>
> Where 'species' is a .csv file with two columns of latitude and longitude, and 'map' is a SpatialGridDataFrame file of 23 .asc inputs. For reference, I'm importing my .asc files using readGDAL and then using the cbind command to put them into the 'map' file.
>
> I encounter the following warning message when trying to create 'pr':
>
> 1: In points2grid(points, tolerance, round) :
>   grid has empty column/rows in dimension 1
> 2: In points2grid(points, tolerance, round) :
>   grid has empty column/rows in dimension 2
>
> I assumed this would be alright, but I'm getting the subsequent error when I attempt the enfa command:
>
> enfa1 <- enfa(pc, pr, scannf = FALSE)
>
> Error in eigen(Se) : infinite or missing values in 'x'
>
> Some searching online has told me that this might mean not all of my rows in the 'species' .csv correspond to variables in the 'map' file, but I don't think this is the case for my dataset.
>
> Can anyone help me with this issue? Many thanks in advance.
> ____
>
> Perry Beasley-Hall
> PhD Candidate
> School of Life and Environmental Sciences
>
> THE UNIVERSITY OF SYDNEY
> Room 329, Edgeworth David Building A11
> Sydney NSW 2006, Australia
> E-mail: [hidden email]
> Phone: +61 420 494 584
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

--

Mathieu Basille

[hidden email] | http://ase-research.org/basille
+1 954-577-6314 | University of Florida FLREC

  « Le tout est de tout dire, et je manque de mots
  Et je manque de temps, et je manque d'audace. »
  — Paul Éluard

This message is signed to guarantee its authenticity.
For a true private correspondence, use my public key
to encrypt your messages:

  http://mathieu.basille.net/pub.asc

Learn more: http://mzl.la/1BsOGiZ

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo