When comparing R vs Swift, the Slant community recommends Swift for most people. In the question“What are the best (productivity-enhancing, well-designed, and concise, rather than just popular or time-tested) programming languages?” Swift is ranked 30th while R is ranked 46th.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Lots of packages available
There are lots of different packages available that can be easily searched from the CRAN repo site and downloaded, or installed via the R command line interface. These packages are easy to include in a project or source file, and pertain to a wide variety of topics, from classification, social media analysis, and text processing to interactive 3d plotting and networks (including neural nets).
Pro Has a wide range of options when it comes to IDEs/GUIs
Among the IDEs available there are several commercial applications as well as free and/or open-source ones, such as R Studio, which features syntax highlighting, project management capabilities, integrated terminal access, decent code completion and on-the-spot parameter hinting, graphical interfaces for package installation and such, and commendable extensibility/developer support.
Pro Modern syntax
Pro Swift is closer to other platforms
Apple’s modern programming language is easier to understand for non-iOS developers and minimizes time for additional explanations and clarifications. Moreover, Swift can be used as a script language. It is an interesting solution for the iOS community to unify writing of build scripts. At the time being iOS developers are split up in regard to this activity. Some of them write build scripts in Bash, others use Ruby, Python, etc. Swift gives an amazing opportunity to be applied to all iOS programming needs.
More details can be found here https://mlsdev.com/blog/51-7-advantages-of-using-swift-over-objective-c
Pro Works with Apple's Cocoa and Cocoa Touch frameworks
Pro Can be used as a Just-In-Time language
Pro Inherent parallelism
Pro Low memory footprint due to reference counting
Pro Backed by Apple
Pro Performance speed comparable to native C
Pro Swift has some clever tricks up its sleeve
Due to having elements of a functional programming language. Things like 'map' and 'filter' for example.
Pro Uses LLVM compiler and Obj-C runtime allowing C, Objective-C, Objective-C++ and Swift code to run side by side within a single program
Cons
Con Swift is a moving target
They've released 1.2 so far, and 2.0 is coming soon. Every small update brings adjustments to paradigms (such as how to do type casting) that can be a little frustrating to absorb. Objective C was also constantly updating, however, but not at the same rate these days.