R Shiny changing variable types - shinyapps

does anyone know how to show one plot with a variable as a continuous variable, and then to convert that variable into a categorical variable to show a different kind of plot in R shiny.
I'm trying to do this with mt cars data
I also wanted to add a file input widget so the user can input the data

Related

Filtering Expressions in Microsoft Report Builder

My dataset has multiple variables each with different values. I am already filtering in my Datasets and Charts/Tables. I need to be able to filter again in my expression.
I want only the values from one variable. I need to filter out the other variables so I can focus only on the values from one variable.
Value=(Fields!VALUE.Value) when Fields!VARIABLE.Value = "ABCD"
Obviously the logic above does not work but I am looking for something similar that does work.
Value is an integer
Fields!VALUE.Value is an integer
Fields!VARIABLE.Value is a string
ABCD is the variable name I want to get the value from.
For example.
I have two variables ABCD and EFGH. I only want the value from ABCD but not from EFGH. I need to filter out EFGH.

How to pass multiple labels into Huggingface transformers Trainer

Huggingface transformer Trainer says "your model can accept multiple label arguments (use the label_names in your TrainingArguments to indicate their name to the Trainer)". Anyone know the correct format to pass multiple labels into the trainer? It doesn't seem clear from the documentation. I would like to avoid putting all of the labels into one label column, since some have multiple labels at the same time, so there would be all the combinations of column names (there is a 1 in the row for each label that a comment applies to, so like one-hot encoding with possibly multiple 1's in a row).

How to show the numeric values of categorical labels in output using spss syntax

I was wondering whether there is a way to show the numeric values attached to the categories of a nominal variable when we create tables or frequencies in SPSS syntax.
I would like to use something similar to what the , nolab argument in stata does. It provides the numeric values of each category of the categorical variable (for example 1 for men and 0 for women).
I would like to create tables using SPSS Syntax (2-way tables or just frequencies) that show the nominal categories as well as the numeric values that SPSS has for each category. Does anybody know if this is possible with the table or frequencies command?
In SPSS you can choose in the settings wether label, the numerical values or both are shown in the output tables.
GUI
In the Menu choose Edit->Options and then the Output tab. There you can change the output settings under Pivot Table Labeling.
Syntax
Within Syntax Editor you can define the output settings with the "SET TNUMBERS" command.
SET TNUMBERS LABELS. /* Only Labels are shown in the output tables.
SET TNUMBERS VALUES. /* Only Values are shown in the output tables.
SET TNUMBERS BOTH. /* Values and Labels are shown in the output tables.
For more information see: SPSS Command Syntax Reference

Tableau scatter-plot: splitting measure using dimension from other data set

I have a question on Tableau scatter-plots. Suppose I have two data sources, "data" and "meta". Data contains two columns, "variable" and "value" (as R melted data frame). Let's say variable ranges from a - d, and values 1 - 10. Meta classifies variables (columns: "variable", "class") so that a and b are "x", and c and d are "y". Tableau automatically links "variable" of data to "variable" of meta.
Now I would like to create a scatter-plot so that x's give x coordinates and y's give y coordinates. (And later split data further and add detail.) I thought this could be done dragging "value" to chart area and "class" to somewhere, but I cannot get it work.
One thing I've tried is to create a calculated field for x's and y's:
IF [meta].[class] == "x" THEN [value] END
This doesn't work, Tableau saying: "All fields must be aggregate or constant when using table calculation functions or fields from multiple data sources."
I feel I must be missing something obvious. I know I could create the scatter-plot reshaping the data, but it's not a good option in the case I have in mind.

Crystal Reports Setting Global Subreport Variable

I am trying to set a couple of global variables in a subreport so that it pulls and stores the data I need in each.
Say I go into the formula workshop and create a new formula. Right now I have
Global numbervar name:= ;
I have a single table with multiple fields. I have one field named {table.order} and another named {table.amount}. Both of these are numbers. How do I assign to this variable the amount in the associated amount field when the order is -1? I'm really not familiar with crystal syntax at all.
After this, where would I need to drag and drop this formula in the report to pick up this data or is simply creating the formula in the formula explorer enough? If it needs to be physically dragged into the report, will anything show up or will I need to suppress it so it is not visible and if that is the case, will it still work suppressed?
Thanks for any help you can give.
Are you trying to pass the value in this variable back to the main report? If so, you'll need to make this a Shared Numbervar, not a Global Numbervar.
To answer your question; create this formula:
global numbervar name;
if {table.order} = -1 then name := {table.amount}
...and drop it into your subreport's details section. Note that any formulas, summaries, running totals, SQL expressions, etc. that you create but are not placed in the actual report won't be run. However, after placing it in the report, it will display. To prevent this, right click on the field, go to the 'Common' tab, and then check 'Suppress'. The formula will still work when suppressed.
One other thing to keep in mind is that if your subreport(s) contain more than one row of data, the variable will be overwritten for each.

Resources