Extracting HSV values from RGB Error--R - r

I am trying to extract HSV values from my previously collect RGB values, but I am running into an error that I don't understand.
Using the code > Hmean<-rgb2hsv(Hmean, maxColorValue=255)
I get the error:
Error in if (any(0 > rgb) || any(rgb > 1)) stop("rgb values must be in [0, maxColorValue]") :
missing value where TRUE/FALSE needed
Any help would be greatly appreciated! I am new to R and am really not sure where to go from here.
EDIT
I have added my data below:
Hmean <- structure(list(`BIOUG06754-A02` = c(60.517, 68.521, 107.304),
`BIOUG06754-A04` = c(150.321, 142.084, 136.413), `BIOUG06754-A05` = c(147.89,
133.011, 92.305), `BIOUG06754-A06` = c(122.536, 131.516,
153.172), `BIOUG06754-A07` = c(123.994, 122.671, 129.04),
`BIOUG06754-A11` = c(103.295, 96.326, 97.662), `BIOUG06754-A12` = c(143.705,
125.768, 99.034), `BIOUG06754-B01` = c(80.218, 84.49, 105.947
), `BIOUG06754-B03` = c(150.792, 153.816, 177.636), `BIOUG06754-B04` = c(171.702,
150.65, 143.737), `BIOUG06754-B05` = c(180.981, 161.6, 129.986
), `BIOUG06754-B06` = c(138.058, 130, 130.393), `BIOUG06754-B07` = c(179.172,
170.086, 148.312), `BIOUG06754-B08` = c(124.126, 121.128,
110.269), `BIOUG06754-B10` = c(162.904, 140.356, 84.089),
`BIOUG06754-B11` = c(149.631, 137.925, 122.061), `BIOUG06754-B12` = c(129.984,
125.308, 126.05), `BIOUG06754-C01` = c(146.569, 148.399,
191.916), `BIOUG06754-C02` = c(81.706, 72.88, 90.784), `BIOUG06754-C05` = c(107.256,
80.714, 111.902), `BIOUG06754-C07` = c(56.156, 61.983, 102.082
), `BIOUG06754-C09` = c(176.229, 144.778, 98.893), `BIOUG06754-C11` = c(141.205,
144.914, 123.44), `BIOUG06754-C12` = c(140.845, 137.706,
123.588), `BIOUG06754-D01` = c(134.978, 137.257, 143.5),
`BIOUG06754-D03` = c(99.99, 99.829, 94.698), `BIOUG06754-D06` = c(92.634,
70.545, 45.073), `BIOUG06754-D09` = c(172.178, 160.303, 126.69
), `BIOUG06754-D10` = c(166.664, 151.808, 128.265), `BIOUG06754-D11` = c(160.247,
122.13, 77.719), `BIOUG06754-D12` = c(153.807, 152.699, 170.198
), `BIOUG06754-E01` = c(135.272, 133.118, 155.628), `BIOUG06754-E05` = c(124.053,
114.822, 85.961), `BIOUG06754-E07` = c(157.281, 121.47, 53.801
), `BIOUG06754-E08` = c(77.183, 76.687, 75.278), `BIOUG06754-E09` = c(112.063,
109.666, 107.04), `BIOUG06754-E11` = c(93.102, 87.039, 79.305
), `BIOUG06754-F01` = c(165.828, 147.252, 119.478), `BIOUG06754-F02` = c(197.223,
185.272, 159.957), `BIOUG06754-F04` = c(152.897, 136.457,
141.096), `BIOUG06754-F05` = c(117.035, 119.651, 145.869),
`BIOUG06754-F06` = c(185.506, 173.124, 157.736), `BIOUG06754-F12` = c(148.994,
140.52, 165.125), `BIOUG06754-G01` = c(128.958, 122.56, 113.381
), `BIOUG06754-G02` = c(144.513, 136.457, 128.134), `BIOUG06754-G08` = c(113.76,
106.878, 98.195), `BIOUG06754-G09` = c(95.095, 87.19, 104.044
), `BIOUG06754-G10` = c(106.903, 112.908, 132.635), `BIOUG06754-G12` = c(153.118,
131.854, 129.546), `BIOUG06754-H01` = c(166.928, 171.271,
174.863), `BIOUG06754-H02` = c(192.864, 166.996, 103.896),
`BIOUG06754-H03` = c(119.428, 116.207, 107.578), `BIOUG06754-H06` = c(156.38,
157.738, 166.2), `BIOUG06754-H07` = c(200.05, 193.561, 180.402
), `BIOUG06754-H08` = c(138.912, 141.456, 139.468), `BIOUG07431-A01` = c(196.442,
194.256, 198.569), `BIOUG07431-A02` = c(199.362, 203.439,
221.293), `BIOUG07431-A04` = c(110.508, 109.606, 125.026),
`BIOUG07431-A05` = c(154.941, 142.16, 162.201), `BIOUG07431-A07` = c(133.31,
124.794, 166.369), `BIOUG07431-A08` = c(152.72, 145.893,
161.726), `BIOUG07431-A11` = c(193.428, 195.137, 202.514),
`BIOUG07431-B01` = c(173.636, 158.312, 166.014), `BIOUG07431-B03` = c(113.928,
101.418, 119.616), `BIOUG07431-B04` = c(158.961, 149.822,
135.504), `BIOUG07431-B05` = c(181.021, 160.866, 135.597),
`BIOUG07431-B06` = c(166.364, 166.912, 165.706), `BIOUG07431-B08` = c(108.665,
100.64, 109.878), `BIOUG07431-B09` = c(112.773, 116.487,
136.531), `BIOUG07431-B10` = c(108.834, 103.844, 115.001),
`BIOUG07431-B11` = c(86.766, 97.206, 144.516), `BIOUG07431-C02` = c(98.251,
88.443, 127.958), `BIOUG07431-C05` = c(113.635, 117.251,
133.339), `BIOUG07431-C06` = c(115.451, 119.857, 149.481),
`BIOUG07431-C08` = c(159.056, 128.007, 110.938), `BIOUG07431-C12` = c(126.557,
125.67, 126.041), `BIOUG07431-D01` = c(214.479, 191.064,
143.42), `BIOUG07431-D02` = c(180.004, 173.532, 161.336),
`BIOUG07431-D03` = c(201.794, 192.762, 179.586), `BIOUG07431-D04` = c(125.512,
132.976, 163.184), `BIOUG07431-D05` = c(142.465, 124.835,
113.436), `BIOUG07431-D06` = c(185.26, 186.626, 208.822),
`BIOUG07431-D07` = c(195.833, 198.765, 205.444), `BIOUG07431-D09` = c(124.785,
124.127, 144.171), `BIOUG07431-D12` = c(129.071, 140.159,
171.218), `BIOUG07431-E02` = c(182.027, 182.472, 180.621),
`BIOUG07431-E03` = c(126.32, 126.024, 133.868), `BIOUG07431-E04` = c(89.118,
72.014, 46.126), `BIOUG07431-E05` = c(125.737, 117.231, 154.487
), `BIOUG07431-E06` = c(161.714, 152.781, 130.912), `BIOUG07431-E07` = c(149.006,
144.284, 132.184), `BIOUG07431-E09` = c(118.235, 116.151,
123.239), `BIOUG07431-E12` = c(161.982, 163.57, 195.893),
`BIOUG07431-F01` = c(210.534, 183.649, 136.178), `BIOUG07431-F06` = c(143.074,
129.267, 105.536), `BIOUG07431-G03` = c(194.663, 168.915,
137.132), `BIOUG07431-G06` = c(125.605, 92.018, 61.595),
`BIOUG07431-G07` = c(162.248, 143.445, 169.436), `BIOUG07431-G09` = c(197.991,
197.706, 197.506), `BIOUG07431-G10` = c(156.518, 145.15,
156.341), `BIOUG07431-G11` = c(154.482, 141.215, 144.517),
`BIOUG07431-H01` = c(120.332, 122.402, 140.211), `BIOUG07431-H02` = c(153.665,
148.427, 159.549), `BIOUG07431-H04` = c(239.422, 214.916,
171.416), `BIOUG07431-H06` = c(194.847, 181.091, 139.541),
`BIOUG07431-H07` = c(200.076, 193.944, 181.532), `BIOUG07797-A01` = c(148.506,
146.768, 173.34), `BIOUG07797-A02` = c(147.511, 144.895,
189.464), `BIOUG07797-A03` = c(222.678, 225.497, 230.171),
`BIOUG07797-A05` = c(119.967, 131.053, 203.64), `BIOUG07797-A08` = c(104.015,
108.071, 124.549), `BIOUG07797-A09` = c(164.519, 159.228,
140.04), `BIOUG07797-A11` = c(189.19, 182.955, 189.946),
`BIOUG07797-B01` = c(106.99, 110.57, 141.549), `BIOUG07797-B02` = c(113.587,
110.997, 149.402), `BIOUG07797-C01` = c(117.026, 114.161,
128.523), `BIOUG07797-C04` = c(83.18, 84.456, 111.268), `BIOUG07797-C05` = c(118.447,
119.369, 156.932), `BIOUG07797-C06` = c(176.7, 165.73, 139.284
), `BIOUG07797-C11` = c(148.172, 127.719, 122.872), `BIOUG07797-D02` = c(106.939,
95.452, 108.28), `BIOUG07797-D10` = c(143.813, 130.423, 111.83
), `BIOUG07797-F03` = c(78.894, 54.359, 50.642), `BIOUG07797-F04` = c(145.08,
123.273, 117.647), `BIOUG07797-F06` = c(235.565, 180.099,
56.442), `BIOUG07797-F07` = c(180.997, 183.258, 183.278),
`BIOUG07797-G11` = c(170.54, 175.451, 170.098), `BIOUG07797-H01` = c(190.966,
188.429, 166.054), `BIOUG07797-H09` = c(90.894, 85.603, 111.644
), `BIOUG09330-A02` = c(78.074, 91.958, 152.859), `BIOUG09330-A03` = c(117.371,
130.345, 172.74), `BIOUG09330-A04` = c(91.953, 110.488, 159.267
), `BIOUG09330-A05` = c(108.764, 95.986, 109.759), `BIOUG09330-A06` = c(150.302,
107.83, 73.904), `BIOUG09330-A07` = c(97.401, 120.961, 211.18
), `BIOUG09330-A09` = c(74.834, 79.806, 120.349), `BIOUG09330-A10` = c(95.294,
96.306, 144.771), `BIOUG09330-A11` = c(64.172, 45.898, 71.995
), `BIOUG09330-A12` = c(117.116, 126.698, 168.934), `BIOUG09330-B01` = c(52.654,
64.766, 128.408), `BIOUG09330-B02` = c(107.182, 133.682,
188.383), `BIOUG09330-B04` = c(125.463, 91.091, 43.414),
`BIOUG09330-B05` = c(NA_real_, NA_real_, NA_real_), `BIOUG09330-B06` = c(56.263,
54.981, 81.805), `BIOUG09330-B07` = c(162.31, 159.495, 166.396
), `BIOUG09330-B08` = c(125.672, 122.209, 116.596), `BIOUG09330-B09` = c(135.056,
129.756, 162.686), `BIOUG09330-B10` = c(202.435, 208.733,
241.3), `BIOUG09330-B11` = c(169.697, 156.222, 141.06), `BIOUG09330-B12` = c(128.235,
102.118, 106.082), `BIOUG09330-C01` = c(98.755, 122.772,
209.765), `BIOUG09330-C02` = c(NA_real_, NA_real_, NA_real_
), `BIOUG09330-C05` = c(158.578, 130.13, 69.21), `BIOUG09330-C08` = c(103.718,
117.53, 147.786), `BIOUG09330-D02` = c(117.738, 114.214,
118.959), `BIOUG09330-D04` = c(130.504, 122.31, 138.672),
`BIOUG09330-D06` = c(218.095, 195.467, 144.224), `BIOUG09330-D07` = c(157.568,
145.151, 91.566), `BIOUG09330-D08` = c(175.808, 172.062,
161.954), `BIOUG09330-D09` = c(144.897, 157.836, 189.74),
`BIOUG09330-D11` = c(76.909, 88.817, 121.806), `BIOUG09330-D12` = c(124.881,
126.963, 171.977), `BIOUG09330-E05` = c(129.372, 127.583,
187.464), `BIOUG09330-E08` = c(88.864, 103.971, 212.299),
`BIOUG09330-E09` = c(64.557, 72.148, 138.387), `BIOUG09330-E11` = c(135.383,
141.872, 165.028), `BIOUG09330-E12` = c(157.918, 167.997,
181.808), `BIOUG09330-F04` = c(70.144, 79.535, 180.141),
`BIOUG09330-F05` = c(70.921, 70.844, 104.806), `BIOUG09330-F09` = c(124.519,
129.736, 189.402), `BIOUG09330-F10` = c(210.979, 205.764,
212.236), `BIOUG09330-F11` = c(190.944, 183.007, 157.038),
`BIOUG09330-F12` = c(211.616, 155.883, 39.493), `BIOUG09330-G01` = c(108.666,
120.852, 159.902), `BIOUG09330-G02` = c(156.677, 146.856,
135.241), `BIOUG09330-G03` = c(130.527, 137.194, 144.195),
`BIOUG09330-G04` = c(84.576, 81.307, 105.66), `BIOUG09330-G05` = c(144.604,
147.933, 177.82), `BIOUG09330-G06` = c(158.099, 155.194,
175.577), `BIOUG09330-G07` = c(74.709, 67.784, 102.697),
`BIOUG09330-G08` = c(76.496, 74.44, 107.494), `BIOUG09330-G09` = c(183.169,
192.008, 235.085), `BIOUG09330-G10` = c(184.362, 180.48,
159.234), `BIOUG09330-G12` = c(77.055, 86.239, 143.91), `BIOUG09330-H06` = c(74.967,
79.455, 144.986), `BIOUG09330-H07` = c(70.484, 70.173, 105.897
), `BIOUG09330-H09` = c(174.575, 150.184, 80.233), `BIOUG09331-A03` = c(129.706,
113.527, 74.197), `BIOUG09331-A04` = c(136.851, 129.773,
117.237), `BIOUG09331-A05` = c(157.295, 147.808, 124.672),
`BIOUG09331-A06` = c(92.13, 90.853, 93.149), `BIOUG09331-A07` = c(144.478,
120.684, 78.015), `BIOUG09331-A08` = c(136.908, 122.667,
88.92), `BIOUG09331-A09` = c(135.86, 106.256, 55.891), `BIOUG09331-A10` = c(203.39,
157.816, 91.879), `BIOUG09331-A11` = c(138.371, 123.186,
96.59), `BIOUG09331-A12` = c(95.404, 88.144, 78.755), `BIOUG09331-B01` = c(91.657,
76.132, 73.637), `BIOUG09331-B03` = c(114.362, 97.15, 87.333
), `BIOUG09331-B04` = c(125.27, 114.192, 111.006), `BIOUG09331-B05` = c(238.213,
199.398, 99.51), `BIOUG09331-B06` = c(162.797, 133.397, 96.207
), `BIOUG09331-B07` = c(170.996, 152.071, 91.138), `BIOUG09331-B08` = c(90.596,
83.036, 85.444), `BIOUG09331-B09` = c(78.688, 71.075, 89.184
), `BIOUG09331-B10` = c(125.612, 113.445, 109.073), `BIOUG09331-B11` = c(145.36,
129.069, 106.892), `BIOUG09331-B12` = c(106.722, 100.317,
89.757), `BIOUG09331-C01` = c(218.155, 179.369, 88.206),
`BIOUG09331-C03` = c(90.819, 93.85, 127.7), `BIOUG09331-C04` = c(141.697,
133.081, 128.473), `BIOUG09331-C08` = c(80.76, 78.165, 84.414
), `BIOUG09331-C09` = c(99.405, 91.629, 88.325), `BIOUG09331-C10` = c(160.779,
152.102, 128.027), `BIOUG09331-C11` = c(146.007, 121.818,
123.986), `BIOUG09331-C12` = c(155.322, 126.561, 76.122),
`BIOUG09331-D01` = c(114.51, 108.85, 106.159), `BIOUG09331-D02` = c(168.561,
158.569, 142.675), `BIOUG09331-D03` = c(93.604, 77.639, 72.308
), `BIOUG09331-D04` = c(115.836, 106.453, 97.403), `BIOUG09331-D05` = c(201.406,
168.583, 121.714), `BIOUG09331-D06` = c(64.72, 39.534, 61.58
), `BIOUG09331-D07` = c(104.396, 90.888, 88.357), `BIOUG09331-D08` = c(190.058,
162.695, 122.753), `BIOUG09331-D09` = c(130.358, 119.073,
113.842), `BIOUG09331-D10` = c(208.173, 184.573, 150.762),
`BIOUG09331-D11` = c(75.621, 68.526, 100.973), `BIOUG09331-D12` = c(120.384,
113.948, 126.971), `BIOUG09331-E02` = c(131.588, 105.849,
112.459), `BIOUG09331-E05` = c(165.058, 153.182, 136.807),
`BIOUG09331-E08` = c(205.842, 149.21, 46.914), `BIOUG09331-E09` = c(119.88,
96.932, 81.06), `BIOUG09331-E10` = c(142.077, 129.643, 113.374
), `BIOUG09331-E11` = c(174.945, 158.418, 140.231), `BIOUG09331-E12` = c(190.955,
157.802, 101.379), `BIOUG09331-F02` = c(149.787, 134.032,
118.371), `BIOUG09331-F03` = c(165.562, 153.43, 129.294),
`BIOUG09331-F04` = c(137.762, 130.078, 114.159), `BIOUG09331-F05` = c(154.205,
137.268, 113.15), `BIOUG09331-F06` = c(139.79, 114.26, 79.178
), `BIOUG09331-F07` = c(164.205, 143.319, 124.28), `BIOUG09331-F08` = c(103.566,
91.445, 117.365), `BIOUG09331-F09` = c(129.748, 116.184,
112.51), `BIOUG09331-F10` = c(89.52, 82.218, 92.811), `BIOUG09331-G03` = c(193.037,
167.988, 161.19), `BIOUG09331-G04` = c(66.484, 61.662, 107.38
), `BIOUG09331-G05` = c(78.386, 79.355, 127.106), `BIOUG09331-G06` = c(130.345,
121.306, 157.942), `BIOUG09331-G10` = c(228.768, 220.396,
213.442), `BIOUG09331-G11` = c(74.002, 66.019, 115.924),
`BIOUG09331-H02` = c(205.078, 182.418, 134.441), `BIOUG09331-H06` = c(175.326,
173.91, 203.724), `BIOUG09331-H08` = c(173.58, 158.376, 136.998
), `BIOUG09331-H09` = c(81.942, 83.35, 141.956), `BIOUG09331-H10` = c(54.907,
59.226, 100.034), `BIOUG09331-H11` = c(104.378, 99.155, 120
), `BIOUG09332-A01` = c(144.726, 137.16, 172.673), `BIOUG09332-A03` = c(165.363,
159.332, 152.342), `BIOUG09332-A05` = c(199.72, 201.405,
204.246), `BIOUG09332-A06` = c(161.826, 164.125, 180.692),
`BIOUG09332-A07` = c(136.393, 145.575, 171.102), `BIOUG09332-A08` = c(128.538,
131.427, 152.795), `BIOUG09332-A10` = c(184.266, 174.629,
162.196), `BIOUG09332-B03` = c(208.574, 207.05, 205.724),
`BIOUG09332-B05` = c(101.794, 110.731, 155.385), `BIOUG09332-B07` = c(122.239,
112.155, 127.472), `BIOUG09332-B09` = c(187.713, 182.566,
170.627), `BIOUG09332-B11` = c(133.217, 133.466, 129.422),
`BIOUG09332-C01` = c(101.814, 91.709, 107.163), `BIOUG09332-C03` = c(91.116,
96.167, 131.836), `BIOUG09332-C05` = c(160.936, 156.711,
152.594), `BIOUG09332-C06` = c(149.988, 137.356, 110.038),
`BIOUG09332-C07` = c(126.787, 121.185, 127.856), `BIOUG09332-C09` = c(108.19,
120.506, 190.562), `BIOUG09332-C11` = c(175.914, 167.613,
170.927), `BIOUG09332-C12` = c(82.267, 78.821, 94.969), `BIOUG09332-D01` = c(68.758,
70.229, 93.4), `BIOUG09332-D09` = c(144.802, 138.01, 151.703
), `BIOUG09332-E01` = c(88.358, 92.77, 132.612), `BIOUG09332-E05` = c(106.86,
59.931, 66.577), `BIOUG09332-E09` = c(197.423, 189.931, 176.184
), `BIOUG09332-E10` = c(151.695, 121.97, 69.789), `BIOUG09332-E11` = c(74.158,
63.902, 68.372), `BIOUG09332-F06` = c(109.16, 120.619, 174.715
), `BIOUG09332-F09` = c(144.682, 120.658, 129.593), `BIOUG09332-F11` = c(137.976,
113.727, 87.593), `BIOUG09332-G02` = c(182.113, 145.291,
84.664), `BIOUG09332-G03` = c(150.52, 121.721, 96.076), `BIOUG09332-G04` = c(175.154,
165.939, 163.944), `BIOUG09332-G05` = c(217.682, 203.291,
184.977), `BIOUG09332-G06` = c(154.436, 116.008, 59.53),
`BIOUG09332-G08` = c(177.95, 142.221, 93.299), `BIOUG09332-G09` = c(213.532,
166.837, 79.52), `BIOUG09332-G11` = c(194.616, 164.073, 126.89
), `BIOUG09332-H01` = c(151.457, 133.94, 142.631), `BIOUG09332-H06` = c(99.24,
68.681, 52.919), `BIOUG09332-H07` = c(218.904, 150.498, 4.059
), `BIOUG09332-H08` = c(173.864, 142.466, 109.555), `BIOUG09332-H09` = c(195.81,
156.113, 72.609), `BIOUG09332-H10` = c(178.388, 164.201,
154.31), `BIOUG09332-H11` = c(149.498, 136.439, 122.352)), .Names =
c("BIOUG06754-A02",
"BIOUG06754-A04", "BIOUG06754-A05", "BIOUG06754-A06", "BIOUG06754-A07",
"BIOUG06754-A11", "BIOUG06754-A12", "BIOUG06754-B01", "BIOUG06754-B03",
"BIOUG06754-B04", "BIOUG06754-B05", "BIOUG06754-B06", "BIOUG06754-B07",
"BIOUG06754-B08", "BIOUG06754-B10", "BIOUG06754-B11", "BIOUG06754-B12",
"BIOUG06754-C01", "BIOUG06754-C02", "BIOUG06754-C05", "BIOUG06754-C07",
"BIOUG06754-C09", "BIOUG06754-C11", "BIOUG06754-C12", "BIOUG06754-D01",
"BIOUG06754-D03", "BIOUG06754-D06", "BIOUG06754-D09", "BIOUG06754-D10",
"BIOUG06754-D11", "BIOUG06754-D12", "BIOUG06754-E01", "BIOUG06754-E05",
"BIOUG06754-E07", "BIOUG06754-E08", "BIOUG06754-E09", "BIOUG06754-E11",
"BIOUG06754-F01", "BIOUG06754-F02", "BIOUG06754-F04", "BIOUG06754-F05",
"BIOUG06754-F06", "BIOUG06754-F12", "BIOUG06754-G01", "BIOUG06754-G02",
"BIOUG06754-G08", "BIOUG06754-G09", "BIOUG06754-G10", "BIOUG06754-G12",
"BIOUG06754-H01", "BIOUG06754-H02", "BIOUG06754-H03", "BIOUG06754-H06",
"BIOUG06754-H07", "BIOUG06754-H08", "BIOUG07431-A01", "BIOUG07431-A02",
"BIOUG07431-A04", "BIOUG07431-A05", "BIOUG07431-A07", "BIOUG07431-A08",
"BIOUG07431-A11", "BIOUG07431-B01", "BIOUG07431-B03", "BIOUG07431-B04",
"BIOUG07431-B05", "BIOUG07431-B06", "BIOUG07431-B08", "BIOUG07431-B09",
"BIOUG07431-B10", "BIOUG07431-B11", "BIOUG07431-C02", "BIOUG07431-C05",
"BIOUG07431-C06", "BIOUG07431-C08", "BIOUG07431-C12", "BIOUG07431-D01",
"BIOUG07431-D02", "BIOUG07431-D03", "BIOUG07431-D04", "BIOUG07431-D05",
"BIOUG07431-D06", "BIOUG07431-D07", "BIOUG07431-D09", "BIOUG07431-D12",
"BIOUG07431-E02", "BIOUG07431-E03", "BIOUG07431-E04", "BIOUG07431-E05",
"BIOUG07431-E06", "BIOUG07431-E07", "BIOUG07431-E09", "BIOUG07431-E12",
"BIOUG07431-F01", "BIOUG07431-F06", "BIOUG07431-G03", "BIOUG07431-G06",
"BIOUG07431-G07", "BIOUG07431-G09", "BIOUG07431-G10", "BIOUG07431-G11",
"BIOUG07431-H01", "BIOUG07431-H02", "BIOUG07431-H04", "BIOUG07431-H06",
"BIOUG07431-H07", "BIOUG07797-A01", "BIOUG07797-A02", "BIOUG07797-A03",
"BIOUG07797-A05", "BIOUG07797-A08", "BIOUG07797-A09", "BIOUG07797-A11",
"BIOUG07797-B01", "BIOUG07797-B02", "BIOUG07797-C01", "BIOUG07797-C04",
"BIOUG07797-C05", "BIOUG07797-C06", "BIOUG07797-C11", "BIOUG07797-D02",
"BIOUG07797-D10", "BIOUG07797-F03", "BIOUG07797-F04", "BIOUG07797-F06",
"BIOUG07797-F07", "BIOUG07797-G11", "BIOUG07797-H01", "BIOUG07797-H09",
"BIOUG09330-A02", "BIOUG09330-A03", "BIOUG09330-A04", "BIOUG09330-A05",
"BIOUG09330-A06", "BIOUG09330-A07", "BIOUG09330-A09", "BIOUG09330-A10",
"BIOUG09330-A11", "BIOUG09330-A12", "BIOUG09330-B01", "BIOUG09330-B02",
"BIOUG09330-B04", "BIOUG09330-B05", "BIOUG09330-B06", "BIOUG09330-B07",
"BIOUG09330-B08", "BIOUG09330-B09", "BIOUG09330-B10", "BIOUG09330-B11",
"BIOUG09330-B12", "BIOUG09330-C01", "BIOUG09330-C02", "BIOUG09330-C05",
"BIOUG09330-C08", "BIOUG09330-D02", "BIOUG09330-D04", "BIOUG09330-D06",
"BIOUG09330-D07", "BIOUG09330-D08", "BIOUG09330-D09", "BIOUG09330-D11",
"BIOUG09330-D12", "BIOUG09330-E05", "BIOUG09330-E08", "BIOUG09330-E09",
"BIOUG09330-E11", "BIOUG09330-E12", "BIOUG09330-F04", "BIOUG09330-F05",
"BIOUG09330-F09", "BIOUG09330-F10", "BIOUG09330-F11", "BIOUG09330-F12",
"BIOUG09330-G01", "BIOUG09330-G02", "BIOUG09330-G03", "BIOUG09330-G04",
"BIOUG09330-G05", "BIOUG09330-G06", "BIOUG09330-G07", "BIOUG09330-G08",
"BIOUG09330-G09", "BIOUG09330-G10", "BIOUG09330-G12", "BIOUG09330-H06",
"BIOUG09330-H07", "BIOUG09330-H09", "BIOUG09331-A03", "BIOUG09331-A04",
"BIOUG09331-A05", "BIOUG09331-A06", "BIOUG09331-A07", "BIOUG09331-A08",
"BIOUG09331-A09", "BIOUG09331-A10", "BIOUG09331-A11", "BIOUG09331-A12",
"BIOUG09331-B01", "BIOUG09331-B03", "BIOUG09331-B04", "BIOUG09331-B05",
"BIOUG09331-B06", "BIOUG09331-B07", "BIOUG09331-B08", "BIOUG09331-B09",
"BIOUG09331-B10", "BIOUG09331-B11", "BIOUG09331-B12", "BIOUG09331-C01",
"BIOUG09331-C03", "BIOUG09331-C04", "BIOUG09331-C08", "BIOUG09331-C09",
"BIOUG09331-C10", "BIOUG09331-C11", "BIOUG09331-C12", "BIOUG09331-D01",
"BIOUG09331-D02", "BIOUG09331-D03", "BIOUG09331-D04", "BIOUG09331-D05",
"BIOUG09331-D06", "BIOUG09331-D07", "BIOUG09331-D08", "BIOUG09331-D09",
"BIOUG09331-D10", "BIOUG09331-D11", "BIOUG09331-D12", "BIOUG09331-E02",
"BIOUG09331-E05", "BIOUG09331-E08", "BIOUG09331-E09", "BIOUG09331-E10",
"BIOUG09331-E11", "BIOUG09331-E12", "BIOUG09331-F02", "BIOUG09331-F03",
"BIOUG09331-F04", "BIOUG09331-F05", "BIOUG09331-F06", "BIOUG09331-F07",
"BIOUG09331-F08", "BIOUG09331-F09", "BIOUG09331-F10", "BIOUG09331-G03",
"BIOUG09331-G04", "BIOUG09331-G05", "BIOUG09331-G06", "BIOUG09331-G10",
"BIOUG09331-G11", "BIOUG09331-H02", "BIOUG09331-H06", "BIOUG09331-H08",
"BIOUG09331-H09", "BIOUG09331-H10", "BIOUG09331-H11", "BIOUG09332-A01",
"BIOUG09332-A03", "BIOUG09332-A05", "BIOUG09332-A06", "BIOUG09332-A07",
"BIOUG09332-A08", "BIOUG09332-A10", "BIOUG09332-B03", "BIOUG09332-B05",
"BIOUG09332-B07", "BIOUG09332-B09", "BIOUG09332-B11", "BIOUG09332-C01",
"BIOUG09332-C03", "BIOUG09332-C05", "BIOUG09332-C06", "BIOUG09332-C07",
"BIOUG09332-C09", "BIOUG09332-C11", "BIOUG09332-C12", "BIOUG09332-D01",
"BIOUG09332-D09", "BIOUG09332-E01", "BIOUG09332-E05", "BIOUG09332-E09",
"BIOUG09332-E10", "BIOUG09332-E11", "BIOUG09332-F06", "BIOUG09332-F09",
"BIOUG09332-F11", "BIOUG09332-G02", "BIOUG09332-G03", "BIOUG09332-G04",
"BIOUG09332-G05", "BIOUG09332-G06", "BIOUG09332-G08", "BIOUG09332-G09",
"BIOUG09332-G11", "BIOUG09332-H01", "BIOUG09332-H06", "BIOUG09332-H07",
"BIOUG09332-H08", "BIOUG09332-H09", "BIOUG09332-H10", "BIOUG09332-H11"
), row.names = c("Red", "Green", "Blue"), class = "data.frame")

These data would be much easier to work with if each sample was a row, and the colors were on the columns:
Hmean.transpose <- as.data.frame(t(Hmean))
head(Hmean.transpose)
Red Green Blue
BIOUG06754-A02 60.517 68.521 107.304
BIOUG06754-A04 150.321 142.084 136.413
BIOUG06754-A05 147.890 133.011 92.305
BIOUG06754-A06 122.536 131.516 153.172
BIOUG06754-A07 123.994 122.671 129.040
BIOUG06754-A11 103.295 96.326 97.662
...
Now it's easier to see which rows have NA values:
subset(Hmean.transpose, is.na(Red))
Red Green Blue
BIOUG09330-B05 NA NA NA
BIOUG09330-C02 NA NA NA
If we filter these out, the color conversion will work as expected:
Hmean.filter <- subset(Hmean.transpose, !is.na(Red))
data.hsv <- with(Hmean.filter, rgb2hsv(Red, Green, Blue))

If you just want to drop NA values, you can exclude columns that have NA values. For example
sapply(Filter(function(x) any(!is.na(x)), Hmean), rgb2hsv, maxColorValue=255)
Or using the tidyverse purrr functions,
library(purrr)
Hmean %>% discard(~any(is.na(.))) %>% map_dfr(rgb2hsv, maxColorValue=255)

Related

ShinyDashboard: Default theme as shinyDashboardThemeDIY

dashboardthemes allows to conveniently build custom themes for shinydashboard through the use of the shinyDashboardThemeDIY function.
On https://github.com/nik01010/dashboardthemes/tree/master/R, I can find the shinyDashboardThemeDIY syntax for all the custom themes used to showcase dashboardthemes there.
However, I'd like to work out of the default theme and customize it, and I cannot find the shinyDashboardThemeDIY syntax for the default shinydashboard, which looks as follows:
Does anyone knows where to find it or has anyone been able to reconstruct it?
To clarify in case there is any confusion, I am looking for a piece of code like the following:
shinyDashboardThemeDIY(
### general
appFontFamily = "Arial"
,appFontColor = "rgb(0,0,0)"
,primaryFontColor = "rgb(0,0,0)"
,infoFontColor = "rgb(0,0,0)"
,successFontColor = "rgb(0,0,0)"
,warningFontColor = "rgb(0,0,0)"
,dangerFontColor = "rgb(0,0,0)"
,bodyBackColor = "rgb(248,248,248)"
### header
,logoBackColor = "rgb(23,103,124)"
,headerButtonBackColor = "rgb(238,238,238)"
,headerButtonIconColor = "rgb(75,75,75)"
,headerButtonBackColorHover = "rgb(210,210,210)"
,headerButtonIconColorHover = "rgb(0,0,0)"
,headerBackColor = "rgb(238,238,238)"
,headerBoxShadowColor = "#aaaaaa"
,headerBoxShadowSize = "2px 2px 2px"
### sidebar
,sidebarBackColor = cssGradientThreeColors(
direction = "down"
,colorStart = "rgb(20,97,117)"
,colorMiddle = "rgb(56,161,187)"
,colorEnd = "rgb(3,22,56)"
,colorStartPos = 0
,colorMiddlePos = 50
,colorEndPos = 100
)
,sidebarPadding = 0
,sidebarMenuBackColor = "transparent"
,sidebarMenuPadding = 0
,sidebarMenuBorderRadius = 0
,sidebarShadowRadius = "3px 5px 5px"
,sidebarShadowColor = "#aaaaaa"
,sidebarUserTextColor = "rgb(255,255,255)"
,sidebarSearchBackColor = "rgb(55,72,80)"
,sidebarSearchIconColor = "rgb(153,153,153)"
,sidebarSearchBorderColor = "rgb(55,72,80)"
,sidebarTabTextColor = "rgb(255,255,255)"
,sidebarTabTextSize = 13
,sidebarTabBorderStyle = "none none solid none"
,sidebarTabBorderColor = "rgb(35,106,135)"
,sidebarTabBorderWidth = 1
,sidebarTabBackColorSelected = cssGradientThreeColors(
direction = "right"
,colorStart = "rgba(44,222,235,1)"
,colorMiddle = "rgba(44,222,235,1)"
,colorEnd = "rgba(0,255,213,1)"
,colorStartPos = 0
,colorMiddlePos = 30
,colorEndPos = 100
)
,sidebarTabTextColorSelected = "rgb(0,0,0)"
,sidebarTabRadiusSelected = "0px 20px 20px 0px"
,sidebarTabBackColorHover = cssGradientThreeColors(
direction = "right"
,colorStart = "rgba(44,222,235,1)"
,colorMiddle = "rgba(44,222,235,1)"
,colorEnd = "rgba(0,255,213,1)"
,colorStartPos = 0
,colorMiddlePos = 30
,colorEndPos = 100
)
,sidebarTabTextColorHover = "rgb(50,50,50)"
,sidebarTabBorderStyleHover = "none none solid none"
,sidebarTabBorderColorHover = "rgb(75,126,151)"
,sidebarTabBorderWidthHover = 1
,sidebarTabRadiusHover = "0px 20px 20px 0px"
### boxes
,boxBackColor = "rgb(255,255,255)"
,boxBorderRadius = 5
,boxShadowSize = "0px 1px 1px"
,boxShadowColor = "rgba(0,0,0,.1)"
,boxTitleSize = 16
,boxDefaultColor = "rgb(210,214,220)"
,boxPrimaryColor = "rgba(44,222,235,1)"
,boxInfoColor = "rgb(210,214,220)"
,boxSuccessColor = "rgba(0,255,213,1)"
,boxWarningColor = "rgb(244,156,104)"
,boxDangerColor = "rgb(255,88,55)"
,tabBoxTabColor = "rgb(255,255,255)"
,tabBoxTabTextSize = 14
,tabBoxTabTextColor = "rgb(0,0,0)"
,tabBoxTabTextColorSelected = "rgb(0,0,0)"
,tabBoxBackColor = "rgb(255,255,255)"
,tabBoxHighlightColor = "rgba(44,222,235,1)"
,tabBoxBorderRadius = 5
### inputs
,buttonBackColor = "rgb(245,245,245)"
,buttonTextColor = "rgb(0,0,0)"
,buttonBorderColor = "rgb(200,200,200)"
,buttonBorderRadius = 5
,buttonBackColorHover = "rgb(235,235,235)"
,buttonTextColorHover = "rgb(100,100,100)"
,buttonBorderColorHover = "rgb(200,200,200)"
,textboxBackColor = "rgb(255,255,255)"
,textboxBorderColor = "rgb(200,200,200)"
,textboxBorderRadius = 5
,textboxBackColorSelect = "rgb(245,245,245)"
,textboxBorderColorSelect = "rgb(200,200,200)"
### tables
,tableBackColor = "rgb(255,255,255)"
,tableBorderColor = "rgb(240,240,240)"
,tableBorderTopSize = 1
,tableBorderRowSize = 1
)
except it reproduces the default theme.

Error when implementing a custom layer in keras for R

I am trying to implement a custom layer for the package keras in R (github).
The layer I am implementing is based on this AttentionWithContext layer available here: gist
Here is my code:
AttentionWithContext <- R6::R6Class("AttentionWithContext",
inherit = KerasLayer,
public = list(
W_regularizer = NULL,
b_regularizer = NULL,
u_regularizer = NULL,
W_constraint=NULL,
b_constraint=NULL,
u_constraint=NULL,
bias=NULL,
b=NULL,
W=NULL,
u=NULL,
supports_masking=NULL,
init=NULL,
name = NULL,
initialize = function(name = 'attention',
W_regularizer = NULL,
b_regularizer = NULL,
u_regularizer = NULL,
W_constraint=NULL,
b_constraint=NULL,
u_constraint=NULL,
bias=TRUE ) {
self$supports_masking = TRUE
self$init = keras::initializer_glorot_uniform()
self$W_regularizer = W_regularizer
self$b_regularizer = b_regularizer
self$u_regularizer = u_regularizer
self$W_constraint = W_constraint
self$b_constraint = b_constraint
self$u_constraint = u_constraint
self$bias = bias
self$name = name
},
build = function(input_shape) {
assertthat::assert_that(length(input_shape) == 3)
self$W = self$add_weight(shape = reticulate::tuple(input_shape[[3]],input_shape[[3]], NULL),
initializer = self$init,
name=stringr::str_interp('${self$name}_W'),
regularizer = self$W_regularizer,
constraint = self$W_constraint)
if (self$bias) {
self$b = self$add_weight(shape = reticulate::tuple(input_shape[[3]]),
initializer='zero',
name = stringr::str_interp('${self$name}_b'),
regularizer = self$b_regularizer,
constraint = self$b_constraint)
}
self$u = self$add_weight(shape = reticulate::tuple(input_shape[[3]]),
initializer=self$init,
name = stringr::str_interp('${self$name}_u'),
regularizer = self$u_regularizer,
constraint = self$u_constraint)
},
compute_mask = function(input, input_mask=NULL) {
return(NULL)
},
call = function(x, mask = NULL) {
uit = keras::k_squeeze(keras::k_dot(x, keras::k_expand_dims(self$W)), axis=-1)
if (self$bias) {
uit = uit + self$b
}
uit = keras::k_tanh(uit)
ait = keras::k_dot(uit, self$u)
a = keras::k_exp(ait)
if (!is.null(mask)) {
a = a * keras::k_cast(mask, keras::k_floatx())
}
a = a/keras::k_cast(keras::k_sum(a, axis = 1, keepdims = TRUE) + keras::k_epsilon(), keras::k_floatx())
weighted_input = x * keras::k_expand_dims(a)
keras::k_sum(weighted_input, axis=1)
},
compute_output_shape = function(input_shape) {
list(input_shape[[1]], input_shape[[3]])
}
)
)
# define layer wrapper function
layer_attention_with_context <- function(object, W_regularizer = NULL,
b_regularizer = NULL,
u_regularizer = NULL,
W_constraint=NULL,
b_constraint=NULL,
u_constraint=NULL,
bias=TRUE,
name = 'attention_with_context') {
create_layer(AttentionWithContext, object, list(W_regularizer = W_regularizer,
b_regularizer = b_regularizer,
u_regularizer = u_regularizer,
W_constraint= W_constraint,
b_constraint=b_constraint,
u_constraint=u_constraint,
bias=bias,
name = name
))
}
# Example
model <- keras_model_sequential()
model %>%
layer_embedding(input_dim = 20000,
output_dim = 128,
input_length = 30) %>%
layer_lstm(64, return_sequences = TRUE) %>%
layer_attention_with_context() %>%
time_distributed(layer_dense(units=10))
When I run this, I get a cryptic error message:
Error in py_call_impl(callable, dots$args, dots$keywords) :
RuntimeError: Evaluation error: TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'.
I tried to explore this error and I think it might come from this line :
reticulate::tuple(input_shape[[3]],input_shape[[3]], NULL)
In the original code, in python, we can see this:
(input_shape[-1], input_shape[-1],)
I could not find a way to create this structure in R.
Any ideas ?

filter rows where 50% of the columns are 0

I have a code that filters rows containg 0 in any of the columns. I would like to modify this so that it filters rows that contains 0 in 48 or more of the columns (50%). How could this be done?
current code:
mature2[!(apply(mature2, 1, function(y) any(y == 0))),])
data
> dput(head(mature2,2)
+ )
structure(list(`100G` = c(310L, 142504L), `100R` = c(368L, 203538L
), `106G` = c(183L, 40788L), `106R` = c(406L, 60772L), `122G` = c(476L,
199748L), `122R` = c(415L, 212439L), `124G` = c(190L, 41003L),
`124R` = c(453L, 93523L), `126G` = c(456L, 100404L), `126R` = c(121L,
62423L), `134G` = c(788L, 270102L), `134R` = c(369L, 163493L
), `141G` = c(468L, 124348L), `141R` = c(375L, 150040L),
`167G` = c(351L, 224537L), `167R` = c(268L, 120624L), `185G` = c(637L,
98900L), `185R` = c(649L, 234184L), `192G` = c(261L, 159325L
), `192R` = c(418L, 225527L), `235G` = c(733L, 132638L),
`235R` = c(359L, 93605L), `239G` = c(141L, 80773L), `239R` = c(214L,
118840L), `240G` = c(0L, 66L), `240R` = c(0L, 41L), `243G` = c(580L,
121361L), `243R` = c(509L, 169945L), `246G` = c(35L, 16008L
), `246R` = c(229L, 117362L), `261G` = c(573L, 183687L),
`261R` = c(406L, 124865L), `267G` = c(298L, 184937L), `267R` = c(234L,
102697L), `26G` = c(497L, 244302L), `26R` = c(277L, 122537L
), `270G` = c(303L, 90109L), `270R` = c(533L, 292492L), `279G` = c(37L,
16753L), `279R` = c(194L, 115152L), `299G` = c(440L, 96887L
), `299R` = c(129L, 15098L), `301G` = c(196L, 42525L), `301R` = c(335L,
48643L), `305G` = c(393L, 93782L), `305R` = c(403L, 136864L
), `335G` = c(1L, 33L), `335R` = c(1L, 39L), `342G` = c(85L,
27755L), `342R` = c(351L, 151451L), `350G` = c(395L, 75952L
), `350R` = c(270L, 78530L), `356G` = c(470L, 166201L), `356R` = c(241L,
104167L), `35G` = c(169L, 28662L), `35R` = c(347L, 99143L
), `361G` = c(346L, 133945L), `361R` = c(115L, 80000L), `366G` = c(192L,
75795L), `366R` = c(182L, 55616L), `367G` = c(331L, 119765L
), `367R` = c(191L, 87176L), `377G` = c(155L, 53086L), `377R` = c(307L,
167251L), `379G` = c(48L, 13888L), `379R` = c(72L, 37520L
), `388G` = c(157L, 70052L), `388R` = c(349L, 134572L), `400G` = c(195L,
61048L), `400R` = c(357L, 166711L), `402G` = c(394L, 122754L
), `402R` = c(475L, 115147L), `46G` = c(268L, 76757L), `46R` = c(229L,
101414L), `48G` = c(141L, 74028L), `48R` = c(208L, 95794L
), `55G` = c(295L, 124053L), `55R` = c(223L, 88177L), `57G` = c(331L,
102180L), `57R` = c(315L, 97874L), `60G` = c(426L, 152972L
), `60R` = c(359L, 99306L), `68G` = c(338L, 176958L), `68R` = c(323L,
94942L), `70G` = c(209L, 63565L), `70R` = c(157L, 70904L),
`73G` = c(385L, 153715L), `73R` = c(292L, 175287L), `77G` = c(453L,
193342L), `77R` = c(296L, 117021L), `82G` = c(485L, 123849L
), `82R` = c(374L, 201931L), `93G` = c(603L, 183288L), `93R` = c(543L,
256014L), `94G` = c(233L, 74963L), `94R` = c(366L, 96655L
)), .Names = c("100G", "100R", "106G", "106R", "122G", "122R",
"124G", "124R", "126G", "126R", "134G", "134R", "141G", "141R",
"167G", "167R", "185G", "185R", "192G", "192R", "235G", "235R",
"239G", "239R", "240G", "240R", "243G", "243R", "246G", "246R",
"261G", "261R", "267G", "267R", "26G", "26R", "270G", "270R",
"279G", "279R", "299G", "299R", "301G", "301R", "305G", "305R",
"335G", "335R", "342G", "342R", "350G", "350R", "356G", "356R",
"35G", "35R", "361G", "361R", "366G", "366R", "367G", "367R",
"377G", "377R", "379G", "379R", "388G", "388R", "400G", "400R",
"402G", "402R", "46G", "46R", "48G", "48R", "55G", "55R", "57G",
"57R", "60G", "60R", "68G", "68R", "70G", "70R", "73G", "73R",
"77G", "77R", "82G", "82R", "93G", "93R", "94G", "94R"), row.names = c("hsa-let-7a-3p",
"hsa-let-7a-5p"), class = "data.frame")
You might try
mature2[!(apply(mature2, 1, function(y) sum(y == 0)/ncol(mature2)) < 0.5),]

Putting labels inside of a vb.net Array

So i've created 5 different arrays for labels These are
Dim ovsoLabels As Label(), customerLabels() As Label, itemNameLabels() As Label, quantityLabels() As Label, topRightItemNameLbls(5) As Label
Dim indexLabels() As Label
After that I have a function that assigns those variables to actual labels.
'assign labels to array
ovsoLabels(0) = oVSO10
ovsoLabels(1) = oVSO11
ovsoLabels(2) = oVSO12
ovsoLabels(3) = oVSO13
ovsoLabels(4) = oVSO14
customerLabels(0) = custLbl20
customerLabels(1) = custLbl21
customerLabels(2) = custLbl22
customerLabels(3) = custLbl23
customerLabels(4) = custLbl24
itemNameLabels(0) = nameLbl1
itemNameLabels(1) = nameLbl2
itemNameLabels(2) = nameLbl3
itemNameLabels(3) = nameLbl4
itemNameLabels(4) = nameLbl5
quantityLabels(0) = quantLbl1
quantityLabels(1) = quantLbl2
quantityLabels(2) = quantLbl3
quantityLabels(3) = quantLbl4
quantityLabels(4) = quantLbl6
indexLabels(0) = indexLbl10
indexLabels(1) = indexLbl11
indexLabels(2) = indexLbl12
indexLabels(3) = indexLbl13
indexLabels(4) = indexLbl14
After that I call the function in my timer tick
and this is what i'm triying to do (Not quoteArray has numbers in it 0 - infinity)
For i = 0 To 4
If quantityArray(i) = Nothing Then
ElseIf quantityArray(i) = 0 Then
quantityLabels(i).ForeColor = Drawing.Color.Green
customerLabels(i).ForeColor = Drawing.Color.Green
itemNameLabels(i).ForeColor = Drawing.Color.Green
ovsoLabels(i).ForeColor = Drawing.Color.Green
indexLabels(i).ForeColor = Drawing.Color.Green
Else
quantityLabels(i).ForeColor = Drawing.Color.Black
customerLabels(i).ForeColor = Drawing.Color.Black
itemNameLabels(i).ForeColor = Drawing.Color.Black
ovsoLabels(i).ForeColor = Drawing.Color.Black
indexLabels(i).ForeColor = Drawing.Color.Black
End If
Next
This is my first post, so tell me if I can format better. The error I'm getting is that it tells me that there is no object and I need to use the keyword new. Not sure what that means, thanks!

Dynamic Linq Select from String Value

Question Edit because simple table doesnt make things simpler..
The issue is i have to pick dynamic column value..
the column name came from prev page (DropDownList) => Current Page (HiddenField)
This is my Current Codes:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Data;
public partial class ViewChart : System.Web.UI.Page
{
BlupDataContext database = new BlupDataContext();
protected void Page_Load(object sender, EventArgs e)
{
HiddenFieldWCellName.Value = Request.QueryString["WCEL_Name"];
HiddenFieldSeries1.Value = Request.QueryString["Series1"];
HiddenFieldSeries2.Value = Request.QueryString["Series2"];
var q = from x in database.RSRAN079s
join y in database.RSRAN084s
on x.WCEL_Name equals y.WCEL_Name
where x.WCEL_Name == HiddenFieldWCellName.Value
select new
{
RSRAN079_ID = x.RSRAN079_ID,
PeriodStartTime = x.PeriodStartTime,
PLMN_Name = x.PLMN_Name,
RNC_Name = x.RNC_Name,
WBTS_Name = x.WBTS_Name,
WBTS_ID = x.WBTS_ID,
WCEL_Name = x.WCEL_Name,
WCEL_ID = x.WCEL_ID,
RRC_Conn_Access_Completitions = x.RRC_Conn_Access_Completitions,
RRC_Active_Drops_IU_FR = x.RRC_Active_Drops_IU_FR,
RRC_Active_Drops_IU_Fails = x.RRC_Active_Drops_IU_Fails,
RRC_Active_Drops_Radio_FR = x.RRC_Active_Drops_Radio_FR,
RRC_Active_Drops_Radio_Fails = x.RRC_Active_Drops_Radio_Fails,
RRC_Active_Drops_BTS_FR = x.RRC_Active_Drops_BTS_FR,
RRC_Active_Drops_BTS_Fails = x.RRC_Active_Drops_BTS_Fails,
RRC_Active_Drops_IUR_FR = x.RRC_Active_Drops_IUR_FR,
RRC_Active_Drops_IUR_Fails = x.RRC_Active_Drops_IUR_Fails,
RRC_Active_Drops_CIPH_FR = x.RRC_Active_Drops_CIPH_FR,
RRC_Active_Drops_CIPH_Fails = x.RRC_Active_Drops_CIPH_Fails,
RRC_Active_Drops_RNC_FR = x.RRC_Active_Drops_RNC_FR,
RRC_Active_Drops_RNC_Fails = x.RRC_Active_Drops_RNC_Fails,
RRC_Active_Drops_UE_FR = x.RRC_Active_Drops_UE_FR,
RRC_Active_Drops_UE_Fails = x.RRC_Active_Drops_UE_Fails,
RAB_Retainability_CS_Voice_SR = x.RAB_Retainability_CS_Voice_SR,
RAB_Retainability_CS_Conv_SR = x.RAB_Retainability_CS_Conv_SR,
RAB_Retainability_PS_SR = x.RAB_Retainability_PS_SR,
AMR_RAB_Setup_Access_Completitions = x.AMR_RAB_Setup_Access_Completitions,
AMR_RAB_Drop_Active_Drops_IF_FR = x.AMR_RAB_Drop_Active_Drops_IF_FR,
AMR_RAB_Drop_Active_Drops_IU_Fails = x.AMR_RAB_Drop_Active_Drops_IU_Fails,
AMR_RAB_Drop_Active_Drops_Radio_FR = x.AMR_RAB_Drop_Active_Drops_Radio_FR,
AMR_RAB_Drop_Active_Drops_Radio_Fails = x.AMR_RAB_Drop_Active_Drops_Radio_Fails,
AMR_RAB_Drop_Active_Drops_BTS_FR = x.AMR_RAB_Drop_Active_Drops_BTS_FR,
AMR_RAB_Drop_Active_Drops_BTS_Fails = x.AMR_RAB_Drop_Active_Drops_BTS_Fails,
AMR_RAB_Drop_Active_Drops_IUR_FR = x.AMR_RAB_Drop_Active_Drops_IUR_FR,
AMR_RAB_Drop_Active_Drops_IUR_Fails = x.AMR_RAB_Drop_Active_Drops_IUR_Fails,
AMR_RAB_Drop_Active_Drops_RNC_FR = x.AMR_RAB_Drop_Active_Drops_RNC_FR,
AMR_RAB_Drop_Active_Drops_RNC_Fails = x.AMR_RAB_Drop_Active_Drops_RNC_Fails,
AMR_RAB_Drop_Active_Drops_UE_FR = x.AMR_RAB_Drop_Active_Drops_UE_FR,
AMR_RAB_Drop_Active_Drops_UE_Fails = x.AMR_RAB_Drop_Active_Drops_UE_Fails,
CS_Conv_RAB_Setup_Access_Completitions = x.CS_Conv_RAB_Setup_Access_Completitions,
CS_Conv_RAB_Retainability_Completitions = x.CS_Conv_RAB_Retainability_Completitions,
CS_Conv_RAB_Active_Drops_IU_FR = x.CS_Conv_RAB_Active_Drops_IU_FR,
CS_Conv_RAB_Active_Drops__IU_Fails = x.CS_Conv_RAB_Active_Drops__IU_Fails,
CS_Conv_RAB_Active_Drops_Radio_FR = x.CS_Conv_RAB_Active_Drops_Radio_FR,
CS_Conv_RAB_Active_Drops_Radio_Fails = x.CS_Conv_RAB_Active_Drops_Radio_Fails,
CS_Conv_RAB_Active_Drops_BTS_FR = x.CS_Conv_RAB_Active_Drops_BTS_FR,
CS_Conv_RAB_Active_Drops_BTS_Fails = x.CS_Conv_RAB_Active_Drops_BTS_Fails,
CS_Conv_RAB_Active_Drops_IUR_FR = x.CS_Conv_RAB_Active_Drops_IUR_FR,
CS_Conv_RAB_Active_Drops_IUR_Fails = x.CS_Conv_RAB_Active_Drops_IUR_Fails,
CS_Conv_RAB_Active_Drops_RNC_FR = x.CS_Conv_RAB_Active_Drops_RNC_FR,
CS_Conv_RAB_Active_Drops_RNC_Fails = x.CS_Conv_RAB_Active_Drops_RNC_Fails,
CS_Conv_RAB_Active_Drops_UE_FR = x.CS_Conv_RAB_Active_Drops_UE_FR,
CS_Conv_RAB_Active_Drops_UE_Fails = x.CS_Conv_RAB_Active_Drops_UE_Fails,
Packet_Service_RAB_Setup_Access_Completitions = x.Packet_Service_RAB_Setup_Access_Completitions,
Packet_Service_RAB_Retainability_Completitions = x.Packet_Service_RAB_Retainability_Completitions,
Packet_Service_RAB_Active_Drops_IU_FR = x.Packet_Service_RAB_Active_Drops_IU_FR,
Packet_Service_RAB_Active_Drops_Fails = x.Packet_Service_RAB_Active_Drops_Fails,
Packet_Service_RAB_Active_Drops_Radio_FR = x.Packet_Service_RAB_Active_Drops_Radio_FR,
Packet_Service_RAB_Active_Drops_Radio_Fails = x.Packet_Service_RAB_Active_Drops_Radio_Fails,
Packet_Service_RAB_Active_Drops_BTS_FR = x.Packet_Service_RAB_Active_Drops_BTS_FR,
Packet_Service_RAB_Active_Drops_BTS_Fails = x.Packet_Service_RAB_Active_Drops_BTS_Fails,
Packet_Service_RAB_Active_Drops_IUR_FR = x.Packet_Service_RAB_Active_Drops_IUR_FR,
Packet_Service_RAB_Active_Drops_IUR_Fails = x.Packet_Service_RAB_Active_Drops_IUR_Fails,
Packet_Service_RAB_Active_Drops_RNC_FR = x.Packet_Service_RAB_Active_Drops_RNC_FR,
Packet_Service_RAB_Active_Drops_RNC_Fails = x.Packet_Service_RAB_Active_Drops_RNC_Fails,
Packet_Service_RAB_Active_Drops_UE_FR = x.Packet_Service_RAB_Active_Drops_UE_FR,
Packet_Service_RAB_Active_Drops_UE_Fails = x.Packet_Service_RAB_Active_Drops_UE_Fails,
Packet_Session_Rel_HSDSCH_EDCH = x.Packet_Session_Rel_HSDSCH_EDCH,
Packet_Session_Rel_HSDSCH_DCH = x.Packet_Session_Rel_HSDSCH_DCH,
Packet_Session_Rel_Alloc_Rel = x.Packet_Session_Rel_Alloc_Rel,
Packet_Session_Success_Ratio_SR = x.Packet_Session_Success_Ratio_SR,
Packet_Session_Drops_HSDSCH_EDCH_DR = x.Packet_Session_Drops_HSDSCH_EDCH_DR,
Packet_Session_Drops_HSDSCH_EDCH_Drops = x.Packet_Session_Drops_HSDSCH_EDCH_Drops,
Packet_Session_Drops_HSDSCH_DCH_DR = x.Packet_Session_Drops_HSDSCH_DCH_DR,
Packet_Session_Drops_HSDSCH_DCH_Drops = x.Packet_Session_Drops_HSDSCH_DCH_Drops,
Packet_Session_Drops_DCH_DR = x.Packet_Session_Drops_DCH_DR,
Packet_Session_Drops_DCH_Drops = x.Packet_Session_Drops_DCH_Drops,
Packet_Session_Drops_HSDSCH_EDCH_Other_DR = x.Packet_Session_Drops_HSDSCH_EDCH_Other_DR,
Packet_Session_Drops_HSDSCH_EDCH_Other_Drops = x.Packet_Session_Drops_HSDSCH_EDCH_Other_Drops,
Packet_Session_Drops_HSDSCH_DCH_Other_DR = x.Packet_Session_Drops_HSDSCH_DCH_Other_DR,
Packet_Session_Drops_HSDSCH_DCH_Other_Drops = x.Packet_Session_Drops_HSDSCH_DCH_Other_Drops,
Packet_Session_Drops_DCH_Other_DR = x.Packet_Session_Drops_DCH_Other_DR,
Packet_Session_Drops_DCH_Other_Drops = x.Packet_Session_Drops_DCH_Other_Drops,
HSDSCH_Alloc_Rel = x.HSDSCH_Alloc_Rel,
HSDPA_Retain_NW = x.HSDPA_Retain_NW,
HSDPA_Retain_RL_FR = x.HSDPA_Retain_RL_FR,
HSDPA_Retain_Non_RL_FR = x.HSDPA_Retain_Non_RL_FR,
HSDPA_Retain_Mobility_FR = x.HSDPA_Retain_Mobility_FR,
HSDPA_Retain_PRE_EMPTION_FR = x.HSDPA_Retain_PRE_EMPTION_FR,
HSDPA_Retain_Other_Mob_FR = x.HSDPA_Retain_Other_Mob_FR,
EDCH_Alloc_Rel = x.EDCH_Alloc_Rel,
HSUPA_Retain_NW = x.HSUPA_Retain_NW,
HSUPA_Retain_RL_FR = x.HSUPA_Retain_RL_FR,
HSUPA_Retain_EDCH_Rel_HSDSCH_SCC = x.HSUPA_Retain_EDCH_Rel_HSDSCH_SCC,
HSUPA_Retain_Other_FR = x.HSUPA_Retain_Other_FR,
HSDSCH_SCC_UE_FR = x.HSDSCH_SCC_UE_FR,
HSDSCH_SCC_UE_Fails = x.HSDSCH_SCC_UE_Fails,
HSDSCH_SCC_BTS_FR = x.HSDSCH_SCC_BTS_FR,
HSDSCH_SCC_BTS_Fails = x.HSDSCH_SCC_BTS_Fails,
HSDSCH_SCC_Trans_FR = x.HSDSCH_SCC_Trans_FR,
HSDSCH_SCC_Trans_Fails = x.HSDSCH_SCC_Trans_Fails,
HSDSCH_SCC_AC_FR = x.HSDSCH_SCC_AC_FR,
HSDSCH_SCC_AC_Fails = x.HSDSCH_SCC_AC_Fails,
HSDSCH_SCC_Other_FR = x.HSDSCH_SCC_Other_FR,
HSDSCH_SCC_Other_Fails = x.HSDSCH_SCC_Other_Fails,
R99_Alloc_Rel = x.R99_Alloc_Rel,
R99_Retain_NW = x.R99_Retain_NW,
Inter_RNC_SCC_Fail = x.Inter_RNC_SCC_Fail,
Inter_RNC_SCC_Drop = x.Inter_RNC_SCC_Drop,
RSRAN084_ID = y.RSRAN084_ID,
PeriodStartTime2 = y.PeriodStartTime,
RNC_Name2 = y.RNC_Name,
WBTS_Name2 = y.WBTS_Name,
WBTS_ID2 = y.WBTS_ID,
WCEL_Name2 = y.WCEL_Name,
WCEL_ID2 = y.WCEL_ID,
Cell_Availability = y.Cell_Availability,
Cell_Availability_Exclude = y.Cell_Availability_Exclude,
RRC_Set_Att = y.RRC_Set_Att,
RRC_Set_Acc_CR_NW = y.RRC_Set_Acc_CR_NW,
RRC_Set_Acc_CR_UE = y.RRC_Set_Acc_CR_UE,
RRC_Conn_Setup_SR = y.RRC_Conn_Setup_SR,
RRC_Conn_SR = y.RRC_Conn_SR,
RRC_Reg_Att = y.RRC_Reg_Att,
Regist_SR = y.Regist_SR,
RAB_Att_Voice = y.RAB_Att_Voice,
RAB_STP_and_ACC_CR_Voice = y.RAB_STP_and_ACC_CR_Voice,
RAB_SR_AMR_Voice = y.RAB_SR_AMR_Voice,
Min_per_Drop_Voice = y.Min_per_Drop_Voice,
CS_Serv_Dur_Voice = y.CS_Serv_Dur_Voice,
RAB_Att_UDI = y.RAB_Att_UDI,
RAB_Stp_Acc_SR = y.RAB_Stp_Acc_SR,
RAB_SR_UDI = y.RAB_SR_UDI,
Min_Per_Drop_UDI = y.Min_Per_Drop_UDI,
CS_Serv_Dur_UDI = y.CS_Serv_Dur_UDI,
PS_NRT_RAB_Att = y.PS_NRT_RAB_Att,
PS_NRT_RAB_CR = y.PS_NRT_RAB_CR,
PS_NRT_RAB_SR_NW = y.PS_NRT_RAB_SR_NW,
PS_NRT_RAB_SR_User = y.PS_NRT_RAB_SR_User,
Packet_Session_Att = y.Packet_Session_Att,
Packet_Session_Stp_SR = y.Packet_Session_Stp_SR,
RAB_Att_Stream = y.RAB_Att_Stream,
RAB_Stp_Acc_SR_Stream = y.RAB_Stp_Acc_SR_Stream,
RAB_SR_Stream = y.RAB_SR_Stream,
M_RAB_Att = y.M_RAB_Att,
M_RAB_Stp_Acc_SR = y.M_RAB_Stp_Acc_SR,
M_RAB_SR = y.M_RAB_SR,
SHO_Update_Att_RT = y.SHO_Update_Att_RT,
SHO_Update_Att_NRT = y.SHO_Update_Att_NRT,
SHO_SR_RT = y.SHO_SR_RT,
SHO_SR_NRT = y.SHO_SR_NRT,
SHO_Overhead = y.SHO_Overhead,
Inter_Sys_HHO_Att_RT = y.Inter_Sys_HHO_Att_RT,
Inter_Sys_HHO_Att_NRT = y.Inter_Sys_HHO_Att_NRT,
Inter_Sys_HHO_RT_SR = y.Inter_Sys_HHO_RT_SR,
Inter_Sys_HHOO_NRT_SR = y.Inter_Sys_HHOO_NRT_SR,
Inter_Sys_HHO_RT_DR = y.Inter_Sys_HHO_RT_DR,
Inter_Sys_HHO_NRT_DR = y.Inter_Sys_HHO_NRT_DR,
Inc_IS_Change_Att = y.Inc_IS_Change_Att,
Intra_Sys_HHO_Att = y.Intra_Sys_HHO_Att,
Intra_Sys_HHO_SR = y.Intra_Sys_HHO_SR,
R99_Allo_DL_DCH_Cap_Data_Call = y.R99_Allo_DL_DCH_Cap_Data_Call,
R99_Allo_UL_DCH_Cap_Data_Call = y.R99_Allo_UL_DCH_Cap_Data_Call,
HSDSCH_Selections = y.HSDSCH_Selections,
HSDPA_Res_Acc_NRT = y.HSDPA_Res_Acc_NRT,
HSDPA_Res_Retain_NRT = y.HSDPA_Res_Retain_NRT,
HSDPA_Res_Retain_RT = y.HSDPA_Res_Retain_RT,
HSDPA_Attempt = y.HSDPA_Attempt,
HSDPA_SR = y.HSDPA_SR,
Avg_MAC_D_THP = y.Avg_MAC_D_THP,
Act_HSDSCH_MAC_D_THP_NW = y.Act_HSDSCH_MAC_D_THP_NW,
HSDPA_DL_DATA_Rcvd_NodeB = y.HSDPA_DL_DATA_Rcvd_NodeB,
HSDPA_MAC_HS_Data_Vol_at_RNC = y.HSDPA_MAC_HS_Data_Vol_at_RNC,
HSPDA_MAC_HS_Efficiency = y.HSPDA_MAC_HS_Efficiency,
HARQ_Non_Ack_Ratio_Mean = y.HARQ_Non_Ack_Ratio_Mean,
HSDPA_SCC_Att = y.HSDPA_SCC_Att,
E_DCH_Selections = y.E_DCH_Selections,
HSUPA_Res_Acc_NRT = y.HSUPA_Res_Acc_NRT,
HSUPA_Res_Retain_NRT = y.HSUPA_Res_Retain_NRT,
HSUPA_Res_Retain_RT = y.HSUPA_Res_Retain_RT,
HSUPA_Att = y.HSUPA_Att,
HSUPA_SR = y.HSUPA_SR,
HSUPA_MAC_es_Data_Vol_RNC = y.HSUPA_MAC_es_Data_Vol_RNC,
HSUPA_MAC_es_BLER = y.HSUPA_MAC_es_BLER,
E_DCH_HARQ_Non_Ack_Ratio = y.E_DCH_HARQ_Non_Ack_Ratio,
HSUPA_SCC_Att = y.HSUPA_SCC_Att,
AVG_CS_Traffic = y.AVG_CS_Traffic,
Inc_SMS_Att = y.Inc_SMS_Att
};
Chart1.DataSource = q;
Chart1.Series[0].XValueMember = "PeriodStartTime";
Chart1.Series[0].YValueMembers = HiddenFieldSeries1.Value.ToString();
Chart1.Series.Add(HiddenFieldSeries2.Value);
Chart1.Series[1].XValueMember = "PeriodstartTime2";
Chart1.Series[1].YValueMembers = HiddenFieldSeries2.Value.ToString();
}
}
Can We simplify Linq Select New codes?? while i only need 4 columns only.. :(
Your question dosen't make too much sense as far as your comments/labeling, so I took my best guess:
DDLLessons.DataSource = lesson;
DDLLessons.DataBind();
var query = from x in db.Scores
where x.StudentName == DDLStudentName.SelectedItem.Value
select new {
Day = x.Day,
Class = DDLLessons.SelectedItem.Value
};
Are you looking for selecting table name dynamically using strings (this is what I understood). If yes, have a look at this and select the table object from the string:
How can I dynamically select my Table at runtime with Dynamic LINQ
From the above link, this is what is relevant to you:
'' get the table from a type (which corresponds to a table in your database)
Dim typeName = "DatabaseTest.AdventureWorks." & tableName & ", DatabaseTest"
Dim entityType = Type.GetType(typeName)
Dim table = dc.GetTable(entityType)
Dim query As IQueryable = table
(credit for the code goes to original poster of the answer on the link that I've provided)
UPDATE: C# version of code:
// get the table from a type (which corresponds to a table in your database)
string typeName = "DatabaseTest.AdventureWorks." + tableName + ", DatabaseTest";
Type entityType = Type.GetType(typeName);
object table = dc.GetTable(entityType);
IQueryable query = table as IQueryable;

Resources