myawesomepkg 0.1.4__py3-none-any.whl → 0.1.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,123 @@
1
+ 1. Print in R
2
+ r
3
+ Copy
4
+ Edit
5
+ print("Hello Boss!")
6
+ 🔹 2. Comments in R
7
+ r
8
+ Copy
9
+ Edit
10
+ # This is a single-line comment
11
+ 🔹 3. Variables in R
12
+ r
13
+ Copy
14
+ Edit
15
+ x <- 10
16
+ y <- "Data"
17
+ 🔹 4. Concatenate Elements
18
+ r
19
+ Copy
20
+ Edit
21
+ v <- c(1, 2, 3, 4)
22
+ print(v)
23
+ 🔹 5. Multiple Variables
24
+ r
25
+ Copy
26
+ Edit
27
+ a <- 5
28
+ b <- 10
29
+ c <- a + b
30
+ print(c)
31
+ 🔹 6. Variable Names
32
+ r
33
+ Copy
34
+ Edit
35
+ user_name <- "Boss"
36
+ user_age <- 25
37
+ 🔹 7. Data Types
38
+ r
39
+ Copy
40
+ Edit
41
+ num <- 10.5 # Numeric
42
+ str <- "Hello" # Character
43
+ bool <- TRUE # Logical
44
+ vec <- c(1, 2, 3) # Vector
45
+ 🔹 8. Strings
46
+ r
47
+ Copy
48
+ Edit
49
+ name <- "R Programming"
50
+ paste("Welcome to", name)
51
+ 🔹 9. Boolean
52
+ r
53
+ Copy
54
+ Edit
55
+ is_true <- TRUE
56
+ is_false <- FALSE
57
+ 🔹 10. Operators
58
+ r
59
+ Copy
60
+ Edit
61
+ a <- 10
62
+ b <- 3
63
+ a + b # Addition
64
+ a > b # Comparison
65
+ a == b # Equal
66
+ a %% b # Modulus
67
+ 🔹 11. If Else
68
+ r
69
+ Copy
70
+ Edit
71
+ x <- 10
72
+ if (x > 5) {
73
+ print("Greater than 5")
74
+ } else {
75
+ print("5 or less")
76
+ }
77
+ 🔹 12. List
78
+ r
79
+ Copy
80
+ Edit
81
+ my_list <- list(name="Boss", age=25, scores=c(90, 85))
82
+ print(my_list)
83
+ 🔹 13. Matrices
84
+ r
85
+ Copy
86
+ Edit
87
+ matrix_data <- matrix(1:6, nrow=2, ncol=3)
88
+ print(matrix_data)
89
+ 🔹 14. Data Frames
90
+ r
91
+ Copy
92
+ Edit
93
+ df <- data.frame(Name=c("A", "B"), Age=c(20, 25))
94
+ print(df)
95
+ 🔹 15. Functions
96
+ r
97
+ Copy
98
+ Edit
99
+ add_numbers <- function(x, y) {
100
+ return(x + y)
101
+ }
102
+ 🔹 16. Call a Function
103
+ r
104
+ Copy
105
+ Edit
106
+ result <- add_numbers(5, 3)
107
+ print(result)
108
+ 🔹 17. Global Variable
109
+ r
110
+ Copy
111
+ Edit
112
+ x <- 5
113
+ my_func <- function() {
114
+ x <<- 10 # Modify global x
115
+ }
116
+ my_func()
117
+ print(x)
118
+ 🔹 18. Vectors
119
+ r
120
+ Copy
121
+ Edit
122
+ my_vector <- c(1, 2, 3, 4, 5)
123
+ print(my_vector)
@@ -0,0 +1,32 @@
1
+ 1. Line Plot
2
+ r
3
+ Copy
4
+ Edit
5
+ x <- c(1, 2, 3, 4, 5)
6
+ y <- c(2, 4, 6, 8, 10)
7
+
8
+ plot(x, y, type="l", col="blue", main="Line Plot", xlab="X-axis", ylab="Y-axis")
9
+ 🔹 2. Scatter Plot
10
+ r
11
+ Copy
12
+ Edit
13
+ x <- c(1, 2, 3, 4, 5)
14
+ y <- c(5, 3, 6, 2, 7)
15
+
16
+ plot(x, y, main="Scatter Plot", xlab="X", ylab="Y", col="red", pch=19)
17
+ 🔹 3. Pie Chart
18
+ r
19
+ Copy
20
+ Edit
21
+ slices <- c(10, 20, 30, 40)
22
+ labels <- c("A", "B", "C", "D")
23
+
24
+ pie(slices, labels=labels, main="Pie Chart")
25
+ 🔹 4. Bar Chart
26
+ r
27
+ Copy
28
+ Edit
29
+ values <- c(5, 10, 15, 20)
30
+ names <- c("A", "B", "C", "D")
31
+
32
+ barplot(values, names.arg=names, col="green", main="Bar Chart", ylab="Values")
@@ -0,0 +1,53 @@
1
+ ✅ Step 1: Install & Load ggplot2
2
+ r
3
+ Copy
4
+ Edit
5
+ install.packages("ggplot2") # Run once
6
+ library(ggplot2)
7
+ ✅ Step 2: Sample Data
8
+ r
9
+ Copy
10
+ Edit
11
+ data <- data.frame(
12
+ category = rep(c("A", "B", "C"), each=4),
13
+ subcat = rep(c("X", "Y"), times=6),
14
+ value = c(4, 7, 6, 9, 5, 3, 8, 4, 7, 5, 6, 2)
15
+ )
16
+ ✅ Step 3: Basic ggplot
17
+ r
18
+ Copy
19
+ Edit
20
+ ggplot(data, aes(x=subcat, y=value)) +
21
+ geom_bar(stat="identity", fill="steelblue") +
22
+ ggtitle("Basic Bar Chart")
23
+ ✅ Step 4: Facets
24
+ r
25
+ Copy
26
+ Edit
27
+ ggplot(data, aes(x=subcat, y=value)) +
28
+ geom_bar(stat="identity", fill="tomato") +
29
+ facet_wrap(~ category) +
30
+ ggtitle("Faceted by Category")
31
+ ✅ Step 5: Geometric Objects
32
+ r
33
+ Copy
34
+ Edit
35
+ ggplot(data, aes(x=subcat, y=value, fill=category)) +
36
+ geom_bar(stat="identity", position="dodge") + # Bar chart
37
+ geom_point(aes(color=category), size=3, shape=21) + # Add points
38
+ ggtitle("Geometric Objects: Bars + Points")
39
+ ✅ Step 6: Position Adjustment
40
+ r
41
+ Copy
42
+ Edit
43
+ ggplot(data, aes(x=subcat, y=value, fill=category)) +
44
+ geom_bar(stat="identity", position=position_dodge(width=0.7)) +
45
+ ggtitle("Position: Dodge for Side-by-Side Bars")
46
+ ✅ Step 7: Coordinate System (Flip Axis)
47
+ r
48
+ Copy
49
+ Edit
50
+ ggplot(data, aes(x=subcat, y=value, fill=category)) +
51
+ geom_bar(stat="identity") +
52
+ coord_flip() +
53
+ ggtitle("Flipped Coordinates")