Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Programming Articles
Page 11 of 2545
How to increase the width of the median line in boxplot using ggplot2 in R?
The default width of the median line is wider than the rest of the lines that represent minimum, first quartile, third quartile or maximum but we can make it a little wider to make it more appealing. This can be done with the help of fatten argument inside geom_boxplot function, the default value of fatten is 2.Exampleggplot(df,aes(x,y))+geom_boxplot(fatten=6)Output
Read MoreExplain about logical not(!) operator in detail with example in javascript?
NOT operatorThe logical NOT operator gives true for false values and false for true values. var x = 200; var y = 300; document.getElementById("logical").innerHTML = !(x < y) + "" + !(x > y); Outputfalse true
Read MoreWrite a number array and add only odd numbers?
Odd number summation using JavaScript. var tot = 0; var a = [1,45,78,9,78,40,67,76]; for(var i = 0; i
Read MoreDifference Between Daemon Threads and User Threads In Java
As we know java is a language that supports multi threading and on the basis of nature threads in java are classified into two types Daemon thread and User thread.The following are the important differences between Daemon Threads and User Threads.Sr. No.KeyDaemon ThreadsUser Threads1NatureDaemon thread is low in priority i.e JVM does not care much about these types of threads.User threads are recognized as high priority thread i.e. JVM will wait for any active user thread to get completed.2CPU availabilityIt is not guaranteed that Daemon thread always gets CPU usage whenever it requires due to its low priority.User thread always ...
Read MoreHow to display output in javascript?
There are 4 ways to display the output in JavaScript. a) Displaying the output in HTML elements, using innerHTML attribute. alert(2 + 3); In alert window box, the output5In case of handling json strings, or some other big data console.log is the best choice.
Read MoreHow to highlight text inside a plot created by ggplot2 using a box in R?
There might be many ways to highlight text inside a plot but the easiest one would be using geom_label function of ggplot2 package, with the help of this function we can put the required text and the aesthetics of that text by using a single line of code. It is highly recommended that we should use geom_label function with desired specifications.Examplelibrary(ggplot2) ggplot(df,aes(x))+geom_histogram(bins=30)+geom_label(aes(x=6,y=450,label="Normal Distribution"),fill="red")Output
Read MoreWhat are the types of tags involved in javascript?
Html taga) The tag is used to define a client-side script.b) The tag contains scripting statements or an external script file.JavaScript code must be keep in script tag.Let's see the use of the tag. For suppose declare the variable outside the script tag. var a = 1; var b = 2; var c = a + b; document.getElementById("tag").innerHTML = c; Output3
Read MoreHow to subset a data frame by excluding a specific text value in an R data frame?
To create a subset based on text value we can use rowSums function by defining the sums for the text equal to zero, this will help us to drop all the rows that contains that specific text value. For example, if we have a data frame df that contains A in many columns then all the rows of df excluding A can be selected as−df[rowSums(df=="A")==0, , drop=FALSE]Exampledf[rowSums(df=="E")==0, , drop=FALSE] Output x1 x2 x3 x4 x5 1 A D B C C 2 B D D D D 3 B A D D D 5 C D C C C 10 C ...
Read MoreHow to convert MANOVA data frame for two-dependent variables into a count table in R?
MANOVA refers to multivariate analysis of variance, in this method we have more than one dependent variable and multiple independent variables. We want to compare each level of the independent variable combination for each of the dependent variables. To convert MANOVA data frame for two-dependent variables into a count table, we can use cast function of reshape package but we need to melt the data frame first so that the casting can be done appropriately.ExampleID
Read MoreSort the words in lexicographical order in C#
Firstly, set a string array −string[] arr = new string[] { "Indian", "Moroccon", "American", };To sort the words in lexicographical order −var sort = from a in arr orderby a select a;Exampleusing System; using System.Linq; class Program { static void Main() { string[] arr = new string[] { "Indian", "Moroccon", "American", }; var sort = from a in arr orderby a select a; foreach(string res in sort) { Console.WriteLine(res); } } }outputAmerican Indian Moroccon
Read More