Mapping Functions in R

I have been buffing up on some areas of Math that I felt rusty in. One of the tools I was using was my old TI-82 calculator I used in high school.

TI-82 Graphing Calculator

I even got the TI Connect software working where I could download screenshots, etc.

TI-82 Screen Cap of Sin, Cos, Tan

You can put in data sets (see screen cap below), and do some graphing and some statistical analysis.

Data Entry on TI-82

However, mapping functions is a more straight forward use of the calculator. Which got me thinking… How does one do that in R?

I did a little digging. With the traditional R graphics and plotting functions, you would use curve() to draw a function. It works fine, but I like to use ggplot2 when I can.

Turns out ggplot2 supports this well. The following code sample maps the same functions I was mapping on the calculator (sin, cos, and tan from 0 to 2pi radians).

And the resulting graph is…

ggplot2 Trig Function Graphing

Removing Exif Data To Resolve IOS Issues

Related to my last post, I had a bug to fix. The images looked rotate 90 degrees locally, so I used Imagemagick’s convert command to rotate them 90 degrees. They looked right locally, and on the sight when viewed in chrome.

However, iOS was showing the images over-rotated by 90 degrees. It turns out after some digging that the pictures were taking on an iOS device and had saved Orientation data in the EXIF data of the image (metadata). The iOS browser was still honoring that metadata.

Because metadata also has date, time, and location info, a lot of people prefer not to publish EXIF data anyway. Photoshop offers options to remove this data when exporting. I believe GIMP may as well.

But I just wanted to make it part of my process. So I updated the Rakefile from the last post with the following command option from Imagemagick’s convert:

convert input.jpg -strip output.jpg

All is well now. Use your favorite EXIF viewer to confirm success.

Resizing Images in Bulk

I help maintain a site for a craft business. One of the challenges is multiple sizes of images for new stock each year. I used to go through and resize each image manually with a program like Gimp.

I finally got smart and installed ImageMagick.

With a Rakefile, I can pass each image into the convert command with the proper sizing, and get the output into a new folder, ready for upload. The code is shown here:

One catch to keep in mind if you work on a Mac. There can be orientation metadata from some images that OS X will honor, but a browser will not. If your images show up on the web in the wrong orientation, look into ImageMagick convert command’s -rotate option.

Data-Driven vs the Dashboard 

It is common for technical product companies to call themselves “data-driven” these days. The idea is that metrics are used to drive decisions. Sounds easy enough, and compatible with a technology landscape that is enamored with data science, etc. 

But something didn’t always feel right to me. Strange, right? If you follow this blog or know me, you probably know that I have been steering my career in a data-centric direction. I coordinate the Cleveland R User Group, and have spent most of my personal technical time with a variety of tools to do analysis and modeling. 

Maybe it’s a deeper understanding of statistics and related skills that lies at the center of my problem. Many people view these fields as black and white. “Show me the numbers”, people say. As if they are stone tablets chisled with the truth. Creating summaries, graphs, models, etc. requires understanding the domain, and subtle interactions. The tools are getting better, but we still need people to drive the tools and frame the questions right. To correct mistakes of causality. 

In explaining this, the example that hits home for me is a dashboard for a product. Have you ever tried building a B2B software product without one? Good luck when sitting in front of an executive board and you can’t show them a dashboard they can monitor. Never mind that for all of your existing customers that dashboard is the least used page in your analytics. It’s key to the sale. But if you ignore that, and just look at user data to drive all of your decisions you’ll miss that. 

So maybe there’s nothing wrong with being data-driven, it’s just that you have to be willing to mix in some decisions based on strategy and experience. And you have to ask your customers the right questions in the first place.

To be a great firm, a company should find a sophisticated middle ground. You can’t rely on a visionary employee to drive all decisions. Many founders think they are Steve Jobs and can divine all customer needs. Steve Jobs is an outlier among outliers. The answer, however, is not to turn in your brain because you started gathering data. The metrics are a tool, and you can still choose how to use your tools. A feature (or page) may still be legally required. Or it may be used rarely, but of tremendous value when it is. Data provides clarity for the many mundance decisions. It should still be up to a person to set the strategy. Otherwise, you’ll be selling a product without a dashboard. Heaven forbid…

My Next Home: Why DialogTech?

In my last post, I wrote about why I was making a change. I started in January at Ifbyphone’s Cleveland office. This week, we rebranded to DialogTech. In my opinion, a much better name.

We have software-as-a-service products (SAAS, Cloud-based, however you want to say that) around managing analytics, specifically geared towards marketing efforts. Anyone with much SEO/SEM experience knows that tracking lead sources, ad effectiveness, and other ROI indicators is key to marketing. For a lot of businesses, however, there is a real problem in that large amounts of their customers research online, but want to talk to someone before buying. Today, that is often via a telephone call, but consider the future impact of WebRTC (think Amazon Mayday on the web), Skype, Hangouts, etc. Those channels can be a blind spot for folks trying to analyze marketing effectiveness.

Our software helps businesses continue to gather intelligence across those channels. We also have software that improves the customer experience by intelligently routing customers directly to the right call agents, etc.

So why do I want to work here? A couple of reasons. First, I was looking mostly at product companies that work in either marketing or healthcare, because I believe those areas are the furthest along in terms of understanding how data science and modern tools can assist. And they have a lot of data to deal with.

Within the companies that fit that bill, I was looking for a growing opportunity where I had opportunity to make an impact. DialogTech is in a rapid expansion mode, but big enough to be stable. The company is already providing a lot of insight to our customers, but I believe there is a lot more we can do with our data. We also do a fair amount of integration and custom work, and that is a nice fit with my consulting background.

More than anything, my final qualifications were cultural. Does the team care about success, and do the leaders and owners represent a leadership I can work for. In both cases, I have been extremely happy with what I found here. The enthusiasm of a startup, mixed with the warm personalities of the midwest (Chicago and Cleveland). There is a genuine enthusiasm, without a lot of bravado and hyperbole. We are helping other businesses connect with their customers and potential customers better. Period.

Finally, via experience I have learned to take a hard look at the owners and Senior managers of a company, and see what I can perceive of their character. It may sounds naive, but I really believe it. Environments where people are solely focused on their individual success, hold open disdain for the company or their peers, these things are toxic and the company cannot overcome them. Particularly if they are present near the top.

Fortunately, I didn’t have to make many mistakes in my career in terms of direct employment. Consulting exposes you to a lot of businesses and leaders. I consulted for some great places, and some toxic places. I don’t see a need to dwell on the cost of the negative places, most people understand that. I’d rather emphasize the simplicity and support that great leaders provide that is easy to underestimate. Value it, and seek it out when you look for a job. And if you are willing to show some loyalty and sacrifice in return, you’ll form meaningful relationships with the type of people you want to work for. That will pay off more in the long-run. It’s like the compound interest of a career.

Needless to say, I liked what I saw when I took a look at our leadership here. I’m anxious to see what we can build in the coming years.