Categories
Mastering Development

Problems with shape files

I want to make a map with the coronavirus infected people by state in US . So the idea is to visualize a map with all states of US and see a range of infected people( i.e 500-2000 , etc) in all the map. This should be represented by different shades of one color. The […]

Categories
Development

How to match data based on a range of values

I have 2 genetic datasets where I am trying to find if a variant at a certain position in the genome (file1) is matching/found within the ranges any of my rows in another dataset (file2), then extract the matches found file 2 to merge with file 1. The one condition is that the matches are […]

Categories
Development

R conditional calculation for variables

I am trying to create a conditional sum for each row in my data frame according two different lists objects. The idea is that check the row value/values (some of them are list object) and assign 1 or -1 for each value/values and find the total for it/them. For example; df row 7 has c(“cuneytozdemir”, […]

Categories
Development

Summarise all columns based on conditions in 2 columns

This is my input data: structure(list(exp_sal = c(1, 1, NA, NA), curr_sal = c(1, NA, 1, NA), `1` = c(59L, 33L, 237L, 244L), `2` = c(98L, 199L, 127L, 178L), `3` = c(75L, 283L, 53L, 141L), `4` = c(26L, 151L, 23L, 111L), `5` = c(8L, 77L, 20L, 29L), `6` = c(4L, 57L, 5L, 25L), `7` = […]

Categories
Development

R: Plot multiple time series in a loop.Error in xy.coords(x, y, xlabel, ylabel, log) : ‘x’ and ‘y’ lengths differ

I’m trying to plot many time series from a database with 134 columns, one ts per colum and after that, save it in a .jpg file. I’m using a loop. I notice that the ploblem could be the plot() function. Some data with dput() structure(list(X9003 = c(3L, 8L, 6L, 6L, 2L, 3L, 6L, 2L, 6L, […]

Categories
Development

Aligning large raster and SpatialPoints in R

I have two datasets: A raster file containing per-pixel vegetation classifications across Australia. The file is described to have projection of EPSG:3577 https://epsg.io/3577. All additional meta data, along with data itself can be found at http://www.agriculture.gov.au/abares/forestsaustralia/forest-data-maps-and-tools/spatial-data/forest-cover A csv file containing data a latitude column, a longitude column, and various other variables. As this is a […]

Categories
Development

Stacked Barplot using ggplot() for a counting table

I have a problem since 2/3 days and I really hope someone would be able to help me. I have a dataframe with the number of bacteria species in different samples and I want to represent them in a stacked barplot (with ggplot()). My dataframe is like this : > head(Table_count) taxonomy 1 Bacteria(100);Proteobacteria(99);Alphaproteobacteria(99);Rhodospirillales(99);Acetobacteraceae(99);Roseomonas(97); 2 […]

Categories
Development

Divide barplot into “subsections” with ggplot2

I want to divide my barplot into areas so that certain areas of the X-axis lie within those areas. I’ll try to attach two photos. The one with the green line is the one I want to reproduce (but the green line is not important to me) and the other one is my plot I […]

Categories
Development

How to insert blank space on x-axis in boxplot using ggplot /R?

I have My Data stored in p, which can be found below. I have four specific categories for a group of tumor patients. Three of the groups correspond to the tumor stage and is stored as p$WHO.Grade=1,2,3. The last group is All tumor patients combined. I am producing a specific plot consisting of multiple boxplots […]