Is there a way to rename levels in gt_summary? - rename

In the example down below, I'm struggling to find a way to change the level-name. I would like to change it to the following: 1 ~ "Female", 2 ~ "Male". It seems pretty simple to me, but I haven’t found a solution yet.
Im unable to find any solution to this problem.

Related

How to simplify 4 nested IF functions in EXCEL

This might be a simple fix I'm unsure. I have the following formula which I would like to be able to drag up and down =IF(C311>B311,IF(C310>B310,IF(B309>C309,IF(C312>B312,2,1),0),0),0)
I'm guessing AND can be implemented in some way but I'm not sure. The logic behind my goal is if C311>B311 AND C310>B310 AND B309>C309 then check to see if C312>B312 if it is then put a 2 else put a 1. Perhaps there is another solution as well I'm not thinking of.
Try this: =IF(AND(C311>B311,C310>B310,B309>C309),IF(C312>B312,2,1),"")
Last argument I left it as "" but replace it to whatever you need.
Just another approach-
=IF((C311>B311)*(C310>B310)*(B309>C309),IF(C312>B312,2,1),"")

How do I split individual character within a list that is within a list?

I am working on a project in Python, and I stumbled across this hindrance.
I have something like this:
[['abcde'],['bcdef']]
How do I make it such that it gives me this? :
[['a','b','c','d','e'],['b','c','d','e','f']]
Thank you for helping
It would be better if you start reading docs
[list(string) for string in given_list]
or otherwise
list(map(list,given_list))

Netlogo: Creating subsets of agentsets of a particular breed

I am still new to Netlogo, but I can not find an explanation for this in the documentation.
I am trying to create a subset of an agentset that only contains one type of breed. It would seem that I could use "with" to perform this, but for some reason that does not work.
This code works:
ask link-neighbors with [shape = "person"][
set pmt (pmt + dist)
]
But this code does not:
ask link-neighbors with [breed = "psngrs"][
set pmt (pmt + dist)
]
How can I create a subset of an agentset with only this particular breed?
Thanks!
This question is showing as unanswered, though Alan gave the correct answer in a comment. So, just so I stop clicking on this thinking it is unanswered, I'm going to reiterate what he said as an answer. Alan, if you add your comment as answer, I'll happily delete mine.
Anyway, just get rid of the quotes around the breed name, like so:
link-neighbors with [breed = psngrs]

if-statements in Google docs all fail, no matter how easy

Reading the documentation, I'm led to believe Google Docs should be able to handle if-statements in the following format (straight from the documentation):
IF(test, then_value, otherwise_value)
So, as a test, I try the following:
=IF(2>1, 2, 1)
This should obviously print 2 since two will always be greater than one. However, this throws me an error. So, I try the following instead:
=IF(1=1, 1, 1)
This also gives me an error.
Obviously I'm doing something wrong here, unless Google stopped supporting if-statements in their docs. Can anyone help?
Google has obviously changed this without changing the proper documentation. According to the documentation, as of writing this, the correct way to do this is as in my question:
=IF(2>1, 2, 1)
However, if you start writing "=IF" in Google Drive, a popup guides you in the correct direction, and it seems they have changed the syntax to:
=IF(2>1; 2; 1)
Note the use of semicolons instead of commas. That's it.

Excel nested IF's

I have found several sites that talk about work arounds but they all talk about doing some kind of mathematical equation, so this is the nested if's I am trying to fix.
=IF((COUNTIF($A$137:$A$146,$C173)=1), 9203, IF((COUNTIF($A$161:$A$196,$C173)=1), 9202, IF((COUNTIF($A$199:$A$228,$C173)=1),9216, IF((COUNTIF($A$231:$A$255,$C173)=1),9222, IF((COUNTIF($A$258:$A$295,$C173)=1),9202, IF((COUNTIF($A$199:$A$228,$C173)=1),9216, IF((COUNTIF($A$298:$A$312,$C173)=1),9203, IF((COUNTIF($A$327:$A$361,$C173)=1),9202, IF((COUNTIF(A364:A383,$C173)=1),9219, Error)))))))))
Any tips?
The problem is in the last word Error. It's not a valid name in Excel. Replace for example with "Error"

Resources