Comments (21)
Now added.
Install the latest development version:
library(devtools)
install_github("rfishbase", "ropensci")
and try:
library(rfishbase)
data(fishbase)
out <- getFaoArea(fish.data[1:3])
#'
# or using species names:
ids <- findSpecies(c("Coris_pictoides", "Labropsis_australis"))
out <- getFaoArea(fish.data[ids])
Let me know if you would want something different in the return format (e.g. one table for all species, parse the names further in to major and minor regions as separate columns, etc.
from rfishbase.
Hi
I am having trouble following the above instructions. Any time I try to install rfishbase from GitHub I get the following message:
Installing github repo rfishbase/master from ropensci
Downloading master.zip from https://github.com/ropensci/rfishbase/archive/master.zip
Installing package from /var/folders/3r/z4zysrrn6rs1mqclbtz0sg980000gn/T//RtmpZgFldJ/master.zip
arguments 'minimized' and 'invisible' are for Windows only
Installing rfishbase
'/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD INSTALL
'/private/var/folders/3r/z4zysrrn6rs1mqclbtz0sg980000gn/T/RtmpZgFldJ/devtools104a14d77811d/rfishbase-master'
--library='/Library/Frameworks/R.framework/Versions/3.0/Resources/library' --install-tests
- installing source package 'rfishbase' ...
Error : Invalid DESCRIPTION file
Malformed Authors@R field:
:5:0: unexpected end of input
3: person(c("Tim", "Poisot", role="ctb"),
4: person(c("Peter", "C."), "Wainwright", role = "aut"))
^
See the information on DESCRIPTION files in section 'Creating R
packages' of the 'Writing R Extensions' manual.
ERROR: installing package DESCRIPTION failed for package 'rfishbase'
- removing '/Library/Frameworks/R.framework/Versions/3.0/Resources/library/rfishbase'
- restoring previous '/Library/Frameworks/R.framework/Versions/3.0/Resources/library/rfishbase'
Erro: Command failed (1)
Any solution?
Recommendation?
Walter
from rfishbase.
hey @wboeger Try it again now. There was a missing parens in the author field in the DESCRIPTION
file. Let us know if it does or doesn't install for you now
from rfishbase.
Hey Scott!
It ran nice. Installed. Thanks for making these available to us! I will
send you the results when published!!!!
Walt
On Fri, Apr 11, 2014 at 11:07 AM, Scott Chamberlain <
[email protected]> wrote:
hey @wboeger https://github.com/wboeger Try it again now. There was a
missing parens in the author field in the DESCRIPTION file. Let us know
if it does or doesn't install for you nowReply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-40207002
.
Walter A. Boeger, PhD
Professor Titular - UFPR
Click here for Google
citationshttp://scholar.google.com/citations?user=GeixAY8AAAAJ&hl=en
Click here for CNPq Lattes
CVhttp://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4787292D4
from rfishbase.
Great!
from rfishbase.
Scott
Sorry to bother again. I followed the instructions in the GitHub page but
the reply I got from the R is that the function getFaoArea could not be
found> :-(
Let me tell you waht I am trying to do. I am trying to test the idea that
the greater number of marine species in freshwater in South America is a
consequence of many hydro and geological events that occurred in the
continent since the Paleocene that exposed Marine species to freshwater
environs. This, in this working hypothesis, may have "prepared" some
lineages of marine species to colonize freshwater. The story is longer but
this pretty much summarizes everything. I want to test the proportion of
euryhaline species of coastal fishes between continents with distinct
geological history (e.g. South America and Africa) as I predict that SA has
more euryhaline species than Africa...
Your rfishbase really helps me with this. I hope to be able to use it.
Cheers and thanks again
Walter
Walter A Boeger, PhD
Professor Titular - UFPR
Curitiba, Brazil
On Fri, Apr 11, 2014 at 11:30 AM, Scott Chamberlain <
[email protected]> wrote:
Great!
Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-40209610
.
Walter A. Boeger, PhD
Professor Titular - UFPR
Click here for Google
citationshttp://scholar.google.com/citations?user=GeixAY8AAAAJ&hl=en
Click here for CNPq Lattes
CVhttp://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4787292D4
from rfishbase.
Looks like @cboettig just fixed it, try again
from rfishbase.
Cool!
W
On Fri, Apr 11, 2014 at 5:25 PM, Scott Chamberlain <[email protected]
wrote:
Looks like @cboettig https://github.com/cboettig just fixed it, try
againReply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-40249618
.
Walter A. Boeger, PhD
Professor Titular - UFPR
Click here for Google
citationshttp://scholar.google.com/citations?user=GeixAY8AAAAJ&hl=en
Click here for CNPq Lattes
CVhttp://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4787292D4
from rfishbase.
it works now?
from rfishbase.
Ops. Nope. Still not working.
Sorry
On Fri, Apr 11, 2014 at 5:25 PM, Scott Chamberlain <[email protected]
wrote:
Looks like @cboettig https://github.com/cboettig just fixed it, try
againReply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-40249618
.
Walter A. Boeger, PhD
Professor Titular - UFPR
Click here for Google
citationshttp://scholar.google.com/citations?user=GeixAY8AAAAJ&hl=en
Click here for CNPq Lattes
CVhttp://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4787292D4
from rfishbase.
@wboeger Hmm, I just tried it and it works for me. Did you reinstall the package? Try
install_github("ropensci/rfishbase")
library("rfishbase")
data(fishbase)
getFaoArea(fish.data[1:3])
I get
$Oreochromis_niloticus_niloticus
FAO Area Status Note
1 Africa-Inland Waters endemic Complete
2 America, North - Inland waters introduced includes Central America
3 America, South - Inland waters introduced
4 Asia - Inland waters introduced
5 Europe - Inland waters introduced excludes former USSR
6 Oceania - Inland waters introduced
$Oreochromis_mossambicus
FAO Area Status Note
1 Africa-Inland Waters endemic Complete
2 America, North - Inland waters introduced includes Central America
3 America, South - Inland waters introduced
4 Asia - Inland waters introduced
5 Europe - Inland waters introduced excludes former USSR
6 Oceania - Inland waters introduced
$Engraulis_ringens
FAO Area Status Note
1 Pacific, Southeast native
from rfishbase.
It worked alright scott, I must have done something wrong
On Fri, Apr 11, 2014 at 5:57 PM, Scott Chamberlain <[email protected]
wrote:
@wboeger https://github.com/wboeger Hmm, I just tried it and it works
for me. Did you reinstall the package? Tryinstall_github("ropensci/rfishbase")library("rfishbase")data(fishbase)getFaoArea(fish.data[1:3])
I get
$Oreochromis_niloticus_niloticus
FAO Area Status Note1 Africa-Inland Waters endemic Complete2 America, North - Inland waters introduced includes Central America3 America, South - Inland waters introduced 4 Asia - Inland waters introduced 5 Europe - Inland waters introduced excludes former USSR6 Oceania - Inland waters introduced
$Oreochromis_mossambicus
FAO Area Status Note1 Africa-Inland Waters endemic Complete2 America, North - Inland waters introduced includes Central America3 America, South - Inland waters introduced 4 Asia - Inland waters introduced 5 Europe - Inland waters introduced excludes former USSR6 Oceania - Inland waters introduced
$Engraulis_ringens
FAO Area Status Note1 Pacific, Southeast nativeReply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-40252601
.
Walter A. Boeger, PhD
Professor Titular - UFPR
Click here for Google
citationshttp://scholar.google.com/citations?user=GeixAY8AAAAJ&hl=en
Click here for CNPq Lattes
CVhttp://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4787292D4
from rfishbase.
Great!
from rfishbase.
Thanks for writing this up @cboettig!
I'm using this to calculate the number of species in a given genus that are found in a single fao region. For example - I'd like to get a list (total number) of species in the genus "Etmopterus" that are found in FAO region 58 (Indian Ocean, Antarctic).
Is there an easy way to use getFaoArea to query for this?
from rfishbase.
Getting all fish in the genus and then getting the FAO regions for that list of fish is easy:
library(rfishbase)
data(fishbase)
who = sapply(fish.data, function(x) x$Genus == "Etmopterus")
out <- getFaoArea(fish.data[who])
Note that sum(who)
shows me I see 34 species in this genus on fishbase. fish_names(fish.data[who])
will tell you who they are. The last command in the series is slow since it is the HTML scraping. lemme know if it fails, I might need to improve error handling.
You then might just want to melt the out
list (see reshape2 package) to get a table of FAO areas by species name. Then summing the column of the FAO area would tell you how many species are in that area. (this bit left as an exercise)
Doing the query in reverse, giving an FAO area and asking what species/genus etc live there, is much harder in the current implementation. You'd have to just query FAO area for all of fishbase and build the table manually. Maybe easier in rfishbase2.0
from rfishbase.
Just an update - getFaoArea seems to be failing every once in a while, as you warned - usually when there are a significant number of species (over 50) - as an example its failing when attempting to subset the genus "Bathyraja".
from rfishbase.
Thanks, I'll try and get around to adding some error handling so it can
just skip species that have missing data rather than giving up and throwing
an error.
On Tue, Apr 15, 2014 at 3:27 PM, jafflerbach [email protected]:
Just an update - getFaoArea seems to be failing every once in a while, as
you warned - usually when there are a significant number of species (over
50) - as an example its failing when attempting to subset the genus
"Bathyraja".—
Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-40542347
.
Carl Boettiger
UC Santa Cruz
http://carlboettiger.info/
from rfishbase.
great, thanks! This is such a big help
On Tue, Apr 15, 2014 at 3:29 PM, Carl Boettiger [email protected]:
Thanks, I'll try and get around to adding some error handling so it can
just skip species that have missing data rather than giving up and
throwing
an error.On Tue, Apr 15, 2014 at 3:27 PM, jafflerbach [email protected]:
Just an update - getFaoArea seems to be failing every once in a while,
as
you warned - usually when there are a significant number of species
(over
50) - as an example its failing when attempting to subset the genus
"Bathyraja".—
Reply to this email directly or view it on GitHub<
https://github.com/ropensci/rfishbase/issues/20#issuecomment-40542347>
.Carl Boettiger
UC Santa Cruz
http://carlboettiger.info/—
Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-40542468
.
Jamie Afflerbach
from rfishbase.
I am still getting the following error with FaoArea:
Error in xpathApply(summaryPage, "//*[contains(@href,
'/Country/FaoAreaList.php')][1]", :
out of limits
I have tried with other species/genera/family and it worked. But nor for
Sciaenidae (both separated as marine species and freshwater species).
Any help?
Thanks
On Wed, Apr 16, 2014 at 6:41 PM, jafflerbach [email protected]:
great, thanks! This is such a big help
On Tue, Apr 15, 2014 at 3:29 PM, Carl Boettiger [email protected]:
Thanks, I'll try and get around to adding some error handling so it can
just skip species that have missing data rather than giving up and
throwing
an error.On Tue, Apr 15, 2014 at 3:27 PM, jafflerbach [email protected]:
Just an update - getFaoArea seems to be failing every once in a while,
as
you warned - usually when there are a significant number of species
(over
50) - as an example its failing when attempting to subset the genus
"Bathyraja".Reply to this email directly or view it on GitHub<
https://github.com/ropensci/rfishbase/issues/20#issuecomment-40542347>
.Carl Boettiger
UC Santa Cruz
http://carlboettiger.info/Reply to this email directly or view it on GitHub<
https://github.com/ropensci/rfishbase/issues/20#issuecomment-40542468>
.Jamie Afflerbach
Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-40655979
.
Walter A. Boeger, PhD
Professor Titular - UFPR
Click here for Google
citationshttp://scholar.google.com/citations?user=GeixAY8AAAAJ&hl=en
Click here for CNPq Lattes
CVhttp://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4787292D4
from rfishbase.
Okay, this is implemented in rfishbase2.0 as "locations", e.g.
faoares(species_list(Genus='Labroides'))
gives:
AreaCode SpecCode Status FAO
1 2 1520 native America, North - Inland waters
2 4 1520 native Asia - Inland waters
3 18 1520 native Arctic Ocean
4 27 1520 native Atlantic, Northeast
5 61 1520 native Pacific, Northwest
6 67 1520 native Pacific, Northeast
7 77 1520 native Pacific, Eastern Central
This doesn't yet have the "Note" column from the web, not sure if that's needed. (eg here)
I'm hoping to add the more general functions for the other Distribution-related tables: Countries, Ecosystems, Occurrences, Point map, Introductions, & Faunaf soon.
rfishbase2.0 still in development, see the branch
from rfishbase.
Thanks Carl! Great!
Walter
Sent from my iPad
On Mar 5, 2015, at 7:06 PM, Carl Boettiger [email protected] wrote:
Okay, this is implemented in rfishbase2.0 as "locations", e.g.
faoares(species_list(Genus='Labroides'))
gives:AreaCode SpecCode Status FAO
1 2 1520 native America, North - Inland waters
2 4 1520 native Asia - Inland waters
3 18 1520 native Arctic Ocean
4 27 1520 native Atlantic, Northeast
5 61 1520 native Pacific, Northwest
6 67 1520 native Pacific, Northeast
7 77 1520 native Pacific, Eastern Central
This doesn't yet have the "Note" column from the web, not sure if that's needed. (eg here)I'm hoping to add the more general functions for the other Distribution-related tables: Countries, Ecosystems, Occurrences, Point map, Introductions, & Faunaf soon.
rfishbase2.0 still in development, see the branch
—
Reply to this email directly or view it on GitHub.
from rfishbase.
Related Issues (20)
- Getting and API error with the species() function HOT 2
- errrors HOT 2
- `fishbase` object removed between 3.0.1 and 4.0.0 HOT 4
- Error whrn retrieving taxonomic information HOT 1
- getSize function not working HOT 1
- fishbase dataset present in 3.1.9. is missing from v. 4.0.0 HOT 1
- Error with synonyms() function when server = "sealifebase" HOT 6
- Getting images HOT 1
- Discrepancy in vulnerability values and lacking aquarium metadata HOT 1
- Error in rbind(deparse.level, ...) in addition SSL certificate problem: certificate has expired HOT 4
- Where to get the fbapp.sql file?+ HOT 2
- Spanish language for common_to_sci not working HOT 1
- Working with dowloaded tables offline HOT 7
- life-history tool
- what's the meaning of e_code? HOT 1
- saving/exporting tibble data from searches HOT 1
- get_latest_release does not work HOT 1
- estimate() function returns LengthType NA HOT 3
- rfishbase length-weight function doesn't work anymore HOT 7
- species() returns mostly NAs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rfishbase.