Package ‘ggpattern’ is not available for R version 4.0.2 - ggplot2

Is anybody able to tell me why the package "ggpattern" is not available for R version 4.0.2?
I'm using "geom_sf" to create a map and I want to add patterns instead of a simple color.
Is there an other way to do this other than using this package?
This is my code:
P <- ggplot(data = shpZone, aes(geometry = geometry)) + geom_sf (data = shpZone, fill = "blue") + geom_sf_text(aes(label = ID), size = 3)
P
Thank you!

Related

How can fixe the probel of saving gganime file that is related to using the old API?

My code is following:
p <- ggplot() +
geom_sf(data = world, size = .1) +
geom_sf(aes(fill = SupDem), data = plotdata) +
scale_fill_viridis_c(option = "plasma") +
ggtitle("Democratic Support - {closest_state}") +
transition_states(Year)
anim_save("SupforDemAnim.gif", p)
The error:
Error: It appears that you are trying to use the old API, which has been deprecated.
Please update your code to the new API or install the old version of gganimate
from https://github.com/thomasp85/gganimate/releases/tag/v0.1.1

run a function using multiple input row data in seqRFLP

I am interested on the frag.dat function on seqRFLP, but this function only work for single enzyme per run (enzymes = X).
frag.dat(fil = fas, enznames = X, enzdata = enzdata)
Here is the simple example
directory <- system.file("extdata", package = "seqRFLP")
path <- file.path(directory, "try.fasta")
fas <- read.fasta(path)
frag.dat(fil = fas, enznames = "AluI", enzdata = enzdata)
and the result
enznames recogSite cutting_Site
>try AluI AG'CT 55,94,244,256,343,553
But if i want multiple enzyme at one run, then
frag.dat(fil = fas, enznames = "AluI", "TaqI", enzdata = enzdata)
Error in frag.dat(fil = fas, enznames = "AluI", "TaqI", enzdata = enzdata) :
unused argument ("TaqI")
Any sugestion to run multiple enzyme at once? Thanks in advance.

Update plot according to updated slider value wit Gtk

In Julia, I'd like to update a plot upon the change of value in a Gtk Slider. I understand that this has to do with the "change-value" signal in https://developer.gnome.org/gtk2/2.24/GtkRange.html#GtkRange-value-changed. However, as a beginner, I do not know how to implement the code
The “change-value” signal
gboolean
user_function (GtkRange *range,
GtkScrollType scroll,
gdouble value,
gpointer user_data)
to achieve what I wanted to do. Could anyone kindly provide an example how to use the "change-value" signal?
I know how to set up a window for the slider
sl = slider(1:11)
win = Window("Testing") |> (bx = Box(:v))
push!(bx, sl)
Gtk.showall(win)
I also know what kind of function I need to update the plot
function update(val)
int_val = int(val)
if Signal(sl) != int_val
x = range(0., 2*pi, step=0.01)
y = map(sin, x)
PyPlot.plot(x,Signal(sl)*y)
end
end
However, I don't know how or where I can trigger the "update" function to take actual action.
Thanks!
Thanks, liberforce for your advice!
Here is my minimal working example:
'''
using Gtk
# Set up scale (slider) and window
sl = GtkScale(false, 0:10)
win = Gtk.Window("Gain Selection") |> (bx = Gtk.Box(:v))
push!(bx, sl)
Gtk.showall(win)
# Connect with value-changed signal
id = signal_connect(sl, "value-changed") do widget
# Get scale value
sub = Gtk.GAccessor.adjustment(widget)
val = Gtk.get_gtk_property(sub,"value",Int64)
# Perform function related to the scale value.
println("Gain is changed to ", val)
end
push!(bx, sl)
Gtk.showall(win);
'''
Reference:
signal connect: http://juliagraphics.github.io/Gtk.jl/latest/manual/signals.html
GtkScale: https://lazka.github.io/pgi-docs/Gtk-3.0/classes/Scale.html
Extract scale value: https://discourse.julialang.org/t/how-to-get-the-current-value-of-a-gtk-scale-widget/15680
Julia Do-block: https://www.juliabloggers.com/julia-do-block-vs-python-with-statement/

Programmatically Creating Attributes - Prestashop 1.6

I am programmatically adding attributes to Prestashop 1.6 as follows:
$newGroup = new AttributeGroup();
$newGroup->name = $this->createMultiLangField('test');
$newGroup->public_name = $this->createMultiLangField('test');
$newGroup->group_type = 'select';
$newGroup->add();
$newAttribute = new Attribute();
$newAttribute->name = $this->createMultiLangField('test');
$newAttribute->id_attribute_group = $newGroup->id;
$newAttribute->add();
When I look in my catalog this attribute and its group are there and everything appears to be in order. However, when I click combinations on any of my products after doing this, the ajax loader spins out indefinately (I can no longer create combinations on ANY of my products). Has anybody experienced anything like this?
The code should be:
$newGroup = new AttributeGroup();
$newGroup->name = $this->createMultiLangField('test');
$newGroup->public_name = $this->createMultiLangField('test');
$newGroup->group_type = 'select';
$newGroup->add();
$newAttribute = new Attribute();
$newAttribute->name = $this->createMultiLangField('test');
$newAttribute->id_attribute_group = $newGroup->id;
$newAttribute->add();

How to get an outline view in sublime texteditor?

How do I get an outline view in sublime text editor for Windows?
The minimap is helpful but I miss a traditional outline (a klickable list of all the functions in my code in the order they appear for quick navigation and orientation)
Maybe there is a plugin, addon or similar? It would also be nice if you can shortly name which steps are neccesary to make it work.
There is a duplicate of this question on the sublime text forums.
Hit CTRL+R, or CMD+R for Mac, for the function list. This works in Sublime Text 1.3 or above.
A plugin named Outline is available in package control, try it!
https://packagecontrol.io/packages/Outline
Note: it does not work in multi rows/columns mode.
For multiple rows/columns work use this fork:
https://github.com/vlad-wonderkidstudio/SublimeOutline
I use the fold all action. It will minimize everything to the declaration, I can see all the methods/functions, and then expand the one I'm interested in.
I briefly look at SublimeText 3 api and view.find_by_selector(selector) seems to be able to return a list of regions.
So I guess that a plugin that would display the outline/structure of your file is possible.
A plugin that would display something like this:
Note: the function name display plugin could be used as an inspiration to extract the class/methods names or ClassHierarchy to extract the outline structure
If you want to be able to printout or save the outline the ctr / command + r is not very useful.
One can do a simple find all on the following grep ^[^\n]*function[^{]+{ or some variant of it to suit the language and situation you are working in.
Once you do the find all you can copy and paste the result to a new document and depending on the number of functions should not take long to tidy up.
The answer is far from perfect, particularly for cases when the comments have the word function (or it's equivalent) in them, but I do think it's a helpful answer.
With a very quick edit this is the result I got on what I'm working on now.
PathMaker.prototype.start = PathMaker.prototype.initiate = function(point){};
PathMaker.prototype.path = function(thePath){};
PathMaker.prototype.add = function(point){};
PathMaker.prototype.addPath = function(path){};
PathMaker.prototype.go = function(distance, angle){};
PathMaker.prototype.goE = function(distance, angle){};
PathMaker.prototype.turn = function(angle, distance){};
PathMaker.prototype.continue = function(distance, a){};
PathMaker.prototype.curve = function(angle, radiusX, radiusY){};
PathMaker.prototype.up = PathMaker.prototype.north = function(distance){};
PathMaker.prototype.down = PathMaker.prototype.south = function(distance){};
PathMaker.prototype.east = function(distance){};
PathMaker.prototype.west = function(distance){};
PathMaker.prototype.getAngle = function(point){};
PathMaker.prototype.toBezierPoints = function(PathMakerPoints, toSource){};
PathMaker.prototype.extremities = function(points){};
PathMaker.prototype.bounds = function(path){};
PathMaker.prototype.tangent = function(t, points){};
PathMaker.prototype.roundErrors = function(n, acurracy){};
PathMaker.prototype.bezierTangent = function(path, t){};
PathMaker.prototype.splitBezier = function(points, t){};
PathMaker.prototype.arc = function(start, end){};
PathMaker.prototype.getKappa = function(angle, start){};
PathMaker.prototype.circle = function(radius, start, end, x, y, reverse){};
PathMaker.prototype.ellipse = function(radiusX, radiusY, start, end, x, y , reverse/*, anchorPoint, reverse*/ ){};
PathMaker.prototype.rotateArc = function(path /*array*/ , angle){};
PathMaker.prototype.rotatePoint = function(point, origin, r){};
PathMaker.prototype.roundErrors = function(n, acurracy){};
PathMaker.prototype.rotate = function(path /*object or array*/ , R){};
PathMaker.prototype.moveTo = function(path /*object or array*/ , x, y){};
PathMaker.prototype.scale = function(path, x, y /* number X scale i.e. 1.2 for 120% */ ){};
PathMaker.prototype.reverse = function(path){};
PathMaker.prototype.pathItemPath = function(pathItem, toSource){};
PathMaker.prototype.merge = function(path){};
PathMaker.prototype.draw = function(item, properties){};