Categories
Mastering Development

Forest plot with subgroups in GGPlot2 and text

I have the following codes which is adapted from Forest plot with subgroups in GGPlot2 I am trying to: 1- Change the point shapes as I want black and white figures but it is giving me an error message geom_point(size=2, values=c(3,16,17), colour="white", stroke = 0.5, position=position_dodge(width = 0.5)) Warning message: Ignoring unknown parameters: values 2- […]

Categories
Mastering Development

‘classList’ property returning null when element is present?

I’m fairly new to JS so I’m sorry if this has been answered. I’ve siphoned through most answers and they didn’t specifically fall in line with mine. I’m not understanding why the element cant is called upon when it’s there. I don’t think it seems to be anything with the CSS but I’m not completely […]

Categories
Mastering Development

Turning a dataset into a nested tuple

I have a .txt dataset that I need to convert into a nested tuple. Here’s part of the dataset: Morocco, Rabat, 0.75 million|Algeria: 1000 KM, Tunisia: 400 KM, Western Sahara: 50 KM|North Atlantic Ocean Western Sahara, , 1.51 million|Morocco: 50 KM, Mauritania: 350 KM|North Atlantic Ocean Senegal, Dakar, 0.5 million|Mauritania: 50 KM, Guinea Bissau: 30 […]

Categories
Mastering Development

is there any way to correct this distortion? (THREE JS)

I’m trying to learn a little bit of three.js… I have the following code: https://codesandbox.io/s/icy-currying-lgp1e I should achieve something like that: image containing what I would like to accomplish An then: positions of this .stl object added to the scene should be read, to add new objects to it (buttons / cylinders) that are not […]

Categories
Mastering Development

Turn SpatialPointsDataframe to SpatialGridDataframe

I am trying to convert a SpatialPointsDataframe to a SpatialGridDataframe in order to use the slopeasp() function from the landsat package to get the values for slope. I tried to convert the SpatialPointsDataframe to a raster to convert it but it also didn’t work and I get the error. Error in as(pts, "spatialGridDataFrame") : no […]

Categories
Mastering Development

ng-charts and annotation plugin: annotations not visible after data update

I am creating a graph that updates with data from a REST API, using the ng2-charts library. I use the annotation plugin. The number of annotation changes, so changing an existing annotation is not enough – I need to be able to add/remove new annotations at runtime. When I add annotations to the graph options […]

Categories
Mastering Development

Make Axis line grey or reduce opacity

I want to make the axis lines either less opaque, or make them light grey. I tried to just do .style(opacity, 0.5), but it only makes the TICKS opaque, not the actual line itself. I want to make the ACTUAL LINE less opaque/light grey. I also tried adding the call(d3.axisLeft…).style(less opaque) approach but I still […]

Categories
Mastering Development

sort a dictionary’s keys based on its values; values represent arrays and sorting order varies – ascending/descending; c#

I would like to sort a list of objects. The structure is a Dictionary<object, double[]> and looks like this: Dictionary<int, double[]> dict = new Dictionary<int, double[]>{ {object1, new double[]{0.02, 0.10, 0.30, 0.5}}, {object4, new double[]{0.02, 0.10, 0.30, 0.2}}, {object3, new double[]{0.02, 0.10, 0.30, 0.3}}, {object2, new double[]{0.02, 0.10, 0.50, 0.4}} }; The arrays should be […]

Categories
Mastering Development

applying function to each group using dplyr and return specified dataframe

I used group_map for the first time and think I do it correctly. This is my code: library(REAT) df <- data.frame(value = c(1,1,1, 1,0.5,0.1, 0,0,0,1), group = c(1,1,1, 2,2,2, 3,3,3,3)) haves <- df %>% group_by(group) %>% group_map(~gini(.x$value, coefnorm = TRUE)) The thing is that haves is a list rather than a data frame. What would […]

Categories
Mastering Development

How to calculate movement of pendulum?

I am trying to make a simple simulation of pendulum using Runge–Kutta fourth-order method. I am using p5.js. Usually it calculates the angles properly but sometimes it just starts spinning randomly etc. I have no idea how to resolve this issue it seems to be a problem with my implementation of said algorithm I think? […]