Giter VIP home page Giter VIP logo

siar's People

Contributors

andrewljackson avatar katrinleinweber avatar phdmeiwp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

siar's Issues

no visible global function definitions

Version: 4.2
Check: R code for possible problems
Result: NOTE
bayesMVN: no visible global function definition for 'rmultireg'
bayestwoNorm: no visible global function definition for 'runireg'
overlap: no visible global function definition for 'overlap.xypolygon'
panelcontour: no visible global function definition for 'kde2d'
siardensityplot: no visible global function definition for 'hdr'
siarhdrs: no visible global function definition for 'hdr'
siarhdrs: no visible global function definition for 'geweke.diag'
siarproportionbygroupplot: no visible global function definition for
'hdr'
siarproportionbysourceplot: no visible global function definition for
'hdr'

Siber.ellipses function using R.3.2.1

When running siber.ellipses on my own data or even in the example script you provided (demo.SEA_v2), I get an error message that does not allow me to run the rest of the code:

SEA.B <- siber.ellipses(x,y,group,R=reps)
Error: not a matrix

This issue does not seem to happen with R3.1.2, but it does with the new R. 3.2.1.

Probability values erroneously detailed in text output of "Plot of proportions by source "

largest intervals are labeled as if they were the smallest ones.

EXAMPLE:

siarproportionbysourceplot(model1,prn=TRUE,grp=1,probs=c(25,75))
Plot of proportions by source
This requires more than one group in the output file.
Producing plot.....

Probability values for Group 1
25 % lower = 0.11 upper = 0.28
75 % lower = 0.17 upper = 0.22
Probability values for Group 2
25 % lower = 0.56 upper = 0.66
75 % lower = 0.6 upper = 0.63

quartz() needs to be changed to dev.new()

Version: 4.2
Check: R code for possible problems
Result: NOTE
Found an obsolete/platform-specific call in the following function:
‘newgraphwindow’
Found the platform-specific devices:
‘quartz’ ‘windows’ ‘x11’
dev.new() is the preferred way to open a new device, in the unlikely
event one is needed.
bayesMVN: no visible global function definition for ‘rmultireg’
bayestwoNorm: no visible global function definition for ‘runireg’
overlap: no visible global function definition for ‘overlap.xypolygon’
panelcontour: no visible global function definition for ‘kde2d’
siardensityplot: no visible global function definition for ‘hdr’
siarhdrs: no visible global function definition for ‘hdr’
siarhdrs: no visible global function definition for ‘geweke.diag’
siarproportionbygroupplot: no visible global function definition for
‘hdr’
siarproportionbysourceplot: no visible global function definition for
‘hdr’

dependencies in R code

Version: 4.2
Check: dependencies in R code
Result: NOTE
Packages in Depends field not imported from:
‘MASS’ ‘bayesm’ ‘coda’ ‘hdrcde’ ‘mnormt’ ‘spatstat’
These packages need to be imported from (in the NAMESPACE file)
for when this namespace is loaded but not attached.
See the information on DESCRIPTION files in the chapter ‘Creating R
packages’ of the ‘Writing R Extensions’ manual.

devtools install code

Hi, noticed that the readme code has a typo in the arguments. It should be:

devtools::install_github("andrewljackson/siar@master"", build_vignettes = TRUE)

Thanks!

Problem with

Hello Andrew, I am hoping you might be able to help, I am trying to run SIAR for groups of up to three penguins with 3-5 diet sources. I have run SIAR in the past, but now cannot seem to make it work! The error I am getting is:

*** caught segfault ***
address 0x7fff9a9b1e66, cause 'memory not mapped'

Traceback:
1: .C("siarmcmcv4", as.integer(numdata), as.integer(numsources), as.integer(numiso), as.integer(numgroups), as.integer(startgroup), as.integer(endgroup), as.integer(siardata$iterations), as.integer(siardata$burnin), as.integer(siardata$howmany), as.integer(siardata$thinby), as.double(prior), as.double(as.matrix(data2)), as.double(as.matrix(concdepdata)), as.double(as.matrix(sourcedata)), as.double(as.matrix(correctionsdata)), as.double(parameters))
2: siarmcmcdirichletv4(data, sources, corrections, concdep, iterations = 1e+06, burnin = 40000, howmany = 10000, thinby = 10, prior = rep(1, nrow(sources)), siardata = list(SHOULDRUN = FALSE))

I am continuing to work on this, but if you have any thoughts I would appreciate your feedback. Thank you, Kristen Gorman

siar-devel does not install properly due to architecture hickup

Hi @AndrewLJackson,

I am currently teaching at a summer school on stable isotope and we tried to play a bit with siar today.

We had a few problems:

  • the CRAN version of siar seems to be bugged (overlap.xypolygon missing which confirms issue #5 so overlap() crashes)
  • so we tried to install siar from github, so we did not succeed. Using clang (i.e. compiling using MacOS) on an architecture x86_64 the installation works but warn you of a problem:
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o siar.so siarmcmcv4.o siarsolomcmcv4.o use.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: ld: warning: ignoring file siarmcmcv4.o, file was built for unsupported file format ( 0x4C 0x01 0x07 0x00 0x00 0x00 0x00 0x00 0x46 0x1A 0x00 0x00 0x1F 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): siarmcmcv4.oignoring file siarsolomcmcv4.o, file was built for unsupported file format ( 0x4C 0x01 0x07 0x00 0x00 0x00 0x00 0x00 0x38 0x16 0x00 0x00 0x1C 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): siarsolomcmcv4.o

ld: warning: ignoring file use.o, file was built for unsupported file format ( 0x4C 0x01 0x07 0x00 0x00 0x00 0x00 0x00 0x4E 0x15 0x00 0x00 0x29 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): use.o
installing to /Library/Frameworks/R.framework/Versions/3.5/Resources/library/siar/libs
** R
** data
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (siar)

but using gcc (i.e. on Windows or MacOS; I tried both), the problem makes the compiler crash:


*** arch - x64
c:/Rtools/mingw_64/bin/gcc -shared -s -static-libgcc -o siar.dll tmp.def 
siarmcmcv4.o siarsolomcmcv4.o use.o -LC:/PROGRA~1/R/R-35~1.1/bin/x64 -lR
C:/Rtools/mingw_64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.3/../../../../x86_64-w64-mingw32/bin/ld.exe: 
i386 architecture of input file `siarmcmcv4.o' is incompatible with 
i386:x86-64 output
C:/Rtools/mingw_64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.3/../../../../x86_64-w64-mingw32/bin/ld.exe: 
i386 architecture of input file `siarsolomcmcv4.o' is incompatible with 
i386:x86-64 output
C:/Rtools/mingw_64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.3/../../../../x86_64-w64-mingw32/bin/ld.exe: 
i386 architecture of input file `use.o' is incompatible with i386:x86-64 
output
siarmcmcv4.o:siarmcmcv4.c:(.text+0x14): undefined reference to 
`_Rprintf'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x20): undefined reference to 
`_Rprintf'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x2c): undefined reference to 
`_Rprintf'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x44): undefined reference to 
`_Rprintf'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x59): undefined reference to 
`_Rprintf'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x6e): more undefined references to 
`_Rprintf' follow
siarmcmcv4.o:siarmcmcv4.c:(.text+0x335): undefined reference to 
`_memset'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x43c): undefined reference to 
`_memcpy'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x5aa): undefined reference to 
`_memcpy'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x5af): undefined reference to 
`_GetRNGstate'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x5df): undefined reference to 
`_Rf_runif'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x8ac): undefined reference to 
`_Rf_dunif'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x8fd): undefined reference to `_clock'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x947): undefined reference to 
`_Rf_runif'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x9ba): undefined reference to 
`_Rf_runif'
siarmcmcv4.o:siarmcmcv4.c:(.text+0xdbb): undefined reference to 
`_Rf_dunif'
siarmcmcv4.o:siarmcmcv4.c:(.text+0xe12): undefined reference to 
`_Rf_dunif'
siarmcmcv4.o:siarmcmcv4.c:(.text+0xf4e): undefined reference to 
`_PutRNGstate'
siarmcmcv4.o:siarmcmcv4.c:(.text+0xfd7): undefined reference to `_clock'
siarmcmcv4.o:siarmcmcv4.c:(.text+0xfe5): undefined reference to 
`_Rprintf'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x1007): undefined reference to 
`_Rprintf'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x107c): undefined reference to 
`_Rf_runif'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x10ab): undefined reference to 
`_Rprintf'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x10d8): undefined reference to 
`_memcpy'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x10ee): undefined reference to 
`_memcpy'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x1124): undefined reference to 
`_memcpy'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x113c): undefined reference to `_sqrt'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x1155): undefined reference to `_sqrt'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x118e): undefined reference to 
`_Rprintf'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x11f6): undefined reference to `_sqrt'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x1231): undefined reference to 
`_GetRNGstate'
siarmcmcv4.o:siarmcmcv4.c:(.text+0x126f): undefined reference to 
`_Rprintf'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x14): undefined reference to 
`_Rprintf'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x20): undefined reference to 
`_Rprintf'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x2c): undefined reference to 
`_Rprintf'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x38): undefined reference to 
`_Rprintf'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x50): more undefined 
references to `_Rprintf' follow
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x327): undefined reference to 
`_memset'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x41e): undefined reference to 
`_memcpy'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x514): undefined reference to 
`_memcpy'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x519): undefined reference to 
`_GetRNGstate'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x546): undefined reference to 
`_Rf_runif'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x696): undefined reference to 
`_sqrt'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x778): undefined reference to 
`_memset'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x84e): undefined reference to 
`_clock'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x892): undefined reference to 
`_Rf_runif'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0x8fa): undefined reference to 
`_Rf_runif'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xa57): undefined reference to 
`_sqrt'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xc02): undefined reference to 
`_PutRNGstate'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xc82): undefined reference to 
`_clock'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xc90): undefined reference to 
`_Rprintf'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xcb2): undefined reference to 
`_Rprintf'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xcfc): undefined reference to 
`_Rf_runif'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xd25): undefined reference to 
`_Rprintf'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xd53): undefined reference to 
`_memcpy'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xd6c): undefined reference to 
`_memcpy'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xd8b): undefined reference to 
`_memcpy'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xdc0): undefined reference to 
`_Rprintf'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xe5d): undefined reference to 
`_GetRNGstate'
siarsolomcmcv4.o:siarsolomcmcv4.c:(.text+0xeca): undefined reference to 
`_Rprintf'
use.o:use.c:(.text+0x56): undefined reference to `_Rf_dnorm4'
use.o:use.c:(.text+0xa7): undefined reference to `_atan'
use.o:use.c:(.text+0xb7): undefined reference to `_atan'
use.o:use.c:(.text+0xdf): undefined reference to `_exp'
use.o:use.c:(.text+0xef): undefined reference to `_cos'
use.o:use.c:(.text+0x10f): undefined reference to `_exp'
use.o:use.c:(.text+0x11f): undefined reference to `_cos'
use.o:use.c:(.text+0x172): undefined reference to `_Rf_runif'
use.o:use.c:(.text+0x198): undefined reference to `_Rf_runif'
use.o:use.c:(.text+0x1a4): undefined reference to `_cos'
use.o:use.c:(.text+0x1b4): undefined reference to `_tan'
use.o:use.c:(.text+0x1c8): undefined reference to `_log'
use.o:use.c:(.text+0x1ec): undefined reference to `_sqrt'
use.o:use.c:(.text+0x2a7): undefined reference to `_Rf_pnorm5'
use.o:use.c:(.text+0x2d3): undefined reference to `_Rf_pnorm5'
use.o:use.c:(.text+0x2ff): undefined reference to `_Rf_pnorm5'
use.o:use.c:(.text+0x32b): undefined reference to `_Rf_pnorm5'
use.o:use.c:(.text+0x387): undefined reference to `_Rf_runif'
use.o:use.c:(.text+0x39b): undefined reference to `_exp'
use.o:use.c:(.text+0x3db): undefined reference to `_log'
use.o:use.c:(.text+0x447): undefined reference to `_log'
use.o:use.c:(.text+0x4cb): undefined reference to `_log'
use.o:use.c:(.text+0x50d): undefined reference to `_log'
use.o:use.c:(.text+0x579): undefined reference to `_log'
use.o:use.c:(.text+0x5d9): more undefined references to `_log' follow
use.o:use.c:(.text+0x705): undefined reference to `_memcpy'
use.o:use.c:(.text+0x987): undefined reference to `_Rf_error'
use.o:use.c:(.text+0x9a8): undefined reference to `_calloc'
use.o:use.c:(.text+0x9be): undefined reference to `_calloc'
use.o:use.c:(.text+0xa58): undefined reference to `_memcpy'
use.o:use.c:(.text+0xb47): undefined reference to `_calloc'
use.o:use.c:(.text+0xb71): undefined reference to `_calloc'
use.o:use.c:(.text+0xbae): undefined reference to `_memcpy'
use.o:use.c:(.text+0xbe4): undefined reference to `_calloc'
use.o:use.c:(.text+0xc0c): undefined reference to `_calloc'
use.o:use.c:(.text+0xc99): undefined reference to `_log'
use.o:use.c:(.text+0xce9): undefined reference to `_calloc'
use.o:use.c:(.text+0xd56): undefined reference to `_log'
collect2.exe: error: ld returned 1 exit status
keine DLL erzeugt
ERROR: compilation failed for package 'siar'
* removing 'C:/Program Files/R/R-3.5.1/library/siar'
* restoring previous 'C:/Program Files/R/R-3.5.1/library/siar'
In R CMD INSTALL
Installation failed: Command failed (1)

Any idea of a workaround we could try tomorrow?

Many thanks

Alex

package dependencies

Version: 4.2
Check: package dependencies
Result: NOTE
Depends: includes the non-default packages:
‘hdrcde’ ‘coda’ ‘MASS’ ‘bayesm’ ‘mnormt’ ‘spatstat’
Adding so many packages to the search path is excessive and importing
selectively is preferable.

Groups not in order

It seems that SIAR will run but produce incorrect results if you put the groups in the wrong order.

MRE:

library(siar)

data(geese2demo, sourcesdemo, correctionsdemo, concdepdemo)

# Run on first 2 groups
run = siarmcmcdirichletv4(geese2demo[1:38,], sourcesdemo, correctionsdemo, concdepdemo)
siarhistograms(run) # Choose group 1

# Now shuffle groups
run2 = siarmcmcdirichletv4(geese2demo[sample(1:38),], sourcesdemo, correctionsdemo, concdepdemo)
siarhistograms(run2) # Choose group 1

These two will produce different results without an error or a warning.

I suggest adding a line beneath numgroups <- max(data[, 1]) in siarmcmcdirichletv4 which says something like:

if(!identical(data[,1], sort(data[,1]))) stop("Group variable must be in order")

Rd line widths

Version: 4.2
Check: Rd line widths
Result: NOTE
Rd file 'siarmcmcdirichletv4.Rd':
\usage lines wider than 90 characters:
siarmcmcdirichletv4(data, sources, corrections = 0, concdep = 0, iterations=200000, burnin=50000, howmany=10000, thinby=15, prior = rep ... [TRUNCATED]

Rd file 'siarplotdata.Rd':
 \usage lines wider than 90 characters:
 siarplotdata(siardata, siarversion = 0, grp=1:siardata$numgroups,panel=NULL,isos=c(0,0),leg=1)

Rd file 'siarproportionbygroupplot.Rd':
 \usage lines wider than 90 characters:
 siarproportionbygroupplot(siardata, siarversion=0,probs=c(95,75,50),xlabels=NULL, grp=NULL, type="boxes",clr=gray((9:1)/10),scl=1,xspc= ... [TRUNCATED]

Rd file 'siarproportionbysourceplot.Rd':
 \usage lines wider than 90 characters:
 siarproportionbysourceplot(siardata, siarversion=0,probs=c(95,75,50),xlabels=NULL, grp=NULL, type="boxes",clr=gray((9:1)/10),scl=1,xspc ... [TRUNCATED]

Rd file 'siarsolomcmcv4.Rd':
 \usage lines wider than 90 characters:
 siarsolomcmcv4(data, sources, corrections = 0, concdep = 0, iterations=200000, burnin=50000, howmany=10000, thinby=15, prior = rep(1, n ... [TRUNCATED]

These lines will be truncated in the PDF manual. 

siarplotdata() for one group

Version: 4.2
I detected a possible bug in siarplotdata() for the single group version. Aparently takes the column of the grouping variable as the first isotope so siarplotdata(modeldemo, iso=c(1,2) produces
bugexample1
In my example N is the 1rst isotope, and siar is plotting it as the second, and "Code" as the first. As a consequence, the second isotope, C, gets plotted as the third like in siarplotdata(modeldemo, iso=c(2,3)
bugexample2
The sources are correctly plotted, and the axis values seem to correspond the the actual isotopic values of the sources, the problem is only in representing the consumers.

This is also an issue with only two isotopes, but it disappears in the multigroup version.

Matrix plot click for legend

siarmatrixplot when run on multiple groups asks the user to click on the graph for the legend. This needs to be removed.

Reproducible example:

library(star)
data(geese2demo,sourcesdemo,correctionsdemo,concdepdemo)
out <- siarmcmcdirichletv4(geese2demo,sourcesdemo,correctionsdemo,concdepdemo)
siarmatrixplot(out)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.