DSM - mexican dolphins example

21 views
Skip to first unread message

chaona phiri

unread,
Jan 16, 2023, 7:56:04 AM1/16/23
to distance...@googlegroups.com
Hello,

Am learning how to perform density surface modelling in R so I tried to run the Mexican dolphins example from; https://examples.distancesampling.org/dsm-line-dolphins/mexico-analysis.html 

However, I am getting the following error - 
> data(mexdolphins)
Warning message:
In data(mexdolphins) : data set ‘mexdolphins’ not found

Is this data set no longer available in R? How Else can I run and learn from this example?

Chaona

Eric Rexstad

unread,
Jan 16, 2023, 8:08:03 AM1/16/23
to chaona phiri, distance...@googlegroups.com
Chaona

You must first load the dsm​ library, where the dataset is contained.

library(dsm)
data(mexdolphins)

However, having said this, when I run the two commands above, I do not get the dataset loaded into my global environment, using dsm version 2.3.3

If you have the same problem I did, you could access this dataset directly from Github at this location
and download the .rda file and load into the global environment.


From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of chaona phiri <chaon...@gmail.com>
Sent: 16 January 2023 12:55
To: distance...@googlegroups.com <distance...@googlegroups.com>
Subject: [distance-sampling] DSM - mexican dolphins example
 
--
You received this message because you are subscribed to the Google Groups "distance-sampling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to distance-sampl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distance-sampling/CANxq-ETECasrTenaszub76JbR_Jfc3ABhru%2B%2BXsnrtp%3D3q8UWQ%40mail.gmail.com.


From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of chaona phiri <chaon...@gmail.com>
Sent: 16 January 2023 12:55
To: distance...@googlegroups.com <distance...@googlegroups.com>
Subject: [distance-sampling] DSM - mexican dolphins example
 
--
You received this message because you are subscribed to the Google Groups "distance-sampling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to distance-sampl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distance-sampling/CANxq-ETECasrTenaszub76JbR_Jfc3ABhru%2B%2BXsnrtp%3D3q8UWQ%40mail.gmail.com.

Len Thomas

unread,
Jan 16, 2023, 1:51:29 PM1/16/23
to distance...@googlegroups.com
Hello Chaona and Eric,

I tried to reproduce this problem using dsm 2.3.3 (the latest version on CRAN),
and could not. Below is a copy-paste from my R console. As you can see, when I
type
data(mexdolphins)
I get the data frames disttdata, obsdata, preddata and segdata

I am mystified why you are not, if you are using dsm 2.3.3. Perhaps we can
correspond off-list on this, and post to the list once we have a solution?

With best wishes, Len


R version 4.2.2 (2022-10-31 ucrt) -- "Innocent and Trusting"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> ls()
character(0)
> library(dsm)
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-41. For overview type 'help("mgcv-package")'.
Loading required package: mrds
This is mrds 2.2.7
Built: R 4.2.1; ; 2022-10-09 02:09:11 UTC; windows
Loading required package: numDeriv
This is dsm 2.3.3
Built: R 4.2.2; ; 2023-01-12 05:30:14 UTC; windows
> data(mexdolphins)
>
> ls()
[1] "distdata" "obsdata" "preddata" "segdata"
>

--
I am a member of the University and College Union and am currently
participating in industrial action to improve UK higher education
staff pension, pay, equality and working conditions. For more
information, please see
https://www.ucu.org.uk/article/12469/FAQs#USS_pensions_dispute
and
https://www.ucu.org.uk/article/12469/FAQs#Pay_and_working_conditions_dispute

--
Len Thomas (he/him) len.t...@st-andrews.ac.uk lenthomas.org @len_thom
Centre for Research into Ecological and Environmental Modelling
and School of Mathematics and Statistics
The Observatory, University of St Andrews, Scotland KY16 9LZ
Office: UK+1334-461801 Admin: UK+1334-461842

The University of St Andrews is a charity
registered in Scotland, No SC013532.

chaona phiri

unread,
Jan 17, 2023, 2:21:38 AM1/17/23
to Len Thomas, Eric Rexstad, distance...@googlegroups.com
Thank you both, I have managed now. The issue was the version of dsm which couldn't load because I had not updated the vctrs package. Sorted now.

Thanks

Chaona 

--
You received this message because you are subscribed to the Google Groups "distance-sampling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to distance-sampl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages