create account

R: select() in both MAAS and dplyr causes problems by snippets

View this thread on: hive.blogpeakd.comecency.com
· @snippets ·
$0.44
R: select() in both MAAS and dplyr causes problems
For those in tidyverse, *dplyr* has this handy function called select() that picks out just the variables based on the the column we need from a data frame. 

Unfortunately, there’s also this other cool package called MASS which also has a function called *select()*. 

When I load both of these packages into my R session and just type select(), my code breaks because I am not sure R uses what I need. 

This is where the magic of *::* comes in. It allows us to specify which package's function to call. 

For example, MASS::select() calls the select() from MASS, while dplyr::select() uses the select from dplyr. 

In rare cases would there be duplicate function names in different packages, and if we encounter such cases, specifying the package is the way to solve it.

👍  , , , , ,
properties (23)
authorsnippets
permlinkr-select-in-both-maas-and-dplyr-causes-problems
categoryhive-138200
json_metadata{"app":"peakd/2023.10.1","format":"markdown","tags":["programming","development","leofinance","rstats"],"users":[],"image":[]}
created2023-11-02 01:09:21
last_update2023-11-02 01:09:21
depth0
children0
last_payout2023-11-09 01:09:21
cashout_time1969-12-31 23:59:59
total_payout_value0.218 HBD
curator_payout_value0.217 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length775
author_reputation801,725,525,485
root_title"R: select() in both MAAS and dplyr causes problems"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id128,503,556
net_rshares893,830,811,223
author_curate_reward""
vote details (6)