hello guys my name is khan and actually in today's video i will show you guys that how you can add image to your shiny dashboard and how you can add a video in your shiny dashboard so before starting i will show you guys that i will be using this folder and i will be using uh a code file that i have previously constructed for animated slider input in my previous video i have gone through in detail that what i have done but in this video i will be more talking about that how you will be able to import a picture or a video file into your shiny dashboard so within this folder where my this chord file is located i have also created a www folder so i will be telling you that what's the importance of this folder so if you need to add this add images or a video file to your dashboard you may need to construct a folder this www within the at within the folder where your code file is located and within my code file within this www folder i have this picture and i have this video file video one two three and so there are also some other ways that for which you don't need to have construct this folder you can simply place the picture within within the same folder where your code is located and the r shiny will automatically import that image from that folder there are two different ways i will go through each way one by one so i will first open the code file
so this is the code that we have constructed before I will just quickly run this code show you guys that what I have made what this code existing code is doing
so this existing code we have some we had an animated chart a bar chart so if I play it keeps on changing according to this slider input but in this video, I will not talk about the slider input and what this graph is doing we will be talking about how we will be able to import images are shiny and so what I will do so the first thing that I want to do or I will want to tell you guys that
that there are some when you use shiny package this the shiny package comes up with some HTML tags or you can say HTML functions which we also used in a previous video so the h4 is a kind of is actually an HTML tag so if you want to know that how you know which kind of tags uh shiny library provides you can simply write down here names and then tags
so these are the tags that we come up with the shiny library
so again you can see that we have used h1h for this kind of tags before we have also used I think dir tag which is somewhere here uh so we will be using so here you can see that in this video we will be using this video tag and we will be using uh
so we'll be using these two HTML tags for this video so let's go back to the code and first thing I want to do that under my main panel after this text output or plot output I want to have an image that is coming from this www folder and I want this folder this picture to be added into my shiny dashboard how can I do this so to do that I'll be writing the game not on that I am currently in my main panel and I will write down within my main panel I will say and I will start writing down
here write down okay to add an image I will be using a function image so but its image is an HTML tag so
so you can simply write down an image like this or I think a better way will be to write down tags dollar image and this thing will be coming when you will upload the shiny library in your r and within that so you guys will be not seeing that h4 is also an HTML tag why I haven't write down a text dollar image here you can also write down tax dollar image it will not give any error but it's a good practice to write down tax dollar image so you will come to know that you are using HTML tags and after that, I will be writing down because I have to tell where the source of the picture located for that src is equal to so the picture name is pic1 dot png
so I know that name is png but because of this image tag
the r will go to the folder where this chord is located and within that folder, the r shadow will look for the www folder and within that folder, it will look for this image file which will be named like this if there will be no www folder located you will get an error so make sure that you have created a folder in where your code is located by named as www and after that I will specify that what is the height and the width of that picture will be in my shiny dashboard height
#image #video Rshiny
R Shiny Playlist: • Learn Building R Shiny Dashboard with Us