Brands have become intelligent. Smart too. They are now very well aware of likes and dislikes of their customer. Kudos to data! It reveals everything. Almost everything which a customer has done in past. But, it doesn’t accomplish such milestones alone. It demands the expertise and understanding of a data scientist. The use of analytics in marketing domain has become prominent. Let’s take an example to understand market analytics. A telecom company has a customer base for different products including all the user profile and transactional data. To launch a new product, a limited advertising budget is available. In such situations, it becomes increasingly important for the company to find clusters of interested customers based on their past purchase. This is not only a budget friendly approach but also brings out the value of a new designed product. This approach is nothing but Conjoint Analysis.
On my previous post I wrote about a very basic web crawler I wrote, that can randomly scour the web and mirror/download websites. Today I want to share with you a very simple script that can extract structured data from any <almost> website. Use the following script to extract specific information from any website (i.e prices, ids, titles, phone numbers etc..). Populate the “fields” parameter with the names and the patterns (regular expression) of the data you want to extract. In this specific example, I extract the product names, prices, ratings and images from Amazon.com.
Marketing borrows the biological notion of coevolution to explain the progressive ‘fit’ between products and consumers. While evolutionary time may seem a bit slow for product innovation and adoption, the same metaphor can be found in models of assimilation and accommodation from cultural and cognitive psychology. The digital camera was introduced as an alternative to film, but soon redefined how pictures are taken, stored and shared. The selfie stick is but the latest step in this process by which product usage and product features coevolve over time with previous cycles enabling the next in the chain. Is it the smartphone or the lack of fun that’s killing the camera?
Have you noticed that most R help does not contain any images? Historically, this was for a good reason: most programming language help assumes that you use the system on a text-only system, e.g. a headless linux server. If your system has no graphical capabilities, but the help contains images, then the help itself can become confusing. That said, most R users use their help on a system with full graphical capabilities. Thus the R core team updated R itself in version 2.12 to have the ability to include images in your help. The question is how do you go about creating help files that contain images?
I work with R on both Mac OS and Windows. On Windows, you get the option to copy the path of a file or folder by holding Shift while right-clicking on the file or folder. As useful as this feature is, it copies paths to your clipboard in Windows format, e.g. ‘C:\Users\someone\Documents\R\scripts\someproject\preparations.R’ That is not very nice to use in R scripts because you would have to replace every single backslash by a slash or a double backslash to use it. In this (also in other ways) very useful post, I found a nice solution for this.
Base R’s stringsAsFactors default setting is supposedly the most often complained about piece of code in the whole R infrastructure. A search through the source code of all CRAN packages in December 2015 (Link) resulted in 3,492 mentions of stringsAsFactors. Most of the time these explicit mentions where found within calls to data.frame() or as.data.frame() and simply set the value to FALSE. The hellno package provides an explicit solution to the problem without changing R itself or having to mess around with options. One could use e.g.: options(‘stringsAsFactors’ = FALSE) to re-set the global default behavior. Instead hellno tackles the problem from another direction, namely by providing alternative implementations of data.frame() and as.data.frame(). Those re-implementations are in fact simple wrappers around base R’s very own data.frame() and as.data.frame() with stringAsFactors option set to HELLNO – which in turn equals to FALSE and gives the package its name.