find mean of grouped data in RStudio~! - rstudio

here is the data
how to find the mean, median and mode of this grouped data by using RStudio?

Related

Can MappingScore() be used to get an absolute measure of scRNAseq dataset similarity to the reference dataset?

I have been using Seurat v4 Reference Mapping align some query scRNAseq datasets that come from IPSC-derived cells that were subject to several directed cortical differentiation protocols at multiple timepoints. The reference dataset I made by merging several individual fetal cortical sample datasets that I had annotated based on their unsupervised cluster DEGs (following this vignette using the default parameters).
I am interested in seeing which protocol produces cells most similar to the cells found in the fetal datasets as well as which fetal timepoints the query datasets tend to map to. I understand that the MappingScore() function can show me query cells that aren't well represented in the reference dataset, so I figured that these scores could tell me which datasets are most similar to the reference dataset. However, in comparing the violin plots of the mapping scores for a query dataset from one of the differentiation protocols to a query dataset that contains just pluripotent cells it looks like there are cells with high mapping scores found in both cases (see attached images) even though really only the differentiated cells should have cells closely resembling the fetal cortical tissue cells. I attached the code as a .txt file.
My question is whether or not the mapping score can be used as an absolute measurement of query to reference dataset similarity or if it is always just a relative measure where the high and low thresholds are set by the query dataset. If the latter, what alternative functions might I use here to get information about absolute similarity?
Thanks.
Attachments:
Pluripotent Cell Mapping Score
Differentiated Cell Mapping Score
Code Used For Mapping

How to read data using Google query language and update using sheets api, when query doesn't return row numbers?

What I want is to search one row in Google Spreadsheet and Update the value of one column. (When we have a large number of rows)
By looking at the main requirement, it seems easy. Yes of course. There are easy and straight forward ways to do that. But, when we have more data(rows) in spreadsheets around 100,000 rows, the usual methods are very slow. I was able to search for data using Google Query Language and it is a very efficient way (less than 1 sec for more than 50,000 records)
Now Google offers batch update mechanism, and we have to set the range in order to update the data.
But if we use the query api to search the data, we will not get the row number and we don't know where to update. Google offered two independent solutions, but how to combine these solutions efficiently? (Especially for large number of records).
Also, Are there any alternate solutions I missed?
The easiest way is to add a column with row numbers. You can then use query to retrieve the rows, which will contain the row numbers as well.
Another way is to use text finder, whose performance is comparable/better than query.

How does count min sketch find the most frequent item in a stream? - Heavy Hitters

Count min sketch uses different hash functions to map elements in the stream to the hash function. How to map back from the sketch to find the most frequent item? Considering that enough elements have been passes(millions) and we don’t know the elements.
First of all the CMS in order to store data use pairwise independent hash functions to map elements in their structure (think of it as a table).
Secondly, the reverse process is not supported as is, which is from the table to distinguish the distinct elements in the CMS.
Using separate elements as queries you can retrieve their estimated count in the stream using the same family of hash functions (point query).
In order to retrieve the most frequent item/items an additional data structure such as a heap should be used.
Appart from the CMS papers, a quick and useful presentation over your question is found here: http://theory.stanford.edu/~tim/s15/l/l2.pdf

Looking to represent numbers better on Power BI

Is there any way we can restructure the whole numbers in Power BI to distinguish the thousands, millions and billions using normal comma operator.
For example: 1,047,890 is represented as 1047890 or 1.04M in Power BI where as I would like it to be represented as 1,047,890. Is there any way we can do that?
Those features are available in the Power BI Desktop tool, a free download from www.powerbi.com.
On the Data view you can set the default numeric format shown in tables, cards, tool-tips etc. On the Report view you can set the numeric format for Chart Axes etc (those are dynamic by default based on the aggregated results).

Excel 2010 is quick to calculate but slow to start up

I have created an excel database that takes information from a number of sheets and stores the data in a single 'database' sheet in a layout that makes it easy to create a pivot table to capture all of the data in the database. The information in the database tab is all either linked directly to cells in other sheets or using the offset function to link to cells in other sheets.
The database page is just over 10,000 rows and just over 100 columns (i.e. about a million linked cells). I have been trying to find solutions to this problem, but have been unable to do so. Calculation time is relatively quick as the workbook does not make use of array formulas such as sumifs or sumproduct.
Is the database just too big or is there a way to avoid the extremely slow start up (20-30 minutes)?
Thanks!

Resources