ppp objects not working with deldir function - spatstat

I am attempting to use deldir with a ppp object, but receive the following error:
Error: $ operator is invalid for atomic vectors
This does not work:
library(deldir)
library(spatstat)
points <- ppp(x=c(-77.308703, -77.256582, -77.290600, -77.135668, -77.097144),
y=c(39.288603, 39.147019, 39.372818, 39.401898, 39.689203),
window=owin(xrange=c(-77.7,-77), yrange=c(39.1, 39.7)))
deldir(points)
But this works fine:
deldir(x=c(-77.308703, -77.256582, -77.290600, -77.135668, -77.097144),
y=c(39.288603, 39.147019, 39.372818, 39.401898, 39.689203),
rw=c(-77.7, -77, 39.1, 39.7))
Using version 1.0-5 of deldir, version 2.2-0 of spatstat, and version 4.03 of R. I believe the above code worked in previous versions, but I am not sure where the issue is coming from.

This is a bug. It has been corrected by the author of deldir, in version 1.0-6 of the package, which has just been sent to CRAN.

spatstat has its own interface to deldir since spatstat objects cannot be used directly by deldir as you have experienced. Try dirichlet(points)
Edit:
Tge answer above was written from memory on my phone (as is this). It is correct that the usual way to use deldir from spatstat is via spatstat's own interface functions, but it should be possible to invoke deldir directly on a ppp object and it was a bug that this wasn't possible. As #adrian-baddeley says this has been fixed in the new version of deldir.

Related

How to replace a native dynamic library file permanently and appropriately

I try to develop a thirdparty unixODBC driver, it is a secondary development based on the original file libodbc.so.2.0.0.
so I want to rename 'libodbc.so.2.0.0' to 'libodbc.so.2.0.0_renamed'. And soft link my dynamic library file to libodbc.so.2.0.0.
But I found an issue bothering me, when I rename native file and run 'sudo ldconfig', the file named 'libodbc.so.2' automatically linked to the renamed file 'libodbc.so.2.0.0_renamed', as below:
I could not understand that:
why it occurs;
how to appropriately replace the library.
I don't have enough ackownledge about linux, so that I failed to get any keyword to search and deal with it.
Could you help me, thank you very much!
Shared objects under GNU/Linux follow a specific version naming scheme, which is known by the loader (and OS component, actually part of libc framework) to determine if a newer library is retro-compatible with some older version to which a binary was originally linked against. By adding the renamed suffix, you are violating the convention and the dynamic linking system is getting confused. You should renamed as suggested by #Bodo above.
In addition, perhaps rather than using rename, you might consider using the very versioning scheme. From GNU Build System (aka Autotools) manual, the version cheme is like it follows:
Versioning: CURRENT:REVISION:AGE
CURRENT The latest interface implemented.
REVISION The implementation number of CURRENT (read: number of bugs fixed...)
AGE The number of interfaces implemented, minus one.
The library supports all interfaces between CURRENT − AGE and CURRENT.
If you have
not changed the interface (bug fixes) CURRENT : REVISION+1 : AGE
augmented the interface (new functions) CURRENT+1 : 0 : AGE+1
broken old interface (e.g. removed functions) CURRENT+1 : 0 : 0
Therefore a possible history of your lib might be:
1:0:0 start
1:1:0 bug fix
1:2:0 bug fix
2:0:1 new function
2:1:1 bug fix
2:2:1 bug fix
3:0:0 broke api
3:1:0 bug fix
4:1:1 bug fix
5:0:0 broke api
You might, for instance, call the older and newer versions of libodbc.so.x.y.z, according to your needs. Just an idea.

Naming an Ngram document after a string. Julia v1.1.1

I am running Julia v1.1.1 on a windows 10 machine.
I recently went back to update my Julia v0.6.2 code to Julia v.1.1.1 as my code is no longer supported in Julia v0.6.2 anymore.
I was wondering if anyone knows how to name an Ngramdocument after a string, I think the function used to do this was in the TextAnalysis package :
name!(Ngramdocument, string)
However, recently now that I am trying to update my code to Julia v1.1.1 it is saying that the function is undefined. I was wondering if maybe I was wrong in assuming that the function was defined in the TextAnalysis.jl package or if they changed the name. I have not been able to find documentation of a name change however.
name! was changed to title!. title!(Ngramdocument, string) should work as expected in Julia 1.1.1 with the recent TextAnalysis.jl release. You can see the relevant pull request here.
While migrating code, if you face such undefined function errors, you may quickly find the changes looking at the commit history of the package repository or using search function on the GitHub repo of the package.

What exactly is the difference between fuse2 and fuse3?

FUSE = Filesystem in user space recommends that distros package both a fuse2 and a fuse3 (see here) and indeed they do.
What exactly is the reason for this? Is it just that the init code in fuse3 is different?
The release notes for libfuse 3.0.0 appear comprehensive. Read below the heading 'Changes (since FUSE 2.9)'. Functions have been renamed for clarity, functions dropped and parameters tidied up. Here are a few examples from the release notes to give a flavour:
The fuse_lowlevel_new function has been renamed to
fuse_session_new and no longer interprets the --version or --help
options
fuse_loop(), fuse_loop_mt(), fuse_session_loop() and fuse_session_loop_mt() now return more detailed error codes instead of just -1. See the documentation of fuse_session_loop() for details
There are new fuse_session_unmount and fuse_session_mount
functions that should be used in the low-level API. The fuse_mount
and fuse_unmount functions should be used with the high-level API
only
The fuse_invalidate function has been removed
Installing libfuse2 alongside libfuse3 allows applications using libfuse2 to keep working without needing to be updated straight away.

PCL Visualizer demo interaction customization crashing on spinonce

I'm trying to get the PCL Visualizer demo examples to work (all code here: http://pointclouds.org/documentation/tutorials/pcl_visualizer.php) for Windows, PCL 1.6, 32 bits version.
It works fine except for the Interaction Customization part, which is ironically the one i'm most interested on. An unhandled exception occurs at the spinOnce(100) line on the main method. From the long search I've done, it looks like it is deeply connected to VTK not being thread safe and keyboard/mouse callbacks interfering with the VTK window. However, I don't think I've completely understood this and could be mistaken. I have found a very similar question here in stackoverflow (using "pcl::visualization" in different threads from different instance of a class) and I tried using scoped_locks around the spinonce, as he suggests, but I think I'm not doing it right.
Has anyone managed to fully use this example on win32? For reference, here is my poor attempt at locking the spinonce:
while (!viewer->wasStopped ())
{
boost::mutex vis_mutex; //storage for static lock
boost::mutex::scoped_lock lock(vis_mutex);
viewer->spinOnce ();
boost::this_thread::sleep (boost::posix_time::microseconds (100000));
}
Thanks in advance!
I am afraid that it may be related to the version of PCL.
Tutorials are made to match latest versions of PCL and since 1.6 things might have changed.
I recommend you to update to the latest PCL from github. (actually I use code from this tutorial on win64 right out of the box, no issues)

How does cocoa's obsolete CGSCStringValue function actually work?

I've been using CGSPrivate.h for cocoa development under MacOSX for a while. I'm now using it under Lion (10.7.x), and it turns out that the CGSCStringValue() function described in that file no longer exists under that OS version.
I want to make use of the functionality of CGSCStringValue() -- i.e., converting a CGSValue to its associated char* when appropriate -- and I'm wondering if anyone knows how that function is actually implemented.
I've tried various forms of casting of the CGSValue, but to no avail. So could anyone point me to some documentation or actual cocoa code that runs in 10.7 which will take a CGSValue that's associated with a string as input and return its char* equivalent?
Thanks in advance.
It's implemented by checking the type (to make sure it's really a CFString) and calling CFStringGetCString(). You can do that yourself, there is no real need for CGSCStringValue.

Resources