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

Learn how to handle rows in R containing specific strings using base R's grep() and dplyr's filter() with str_detect(). Select or drop rows efficiently and enhance your data manipulation skills. Give it a try with your datasets for better data cleaning and organization.

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

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

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

Want to split numbers up, because why not? I go over this in todays post using gsub() and strsplit() functions from base R.

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

#R

image/png

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

I will be updating my healthyR.data package soon as well as my TidyDensity. Here is some news of new functions for healthyR.data:

https://www.spsanderson.com/healthyR.data/news/index.html#new-function-development-version

#R #RProgramming #RStats #Data #Coding #Programming #Healthcare #HealthcareData #healthdata

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

Need to split your data into groups based upon some vector in R? Well I got you covered today!

I go over base R, dplyr and data.table :)

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

#R

image/png
image/png
image/png

stevensanderson, to random
@stevensanderson@mstdn.social avatar

🚀 Elevate Your R Programming Skills: Removing Elements from Vectors

Want to level up your R programming game? Let's talk about removing specific elements from vectors! It's a fundamental skill.

But here's the real fun: try it yourself! Experiment with your own data and see which method resonates with you. To get yourself familiar with what's happening, you have to experiment.

#R #RStats #RProgramming #Data #DataFiltering #dplyr #datatable #baser

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

stevensanderson, to random
@stevensanderson@mstdn.social avatar

The newest version of my #R TidyDensity really took off for me. Now wait until the next release which introduces 39 new functions. #R

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

If you work with text data in R, the gregexpr() function is essential for pattern matching. It finds all occurrences of a pattern within a string. Key parameters include pattern, text, ignore.case, perl, fixed, and useBytes. You can match characters, ignore case, use advanced regex, and search fixed strings.

#R

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

image/png
image/png

stevensanderson, to random
@stevensanderson@mstdn.social avatar

39 new functions coming to my #R package TidyDensity at it's next release which will be soon.

#R

https://www.spsanderson.com/TidyDensity/news/index.html#tidydensity-development-version

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 programming
@stevensanderson@mstdn.social avatar
stevensanderson, to programming
@stevensanderson@mstdn.social avatar

After I update my #R Package TidyDensity there will be 176 functions...that's a lot of code I wrote. This is just a reflection. Right now it is 172.

#R

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

🔎 Selecting Columns Containing a Specific String in R: A Quick Guide 🚀

Hey R users! Need to select columns by a specific string? Here's how in base R, stringr, stringi, dplyr, and with a bonus from data.table.

🆒 R
✅ grepl
📦 stringr
📦 stringi
📦 dplyr

Bonus: 📦 data.table
library(data.table)
df_price <- df[, names(df) %like% "price"]

Happy coding! 🚀

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

#R

image/png
image/png
image/png

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

Want to check duplicate values across columns of a data.frame? Well you can do that in a basic way with TidyDensity and the check_duplicate_rows() function, or you can go through todays blog post for some other ideas with and

#R

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

image/png

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

Discover essential techniques to check for column existence in R data frames!

Use %in% with names() or colnames(), explore dynamic checks with exists() and within(), or identify patterns with grepl(). Experiment with these methods in your projects.

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

#R #RStats #RProgramming #Programming #Coding #Data

image/png

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

🔍 Quick Guide: Detecting Strings in R

In my latest blog post, I cover how to find specific strings in data columns using the str_detect function from the stringr package and base R functions. You'll see practical examples with both grepl for identifying matches and gregexpr for counting occurrences.

Read more here: https://www.spsanderson.com/steveondata/posts/2024-05-10/ and explore ways to make string detection a breeze in your data work!

#R

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 programming
@stevensanderson@mstdn.social avatar

Learn efficient ways to collapse text by group in R! Explore base R's aggregate(), dplyr's group_by() and summarise(), and data.table's grouping. Mastering these techniques enhances data preprocessing skills. Try these examples with your datasets to optimize workflows. Happy coding! 📊💻

#R

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

image/png

stevensanderson, to random
@stevensanderson@mstdn.social avatar

👍 In R, you can easily extract specific columns from a data frame by their numerical positions. For instance, to grab the second column from a data frame df, you can use df[, 2].

🙅‍♂️ You can also exclude columns by using negative indexing, such as df[, -2] to exclude the second column.

Keep exploring and happy coding!

#RProgramming #DataManipulation #DataAnalysis #R #RStats #Coding #Data

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

image/png

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

Counting NA's across columns in #R sure you can do that!!

My post today uses and to accomplish this

#R

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

image/png
image/png
image/png

stevensanderson, to random
@stevensanderson@mstdn.social avatar

Today I am writing on the AIC functions available in my hashtag#R hashtag#Package TidyDensity.

There are many of them, with many more on the way. Some of them are a little temperamental but not to worry it will all be addressed.

My approach is different then that of fitdistrplus which is an amazing package. I am trying to forgo the necessity of supplying a start list where it may at times be required.

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

#R #RStats #RProgramming #Statistics #Coding #Data

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

working on the next release of TidyDensity

#R

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

Want a simple form of #MCMC analysis in #R well, I got you covered.

My #R #Package TidyDensity has a function called tidy_mcmc_sampling() that is pretty straight forward. It takes a raw vector and performs the calculation you give it over a default of 2k samples.

I hope you find it useful.

#R #RStats #RProgramming #Programming #Statistics #Sampling

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

image/png
image/png

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

Exciting news for R users! TidyDensity's latest update introduces util_chisquare_param_estimate(), leveraging MLE to estimate Chi-square distribution parameters like dof and ncp.

Generate a dataset with rchisq() and use util_chisquare_param_estimate() to analyze it, even without knowing the underlying distribution. Visualize results with tidy_combined_autoplot().

Try it in your next R project!

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

#R

image/png
image/png
image/png

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