I have a dataframe called "test" in the environment:
I want to add a column that assigns an increasing unique integer to each row of data, so I ran this code to create the column "count":
test$count <- 1:nrow(test)
It works and show as this in the environment:
I am concerned that the blue circle has disappeared (to the left of the word "test"). Is there a way to bring it back? I think "test" is still a dataframe, but it may have been changed to a matrix?
My issue is that the new column "count" makes it so we can no longer preview its contents without opening it fully, and this is less than ideal.
Related
I have a problem with the preview window of plots from RNotebook.
I am running GAM-models for different tree species and store them in a nested dataframe. When I afterwards run some model diagnostics or plotting function in RNotebook an odd behaviour occurs.
So lets say I want to plot the smooths for each tree species gam model with customized function
# plotting the effects of the model with gratia
gam_plot_gratia_all(gam_base, group_var = group_var)
here my custom-function:
gam_plot_gratia_all = function(gam_input, group_var) {
map2(gam_input$fit_gam, gam_input[[group_var]], ~ show(gratia::draw(.x)))
}
gam_base is a nested dataframe which contains the gam-models in the fit_gam column. The function works and I get three plots:
When I open the plots in the preview window, the last plot (the very right one) is shown properly and after enlarging the preview window, adjusts the single ggplots to the proper size:
However, when selecting one of the previous plots, the single smooth-plots do not adjust to the larger window size, but remain in the default size:
Of course I can create multiple plots and split them on different pages, but for a quick preview, this is quite a nice feature or RNotebook. The example with the gratia-plots is just for demonstration. The behaviour remains the same when I plot other ggplots or use other plotting packages, so maybe there are some options in RNotebook, where I can tackle this problem?
I also tried "print" in my function calls, and also wrapped the print function around my map2-call. I use the latest version of RStudio (2022.07.2 Build 576) and Windows.
Hopefully this is an easy question. I am working on a report containing an allocation sum for each person. I would like all allocation amounts greater than 100% to display with red background color, those that equal 100% to be green. All other cells can remain clear with no background.
I right clicked the cell with the sum, selected text box properties, and then fill. I entered the following expression: =IIF(Sum(Fields!Allocation.Value) =100%, "Green", IIF(Sum(Fields!Allocation.Value) >100%, "Red", "Transparent"))
I do not receive an error message but no data shows in the total column. Its like the transparent took over the cells. I've been trying to figure this out for three days. Please help! Thank you so much!
I think you need to refer to the instance of the value in the report, instead of the field. So use ReportItem![textbox name] in your expression.
For example:
IIF(ReportItems!TestScoreStudent.Value/ReportItems!TestMax.Value*100 < Parameters!Yellow.Value, "#f4a0a5", IIF(ReportItems!TestScoreStudent.Value/ReportItems!TestMax.Value*100 >= Parameters!Green.Value, "#b4eeb9", "#f4e5a9")))
Need to display line in a line-chart , with the ability to move the tiles, to see a max bitrate value line, to see labels and axis pointers on hover, grouped with a table and time Slider.Y dimension needs to display "bitrate total" or "bitrate Avg" (as defined in code). X dimension needs to display 15 min interval in scope of weeks.
I can upload my data into a table but not into the line graph. I can see points on the graph using .renderDataPoints() but no lines.
I checked the data - could not find any null/NaN values being returned, not using any old version of colors.
The code can be found in https://jsfiddle.net/dani2011/bu2ag0f7/8/. Tried to replace my CSV with var data but nothing is being displayed at the moment in the fiddle. The code as whole is displayed in https://groups.google.com/forum/#!topic/dc-js-user-group/MEslyF2RWRI
Any help would be greatly appreciated.
Here's my go-to-answer for how to put data into a jsFiddle. Basically it's easiest to stick it in an unused tag in the HTML. bl.ocks.org / blockbuilder.org is easier for this.
Here's a fork of your fiddle with the data loaded that way:
http://jsfiddle.net/gordonwoodhull/bu2ag0f7/17/
I also had to remove the spaces from the column names, because those got d3.csv confused and caused the BITRATE calculations to fail.
There was also some stray code inside the renderlet which was failing with a complaint about dim not existing.
The main reason why data was not displaying was because the input groups were not producing usable aggregated data. Your data is very close together in time, so aggregating by week would aggregate everything.
The way to debug this is to put a breakpoint or a console.log before the chart initialization and look at the results of group.all()
In this case bitrateWeekMinIntervalGroupMove and minIntervalWeekBitrateGroup were returning an array with one key/value pair. No lines can be drawn with one point. :)
It looks like you originally wanted to aggregate by 15 minute intervals, so let's get that working.
For whatever reason, there are two levels of aggregation in crossfilter, the dimension level and the group level. The dimension will have first crack at generating a key, and then the group will further refine these keys.
Your min15 function will map each time-key to the 15-minute mark before it, but it needs data that is higher than 15 minutes in resolution. So let's put these groups on the dateDimension, which hasn't already been mapped to a lower resolution:
var minIntervalWeekBitrateGroup = dateDimension.group(min15).reduceSum(function (d) {
return +d.BITRATE
});
var bitrateWeekMinIntervalGroupMove = dateDimension.group(min15).reduce(
...
Great, now there are 30 data points. And it draws lines.
I made the dots a bit smaller :) because at 30 pixels it was hard to see the lines.
Zooming in using the range chart reveals more of lines:
There still seem to be glitches in the reduce function (or somewhere) because the lines drop to zero when you zoom in too far, but hopefully this is enough to get you moving again.
My fork of your fiddle: http://jsfiddle.net/gordonwoodhull/bu2ag0f7/25/
I am trying to display text on an SSRS report in a fixed position, regardless of the content above it. The problem is the content above may be one to three lines. As the above content fluctuates, so does the beginning of the next row of content. This happens in two places on the report.
In other words, I need two static starting points for dynamic content. I am printing text onto a pre-designed invoice that doesn't contain any customer data. The invoice is just a template (or shell if you will) and I am to position the data to print into spaces provided on that invoice.
Please see attachments. The attachment with two rows in each field is lining up correctly. I have done this intentionally as a basis. As you can see on the other two attachments, with either one or three rows, the content isn't lining up where it should be due to more or less content than my basis.
I have toyed around with cangrow & canshrink but couldn't get the results as desired.
Appreciate the help!
I think you're going to need to re-work your table to get working the way you want.
The way I would do it would be to have one table that groups each page data. Use this table to format your data - putting Rectangles in the area for your lines of data. Rectangles can have a set height so they fill your area when there isn't enough data.
Then you'll have to add another tables inside each of the rectangles to display each sections data.
See my example below - the RED represents where the Rectangles would go and the BLUE for tables.
I would keep the old table intact and copy and paste it in each rectangle. Then remove all the parts that that section doesn't need and set your rectangle to the correct size.
I want to save my Visio shapes as an .svg file to incorporate into a XML document. However, when i save it ALL the values in my shape are set to 0. I've quadruple checked the shape data and all the values are there and the formulas are returning the correct values. The strange thing is, saving as a .svg works in Visio 2007 and all values are correct, but in Visio 2010 all the values are 0. Why is this? Unfortunately this is my first post, so I can't add screenshots as i don't have 10 rep.
The shape is 4 individual rows grouped together. The data is stored in the "Main" shape, i.e all rows grouped together. The cell in the individual shape then references its value from the main shape.
Example of 1 of the 4 main shape row forumlas:
ShapeData Property - Value = Sheet.1!Prop.Row_2 (references main shape rows, stores value)
Text Field Property - Value = Prop.Row_1 (references its single row, containing value of main shape)
The real kick here is I fixed this problem 4 months ago, but my colleagues had more shapes with the same issue. I cannot remember how i fixed it, and the shape that I fixed is identical in terms of structure and data handling.
Something strange that I also noticed is that when i type ".Value" after the Value field text in either the Text Fields or Shape Data properties, the ".Value" gets automatically omitted after I press enter, but then the field produces the right .svg output. However, this does not work when I make that change in the master shape. So effectively, I'd have to go into every single value field and manually type ".Value" and press enter for it to work. I've also tried turning off all shape protection, no joy.
I'm currently in the process of writing a macro to "refresh" all the value fields by adding ".Value" after them to mimic me manually typing that in.
Any help or feedback would be greatly appreciated!
I believe this is upgrade issue (2007->2010). Have seen this a few times. To fix try:
Open the diagram in Visio 2003 (or 2007), but not in Visio 2010
Save it as .VDX (Visio XML Drawing) file
Close it
Open the VDX file again in the same Visio
Save it back as normal VSD file. This should fix the broken VSD file.
Delete the VDX file, it is not needed
If this doesn't work then try sharing the source file (dropbox or whatever).
The problem was that the rows Text Fields were Data Object types. When I removed the Text shape protection and inserted a Shape Data field, the correct values were shown on the .svg output file.