Short of writing a domain specific language to translate SAS/STRATA statements into well-formed R statements, there is no satisfactory solution to making R obvious to thinkers in those languages.
Instead, consider f(x) = y, the foundational paradigm of R. x is what is at hand, y is what is desired and f is the first-class object to transform one to the other. While a deeply composed f—i(h(g(f(x))) can cause eyes to glaze over, R does not insist on wrapping it all up in a single statement, and %>% is there to make the compositional steps easier to follow, as well as intermediate object names.
Better than either is to use a basket of functions to abstract away the syntax-related barriers.
# the input, an arbitrary data frame
names(mtcars)
#> [1] "mpg" "cyl" "disp" "hp" "drat" "wt" "qsec" "vs" "am" "gear"
#> [11] "carb"
# the output desired, count
nrow(mtcars['mpg'])
#> [1] 32
# another output desired, result of division
mtcars['mpg']/2
#> mpg
#> Mazda RX4 10.50
#> Mazda RX4 Wag 10.50
#> Datsun 710 11.40
#> Hornet 4 Drive 10.70
#> Hornet Sportabout 9.35
#> Valiant 9.05
#> Duster 360 7.15
#> Merc 240D 12.20
#> Merc 230 11.40
#> Merc 280 9.60
#> Merc 280C 8.90
#> Merc 450SE 8.20
#> Merc 450SL 8.65
#> Merc 450SLC 7.60
#> Cadillac Fleetwood 5.20
#> Lincoln Continental 5.20
#> Chrysler Imperial 7.35
#> Fiat 128 16.20
#> Honda Civic 15.20
#> Toyota Corolla 16.95
#> Toyota Corona 10.75
#> Dodge Challenger 7.75
#> AMC Javelin 7.60
#> Camaro Z28 6.65
#> Pontiac Firebird 9.60
#> Fiat X1-9 13.65
#> Porsche 914-2 13.00
#> Lotus Europa 15.20
#> Ford Pantera L 7.90
#> Ferrari Dino 9.85
#> Maserati Bora 7.50
#> Volvo 142E 10.70
# function to transform input to output
find_count <- function(x,y) nrow(x[y])
find_count(mtcars,"mpg")
#> [1] 32
# function to divide input
divide_it <- function(x,y,z) x[y]/z
divide_it(mtcars,"mpg",2)
#> mpg
#> Mazda RX4 10.50
#> Mazda RX4 Wag 10.50
#> Datsun 710 11.40
#> Hornet 4 Drive 10.70
#> Hornet Sportabout 9.35
#> Valiant 9.05
#> Duster 360 7.15
#> Merc 240D 12.20
#> Merc 230 11.40
#> Merc 280 9.60
#> Merc 280C 8.90
#> Merc 450SE 8.20
#> Merc 450SL 8.65
#> Merc 450SLC 7.60
#> Cadillac Fleetwood 5.20
#> Lincoln Continental 5.20
#> Chrysler Imperial 7.35
#> Fiat 128 16.20
#> Honda Civic 15.20
#> Toyota Corolla 16.95
#> Toyota Corona 10.75
#> Dodge Challenger 7.75
#> AMC Javelin 7.60
#> Camaro Z28 6.65
#> Pontiac Firebird 9.60
#> Fiat X1-9 13.65
#> Porsche 914-2 13.00
#> Lotus Europa 15.20
#> Ford Pantera L 7.90
#> Ferrari Dino 9.85
#> Maserati Bora 7.50
#> Volvo 142E 10.70
Created on 2020-10-09 by the reprex package (v0.3.0.9001)