Demystify the data science, visualisation with simple, practical and concise answers to your data science and visualisation questions.
We have hundred of videos covering various aspects of Data Analytics. Our aim is to provide concise, practical and fit for purpose content for Data scientists .You would regularly find new R, Python, C#, database, automation related content on your channel.
In today's world just using one tool is not enough, like a tradesman toolkit which has various tools for various needs. Enhance your toolkit by learning tools fit for purpose.
Browse through our full range of videos on visualisation using GGPLOT. When creating charts for a document it is important to have the same look and feel for all your charts. We have a full suite of GGPLOT charts tutorials.
We thank everyone in helping support this channel.
Hi That can be achieved as following by creating a new column and using following DAX command. Hope it helps. For Monday as start of week MondayStart = WEEKDAY('Table'[Admit Date] ,2) For Tuesday as start of week TuesdayStart = WEEKDAY('Table'[Admit Date] ,3) For Saturday as start of week. The options above are only 1, 2 or 3 so to make Saturday as start of week. SaturdayStart = IF(WEEKDAY('Table'[Admit Date], 1) = 7, 1, WEEKDAY('Table'[Admit Date], 1) + 1) All the best.
Great to see another tutorial from you sir... Its been a while you unloaded contents. Trust you are doing great over there and your loved ones? Thanks a million for the previous contents _ they indeed gave me good directions in my journey of using R.
It is a video which i am also looking for but the font is extremely blurred. Will ne very helpful if you could share the formula in a bigger and clear font. Thanks in advance
Sir, It is a very informative and wonderful video. Thank you very much for considering my request. I hope your good self will create more informative videoes in the future 🙏
Hi Not sure if I got the question right. But I will try to give you a generic answer and hope that it covers what you wanted to ask... 1. Type the colours() command and it gives you a list of all the colours listed in the terminal window. 2. Copy all these values from tthe terminal window and copy them in your script and then you are able to see the actual colours also, which makes it easy to choose the colour which you want. 3. In order to use the colours you have two choices, eg. if you want all the points to be of the same colour then you can set the colour outside the aesthetics. If you want the colour to be different based on some other grouping then give the colour command within the aesthetics eg . aes (colour = gender), this was each gender will get different colour. and then you can have another line to specify the colours eg. scale_colour_manual(values = c('red', 'blue')) Hope this is what you initially wanted to ask. Let me know if I haven't been able to answer you question. All the best.
Is it still work the same if I simplyfy the code as: ``` data |> ggplot(aes(x = date)) + geom_line(aes(y = patients)) + geom_point(aes(y = patients)) + geom_line(aes(y = death)) + geom-point(aes(y = death)) + Theme_classic() ``` Without the clutter p1 every new lines 😊
Hi Yes, it will work perfectly, this syntax is short and lot of people prefer this style. Pros Easier to write, quick, less typing Cons If you have a complex code then it is hard to read, I use the pl <- pl + geom_classic() like syntax, If I have 30 charts in a report then I can easily search for it and comment it or modify it easily. Hope it helps. All the best.
hi, I have a problem when I want to run the following code to have a boxplot: boxplot(data_ind$Na~data_ind$Stations, range = 1.5, width = NULL, varwidth = FALSE, notch = FALSE, col = c("blue","red","orange","gray"), xlab = "", ylab = "Na %",) the following message appears: Error in plot.new() : figure margins too large. and the drawing does not appear the range of the variable Na% from 17.39 to 43.02
Hello You are not using the GGPLOT boxplot you are using the BASE R to plot your chart. You can try to use the dev.off() command to see if it works for you. Check the margings using this command par("mar") set the margins by the following command par(mar=c(1,1,1,1)) Here is an example library(tibble) data <- tribble(~ Gender, ~ Age , 'Male' , 80 , 'Male' , 40 , 'Male' , 60 , 'Male' , 70 , 'Female' , 80 , 'Female' , 30 , 'Female' , 40 , 'Female' , 50 , 'Female' , 60 , 'Female' , 70 , 'Female' , 150 ) dev.off() par(mar=c(1,1,1,1)) boxplot(formula = Age ~ Gender, data = data, col = c("red","blue"), xlab = "Patient Gender", ylab = "Patient Age") Hope it works for you.
Good morning Sir, I have analysed 750 soil samples for soil acidity in the state of Manipur, India. So, how can I develop the same maps in ggplot for my data. Kindly teach me
Hello, yes I assume that you have taken soil samples for tested for the soil acidity for Manipur, 750 locations is a good number, I will try to do a mockup.
Thank you. I have two datasets: case (d1) and control (d2). Both d1 (n=226) and d2 (n-=219) have unique persons per observation. I want to fuzzy_left_join matching d2 to d1 on gender (M/F), and age_in_months (lowage and highage based on +/- 6 months). Your tutorial worked, but my joined had n=3067 observations because multiple d2 meet the match criteria of gender and age range for every d1 observation. My problem: in the djoined of n=3067, if I remove duplicated d1 records and downsize to n=226, some unique records from d2 will be dropped and not represented. My request: how do I retain only (n=226) d1 observations, while maximizing the number of d2 matched without duplication? Thank you.
Hi, thanks for explaining your question very clearly. As you have a control dataset and a case dataset and one person will only appear in either the control or the case dataset, so you would not have a unique person ID to join the data. In your case you are joining the gender and the age range, is it possible to pick some other key which can help you ? The same record from d1 is joined to multiple rows in d2. Another way is to only take the first value in each group, so you group your joined dataset by gender, agegroup and pick the top1 using slice(1). Without looking at the data, I can only give generic advice which may not fit in your exact circumstances. If you are able to make some dummy data then put the code here, then I can give it a further try.
Thank you for this. But how can you interact with the chart that you created in R? Instead of clicking the Power BI chart, but rather clicking the R chart?
Hi the R charts reflect the changes in other POWERBI components, in the video it shows that when we select a particular product in a PowerBI chart then the R chart also get changed to reflect the selected product. But there are no controls within the R Chart to interact directly.
i tried running the gtsummary package and it shows errors because my variables are factors. So, I guess y9ou need to mention what type of variables work for the gtsummary cross tabs
Try filling the NAs with a string like 'Not Available' or 'Blank', but be aware that the NAs might be at each node level, so do this write at the start.
Hi, in this example the hexagons are controlled by the shape file, hence can't be changed to make them uniform. There are other methods which can achieve uniform size for the hexagons, as in that method the hexagons are not in the shape file but generated programatically. But the second method does not ensure that you would get one hexagon for each state.
Don’t the slashes in paths need to be forward slashes in R? Do you set slash direction in preferences?Also, why are there double slashes in this example?
Hi if the site is not working then just try hub.arcgis.com/content/cba8bddfa0ab43ddb35a7313376f9438/about www.indiaremotesensing.com/2017/01/download-india-shapefile-with-official.html www.igismap.com/download-india-administrative-boundary-shapefiles-states-districts-sub-districts-pincodes-constituencies/ www.researchgate.net/post/Suggestions_how_to_get_Shapefile_of_India_with_all_700_Indian_districts
@@DataAnalytic Is it possible to add different numerical values to the selected districts in the map? For eg. population size, number of govt. schools etc.
Hi, yes there are different libraries to do that. Here is a very simple example install.packages('"plot3D") library(plot3D) scatter3D(iris$Sepal.Length, iris$Petal.Length, iris$Sepal.Width) Also explore echarts4r .
Hi..thanks for your video...I´m having problems with geom_sankey maybe you can help me Error in `geom_sankey()`: ! Problem while computing stat. ℹ Error occurred in the 1st layer. Caused by error in `map()`: ℹ In index: 1. Caused by error in `dplyr::mutate()`: ℹ In argument: `dplyr::across(c(x, next_x), ~as.numeric(.), .names = ("n_{.col}"))`. Caused by error in `across()`: ! Can't select columns that don't exist. ✖ Column `next_x` doesn't exist. I verify and I have the columns next_X I appreciate you help
Looks like something is wrong with the data. There is a link in the description of the video which has the code with some sample data. If you have not seen it yet, then please try to run the code and see if you are able to get a plot. If you still have an issue, then paste some dummy data in the comment so that I can try it out.
Great job walking me through the construction of this plot. I don't utilize this plot design a great deal so I appreciate your tips and tricks. Thanks!
Hi, thanks. But why don't you use: cat(glue("There are **{nrow(diamonds)}** diamonds in the dataset.")) instead of: glue("There are **{nrow(diamonds)}** diamonds in the dataset.") Same output but the later one is simpler.
Correct, by default if you give the name of a variable, it gets printed so all three will give you same results. cat (glue('There were {nrow(diamonds)} diamonds in the dataset. ')) glue('There were {nrow(diamonds)} diamonds in the dataset. ') print(glue('There were {nrow(diamonds)} diamonds in the dataset. '))
Hi thanks for explaining, is it work with ggplotly? Cause I add images logo on geom_sf map with geom_image fonction but this doesn't work when add ggplotly, how can I do this 🥺
Thank you so much for this video! I am wondering if the highcharter package allows you to skip nodes for some observations. For example, I have three nodes. Some observations have values at all three nodes and this is straightforward (n1 > n2 > n3). However, some of my observations do not have an observation at n2. I would like for these observations to be depicted in the diagram as going directly from n1 > n3. Is this possible?
Hi there You can also have a look at the ggplot sankey plots, but it still will create an empy node at n2 level instead of going directly from n1 to n3. But I guess you have some control if you create your data in such a way so that the n2 and n3 are put at the same level, matter of experimenting it out.
Thank you so much for sharing the informative video. I want install ("import") SGDClassifier From sklearn.linear_model as shown below From sklearn.linear_model import SGDClassifier
Sir, I have a video request: Your dplyr playlist was my go-to treasure trove that helped my learning _ came across the fill() & tidy() functions in tidyverse _ but don't know what they function _ would you sir, help with a tutorial on the functions?
In some cases the sjPlot gives lots of features with very little code, eg. showing the perecentage and the frequency on a barchart. Also the histograms in sjPLOT are really cool. But of course everything is achievable using GGPLOT2. I personally like the sjPlot features for plotting the regression models. Using the plot_model www.rdocumentation.org/packages/sjPlot/versions/2.8.15/topics/plot_model.
Yes, you have pointed it right, these are kind of discrete values joined together with lines, though this chart was easier to demonstrate the techniques of annotations, otherwise with continuous data the chart was getting really busy.
Hi In the line chart (assuming that it has dates on X axis),if you have fewer points to display then you can nicely display them, if you have more points then try rotating the X axis labels. And if you still have more points then use the dual axis as we have shown in the video. One of the strategies should work for you. Hope I got your point correctly and answered accordingly, otherwise feel free to provide bit more information on what you want to do.