@stevensanderson@mstdn.social
@stevensanderson@mstdn.social avatar

stevensanderson

@stevensanderson@mstdn.social

New Book: https://packt.link/oTyZJ | R - install.packages("healthyverse") | #SQL | opinions are mine | #rstats | Mainly though my wife and kids :) | Advisor to DoTadda - All posts delete in 12 months.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

🎉 New Post Alert! 🎉

Counting words in a string is a fundamental task in data analysis.

  1. Base R: Use strsplit(), a straightforward method to split strings and count words.

  2. stringr: The str_split() function from the stringr package makes the code more readable.

  3. stringi: For powerful and efficient string manipulation, stri_split_regex() from the stringi package is your go-to.

Happy coding! 🚀

#R #RStats #RProgramming #Programming #regex #Coding #strings

Post: https://www.spsanderson.com/steveondata/posts/2024-05-16/

stevensanderson, to gpt
@stevensanderson@mstdn.social avatar

The white background logo is the current hex sticker for my TidyDensity #R the others were generated from DALL-E pretty cool

image/png
image/png

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

working on the next release of TidyDensity

#R

stevensanderson, to python
@stevensanderson@mstdn.social avatar

Feeling stuck with Excel for data analysis?

My new book which was co-authored by David Kun, Extending Excel with Python & R, shows you how to leverage the strengths of BOTH worlds!

Here's what you'll gain:
🧐 Advanced data manipulation & cleaning
💻 Powerful statistical analysis & modeling
📉 Eye-catching data visualizations
🌟 Seamless integration back to Excel

Get your copy today! https://packt.link/oTyZJ

#dataanalysis #python #R #excel #data #visualization #booklaunch #Coding #Programming

stevensanderson, to datascience
@stevensanderson@mstdn.social avatar

Discover efficient string splitting in R using strsplit()!

Learn practical examples and unleash the power of regular expressions.

Enhance your data cleaning skills and level up your R programming.

Experiment with strsplit() today!

Post: https://www.spsanderson.com/steveondata/posts/2024-04-26/

#DataAnalysis #DataScience #RProgramming #R #RStats #Programming #Coding

image/png

stevensanderson, to Excel
@stevensanderson@mstdn.social avatar

Having fun trying to generate banner images for my upcoming book:

Extending Excel with Python and R

Amazon: https://packt.link/oTyZJ

#Book #Excel #Python #R #RStats #Programming

image/png

stevensanderson, to github
@stevensanderson@mstdn.social avatar
stevensanderson, to Glue
@stevensanderson@mstdn.social avatar

Some one just reached out looking to extract values from a cell that are produced by from the

Example a cell value like 251 (13%) they just want the 251, so I did something like this:

library(tidyverse)
tibble(
value = glue::glue("{11:20} ({1:10}%)"),
reged_val = str_extract(value, "\d+(?=\W|$)") |>
as.numeric()
)

A tibble: 10 × 2

value reged_val
<glue> <dbl>
1 11 (1%) 11

Thoughts?

#R

stevensanderson, to python
@stevensanderson@mstdn.social avatar

Feeling stuck with Excel for data analysis?

My new book which was co-authored by David Kun, Extending Excel with Python & R, shows you how to leverage the strengths of BOTH worlds!

Here's what you'll gain:
🧐 * Advanced data manipulation & cleaning
💻 * Powerful statistical analysis & modeling
📉 * Eye-catching data visualizations
🌟 * Seamless integration back to Excel

The release date is April 30th!

#R

Link: https://packt.link/oTyZJ

stevensanderson, to datascience
@stevensanderson@mstdn.social avatar

Looking to do some data filtering in base R? Well then of course I have a post for you! Many times people in a corporate environment are strapped from installing packages or it is cumbersome to get it done, this is why I like to focus on base R solutions.

#R #RStats #RProgramming #Coding #DataScience #Data #DataScientist #Programming

Post: https://www.spsanderson.com/steveondata/posts/2024-04-10/

image/png

stevensanderson, to datascience
@stevensanderson@mstdn.social avatar

Got NA's in your data? Well, if you want to get rid of them then this post is for you!

#R

Post: https://www.spsanderson.com/steveondata/posts/2024-04-09/

stevensanderson, to random
@stevensanderson@mstdn.social avatar

Need to visualize and scale multi-dimensional data? Well sometimes we do and this post is for you!

Post: https://www.spsanderson.com/steveondata/posts/2024-04-04/

#R

stevensanderson, to Amazon
@stevensanderson@mstdn.social avatar
stevensanderson, to programming
@stevensanderson@mstdn.social avatar

Ever heard of the sweep() function from ? Well today it is the topic of my latest blog post!

Post: https://www.spsanderson.com/steveondata/posts/2024-03-22/

#R

image/png

stevensanderson, to python
@stevensanderson@mstdn.social avatar

Feeling stuck with Excel for data analysis? You're not alone! Excel is fantastic, but for truly powerful insights and visualizations, it can fall short.

Here's what you'll gain:
🧐 * Advanced data manipulation & cleaning
💻 * Powerful statistical analysis & modeling
📉 * Eye-catching data visualizations
🌟 * Seamless integration back to Excel

Reserve your copy today: https://www.amazon.com/dp/1804610690/ref=tsm_1_fb_lk

#R

stevensanderson, to datascience
@stevensanderson@mstdn.social avatar

Struggling with weird variable names in R? make.names to the rescue! This function wrangles your names into R-approved format (letters, numbers, periods, underscores). Bonus: set unique = TRUE for no duplicates! Try it on funky characters & data frames! 🪄 Master make.names and become an R name-wrangling pro! #R

Post: https://www.spsanderson.com/steveondata/posts/2024-03-11/

image/png

stevensanderson, to datascience
@stevensanderson@mstdn.social avatar

In base R, we can filter rows where a column is between two values using bracket notation or the subset() function along with logical operators like >=, <=, &, and !. The key is creating a logical test that checks if values are within our desired range.

For example, to filter rows where the column "value" is between 5 and 8

df[df$value >= 5 & df$value <= 8,]

Or with subset()

subset(df, value >= 5 & value <= 8)

Post: https://www.spsanderson.com/steveondata/posts/2024-03-01/

#R

image/png

stevensanderson, to datascience
@stevensanderson@mstdn.social avatar

Learn how to set a data frame column as the index for faster data access and streamlined operations.

In R, utilize the setDT() function from or column_to_rownames() from to seamlessly set your desired column as the index. Try it out with your datasets and experience the boost in productivity!

#R 🚀📊

Post: https://www.spsanderson.com/steveondata/posts/2024-02-29/

stevensanderson, to datascience
@stevensanderson@mstdn.social avatar

Taming Your Data with Filtering in R

Feeling lost in your data jungle? Filtering is your machete!

Master data.tables:

  • Filter by conditions
  • Combine conditions
  • Filter by list values

Conquer data.frames:

  • Use logical operators
  • Subset with row indices

#R

Post: https://www.spsanderson.com/steveondata/posts/2024-02-23/

stevensanderson, to random
@stevensanderson@mstdn.social avatar

Unveiling hidden treasures: Exploring government data with R!

This code dives into a treasure trove of government data, making it more accessible for you. Here's how it works:

Fetching Data: It grabs data from a government website using R's httr2 package.

This is just a glimpse of what R can do! With its powerful tools, you can unlock valuable insights from various data sources.

#R

image/png

stevensanderson, to random
@stevensanderson@mstdn.social avatar
stevensanderson, to random
@stevensanderson@mstdn.social avatar

Extract week numbers from dates in R using strftime() & %V format code or lubridate's week() function. Just pass the date object to easily get the week number. Great for wrangling temporal data! Try it out on sample dates in R to get comfortable with date manipulation for time series analysis. Check my blog for details & examples of using these functions. Handling dates is an important R skill - give it a go!

#R

Post: https://www.spsanderson.com/steveondata/posts/2024-02-06/

stevensanderson, to datascience
@stevensanderson@mstdn.social avatar

Unleash Excel date power in R! Convert formats to proper dates effortlessly. With as.Date() & convertToDateTime(), transform data for smoother analysis. Dive into R, empower your data journey! Try it yourself & elevate your analysis game!

#DataScience #RProgramming #R #RStats #Excel

Post: https://www.spsanderson.com/steveondata/posts/2024-02-05/

stevensanderson, to languagelearning
@stevensanderson@mstdn.social avatar

Yesterday I posted the code I am working on in the attached, so what does it do?

Well its in the blogpost: https://www.spsanderson.com/steveondata/posts/2024-02-02/

#sql #dataquery #data #query #language

image/png

stevensanderson, to random
@stevensanderson@mstdn.social avatar

Get those pesky months from a date in either base R or from lubridate, the choice of course is yours but here are both ways

#R

Post: https://www.spsanderson.com/steveondata/posts/2024-01-29/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • kavyap
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • osvaldo12
  • khanakhh
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • everett
  • ngwrru68w68
  • Durango
  • anitta
  • InstantRegret
  • GTA5RPClips
  • cubers
  • ethstaker
  • normalnudes
  • tacticalgear
  • cisconetworking
  • tester
  • Leos
  • modclub
  • megavids
  • provamag3
  • lostlight
  • All magazines