Expand RStudio preview data - r

I'd like to hear how one could bypass the default View() options. In my computer it only shows up to 100 columns. I'd like it to about 400 columns. It's possible?

Meanwhile, you can use the utils::View() to view more columns of the data. This isn't quite as useful or pretty as the RStudio Viewer but it does a decent job on tables with more than 100 columns.
The other option that I occasionally use is View(df[,101:200]) etc. to view different columns of the data--sometimes this can be combined with some columns at the beginning so that I can see the necessary key data.

Related

Add row into table even when some data not found in power automate?

Hi I am trying to use AI Builder to scan some titles and populate into a spreadsheet once the pdf is dropped into a folder.
It works fine where it find all the Data but if it can not find any data in the columns starting with SOL then it does bring anything through. I would like it too still bring through any data from the first 3 columns even if nothing is found for the "SOL" columns. Can anyone help please?
Example Output as needed. Currently row 3 will not come through.
Tried some conditions and compose
Maybe you can also post your message in the Power automate community.

In RStudio, can I visually preview Spark Dataframes in the GUI like I can with normal R dataframes?

Background
This may be my lack of skill showing, but as I'm working on data manipulation in R, using RStudio, I'm fond of clicking into dataframes in the "Environments" section of the GUI (for me it's in the top-right of the screen) to see how my joins, mutates, etc. are changing the table(s) as I move through my workflow. It acts as a visual sanity check for me; when it comes to tables and dataframes I'm a very visual thinker, and I like to see my results as I code. As an example, I click on this:
And see something like this:
The Problem
Lately, because of a very large dataset (~200m rows), I've needed to do some of my dplyr work inside sparklyr, using a local instance of Apache Spark to work through some data manipulation. It's working mostly fine, but I lose my ability to have little previews of the data because spark dataframe objects look like lists in the Environment pane:
Besides clicking, is there a way I can "preview" my Spark dataframes inside RStudio as I work on them?
What I've tried
So your first thought might be "just use head()" -- and you'd be right! Except that running head(d1, 5) on a local Spark df with 200 million rows takes ... a long time.
Anything I may be missing?
Generally, I believe you need to call collect() on the Spark dataframe. So I would first sample the Spark dataframe, say .001% of the rows (if there's 200 million) with the sparklyr::sdf_sample function, and then collect that sample into a regular dataframe to look at.
samp <- analysis_test %>% sdf_sample(fraction = .00001) %>% collect()

Rstudio show only the first 50 columns

I have a problem on RStudio in my data view, I can see only the first 50 columns for all dataframes. Is it possible to increase the number of view columns?
You can use a "hidden" RStudio option to set the maximum number of columns the viewer will display before switching to the arrows.
This example sets the number to 1000 columns:
rstudioapi::writeRStudioPreference("data_viewer_max_columns", 1000L)
Found in an RStudio developer's comment on a github issue about this topic.
---EDIT---
You can set this value in the Command Palette in RStudio v1.4:
I do not believe you can increase the number of columns to view at a time. But you can click the little arrow at the top to scroll across to more columns.
I'm using RStudio 1.2.1335 and not sure which version of RStudio first implemented this feature.

RStudio environment data.frame row count

I deal with large datasets frequently. Unfortunately, RStudio IDE's environment shows row count of data.frame like 156212811 and it'll be really useful if it shows in readable notation (like 156,212,811).
Is there any way how I can force it to use commas in row count?
Attached screenshot for reference

R console output too long, how can I view outputs in `less`?

I am inspecting research data from NIR spectroscopy. Unfortunately, the output is too big (2048 rows with 15 columns).
Very often, when I try to check a variable like mymodel$loadings my results get truncated.
I understand that I can increase the max output of my terminal, but it's really a hassle to scroll my mouse up from my terminal window. Is there a way I can tell R to pipe the output from my last statement to less or more so I can just scroll using the keyboard?
Are you using a version of RStudio? I would generally look at tables like this in the Data Viewer pane, it allows you to see all data in tables like yours a lot easier.
Access by clicking on the data frame name in top right, or using below in console:
View(dataframe_name)

Resources