We use cookies, including third-party cookies from Google to serve personalized ads through AdSense, to operate this site and understand how it is used. By continuing to browse, you accept this use. See our Privacy Policy and Terms of Use for details, including how to opt out of personalized advertising.
Accept
SmartData CollectiveSmartData Collective
  • Analytics
    AnalyticsShow More: Analytics
    Cut-paper editorial diagram of public web pages flowing through a terracotta volume meter into a BI budget panel.
    The Line Item Behind Public Web Data in BI: Proxy Bandwidth
    12 Min Read
    Flat editorial illustration: The article is about joining public web signals with internal business metrics so BI teams can inter
    Alternative Data in BI: Bringing Public Web Data Into Your Dashboards
    23 Min Read
    Flat editorial illustration: The article is about automating the collection, preparation, and delivery of marketing data across p
    From Data to Dashboards: 5 Marketing Reporting Automation Software Picks
    12 Min Read
    Flat editorial illustration: The article contrasts passive follower totals with a behavioral path from attention and trust to cli
    Creator Analytics Beyond Follower Count: Seven Metrics That Measure Audience Behavior
    11 Min Read
    Flat editorial illustration: The article connects AI and marketing analytics with managerial judgment grounded in consumer behavi
    How an Online MBA in Marketing Connects AI and Data Analytics
    11 Min Read
  • Big Data
  • BI
  • Exclusive
  • IT
  • Marketing
  • Software
Search
© 2008-25 SmartData Collective. All Rights Reserved.
Reading: Vector Computing, Who Is More Powerful, R Language or esProc?
Share
Notification
Font ResizerAa
SmartData CollectiveSmartData Collective
Font ResizerAa
Search
  • About
  • Help
  • Privacy
Follow US
© 2008-23 SmartData Collective. All Rights Reserved.
SmartData Collective > R Programming Language > Vector Computing, Who Is More Powerful, R Language or esProc?
R Programming Language

Vector Computing, Who Is More Powerful, R Language or esProc?

raqsoft
raqsoft
6 Min Read
Vector Computing, Who Is More Powerful, R Language or esProc?
Illustration generated with FLUX.2 [klein 4B] via Cloudflare Workers AI.
SHARE

Do you find Vector Computing tiresome while using statistical computing tools? Here we go for a Vector Computing Comparison: R Language vs. esProc. To me, one of the most attractive features of R language and esProc is that their codes are both agile, that is, only requiring a few lines of codes to implement plentiful functions.

Do you find Vector Computing tiresome while using statistical computing tools? Here we go for a Vector Computing Comparison: R Language vs. esProc. To me, one of the most attractive features of R language and esProc is that their codes are both agile, that is, only requiring a few lines of codes to implement plentiful functions. For example, both of them allow for composing Vector Computing expression, simplify the judgment statements, extend the basic functions to the advanced ones, and support the generic type. In which, regarding the vector computing, they are characterized with the massive data processing through functions and operators, so as to avoid the loop statement. Users can benefit from 2 resulting advantages: first, easy to grasp for business experts and keep the learning cost low; second, easy to implement the parallel computation and improve the performance.

In order to show users the subtle differences between R and esProc on vector computing, we will go on with several examples below.

Firstly, let’s check the most basic functions like vector value getting and assigning. For example, get 5 values of vectors whose subscripts are from 5 to 10, and replace them with another 5 values.

More Read

How Google Uses R to Make Online Advertising More Effective
How Google Uses R to Make Online Advertising More Effective
10 Amazing Data Analytics Platforms Everyone Should Know About
Big Data Analytics a Key Enabler for Social CRM – Airlines Case Study
NCAA Data Visualizer for March Madness Face-Offs
3 Hours of Pure Soccer Emotion, Visualized with R

R solution:
01    A1<-c(51,52,53,54,55,56,57,58,59,60)
02    A2<-A1[6:10]
03    A1[6:10]<-seq(1,5)

esProc solution:
A1    =[51,52,53,54,55,56,57,58,59,60]
A2    =A1(to(6,10))
A3    >A1(to(6,10))=to(1,5)

Comments: Both of them enable users to get and assign values easily with almost the same usage. However, subjectively, I prefer using the “:” of R language to represent the interval ranges. It looks more intuitive and agile.

Then, let’s compare them on the arithmetical operations of vector.

R solution:
04    A4<-c(1,2,3)
05    A5<-c(2,4,6)
06    A4*A5 # multiplying the vector, and the result is: [1] 2 8 18
07    A4+2    #adding the vector to the constant, and the result is: [1] 3 4 5
08    ifelse(A4>1,A4+2,A4-2) #conditional evaluate, and the result is: [1] -1 4 5
09    sum(A4)    #aggregate, sum up the vector member, and the result is:6
10    sort(A4,decreasing = TRUE)    #sort reversely, and the result is: 3 2 1

esProc solution:
A4    =[1,2,3]
A5    =[2,4,6]
A6    =A4**A5    ‘multiplying the vector, and the result is: 2 4 18
A7    =A4.(~+2)    ‘adding the vector to the constant, and the result is:3 4 5
A8    =A4.(if(~>1,~+2,~-2))    ‘conditional evaluate, and the result is:-1 4 5
A9    =A4.sum()    ‘aggregating, vector member sum up, and the result is:6
A10    =A4.sort(~:-1)    ‘reverse sorting, and the result is:3 2 1

Comments: As can be seen from the above, no matter the four arithmetic operations, aggregating, or sorting operations of vector, both R and esProc can implement it well, and their syntaxes are very close. One thing worthy of notice is that the code of esProc looks more “object-oriented”, while R is truly “object-oriented” judging from the bottom layer. The former is more suitable for direct use by business experts by themselves and popular with those from the common business sector, and the latter is more suitable for programmers to compile the extended package by themselves and more acceptable to those from the scientific expertise sector.

Let us check the vector computing on the structured data, such as computations based on the Orders table from the Northwind database:
Query the data with freightage from 200 to 300.
Query the order dated 1997.
Compute the intersection set of above-mentioned sets, i.e. data not only with freightage from 200 to 300 but also with orders placed in 1997.
Group the result from the previous step by EmployeeID, and average the freightage for each employee.

R solution:
02    A2<-result[result$Freight>=200 & result$Freight<=300,]
03    A304    A4<-result[result$Freight>=200 & result$Freight<=300 & format(result$OrderDate,’%Y’)==”1997″,]
05    A5<-tapply(A2$Freight,INDEX=A2$EmployeeID,FUN=mean)

esProc solution:
A2    =A1.select(Freight>=200 && Freight<=300 && year(OrderDate)==1997)
A3    =A1.select(year(OrderDate)==1997)
A4    =A3^A4
A5    =A4.group(EmployeeID;~.avg(Freight))

Comments: R is good at querying and make statistics in groups. However, as for the set operations, R is worse than esProc. In the above example of R, the result is obtained by an indirect means of query instead of any set operations.

R can only perform the set operations on simple vectors, for example, intersect(A2$Orderid,A3$Orderid), and cannot directly implement the set operation on the structured data like data.frame.

Of course, this is not to say that the R is not powerful in vector computing. In effect, R is easier to use than esProc in the aspect of matrix-related computation. For example, to seek the eigenvalue of matrix A, R users can simply use eigen(A), while esProc users are not provided with any functions for them to represent it directly. Judging from this aspect, it proves that esProc is more suitable for business computing, while R is better in handling the scientific computation.

In conclusion, considering the vector computing, both R and esProc demonstrate perfect performance in the basic computing. More specifically speaking, R is second to none in matrix computation, and esProc (download) beats R in handling the structured data.

TAGGED:esProcvector
Share This Article
Facebook Pinterest LinkedIn
Share

Follow us on Facebook

Latest News

Flat illustration of vermilion data packets following separate paths through charcoal relay nodes.
5 Residential Rotating Proxy Services for Web Scraping
Data Collection Exclusive Privacy
Cut-paper scene of split mobile and TV signal cards passing through a charcoal bridge and vermilion reconciliation gates.
Data Fragmentation and Measurement Gaps in Programmatic
Big Data Exclusive
Cut-paper editorial scene of labeled data cards passing through a charcoal inspection frame and vermilion quality gates.
How to Measure Data Annotation Quality Before Release
Big Data Exclusive
Cut-paper editorial diagram of service callback tickets moving through a terracotta sorter into rising scorecard bars.
Why Your Redo Jobs Hold the Best Data in Your Franchise
Big Data Data Collection Exclusive

Stay Connected

1.2KFollowersLike
33.7KFollowersFollow
222FollowersPin

You Might also Like

Simple Inter-row Computation: esProc Keeps It Simple!
R Programming Language

Simple Inter-row Computation: esProc Keeps It Simple!

7 Min Read
Using esProc to Compute the Online Time of Users [PART 2]
Software

Using esProc to Compute the Online Time of Users [PART 2]

5 Min Read
esProc Improves Text Processing: Fetching Data from a Batch of Files
Uncategorized

esProc Improves Text Processing: Fetching Data from a Batch of Files

6 Min Read

SmartData Collective is one of the largest & trusted community covering technical content about Big Data, BI, Cloud, Analytics, Artificial Intelligence, IoT & more.

ai chatbot
How AI Website Chatbots Improve Customer Support and Lead Generation
Chatbots Exclusive
The Art of Conversation: Enhancing Chatbots with Advanced AI Prompts
The Art of Conversation: Enhancing Chatbots with Advanced AI Prompts
Chatbots

Quick Link

  • About
  • Contact
  • Privacy
Follow US
© 2008-26 SmartData Collective. All Rights Reserved.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?