c:itamc:2017

# Intro. to the media content, advanced

Introduction
Introduction to social network analysis

data file: textmining.zip
create Textmining directory in R working directory.
Unzip the zip file.

# e.g. 1

NeededPackages <- c("tm", "SnowballC", "RColorBrewer", "ggplot2", "wordcloud", "biclust",
"cluster", "igraph", "fpc")
install.packages(NeededPackages, dependencies = TRUE)
Sys.setlocale(category = "LC_ALL", locale = "US")
library(tm)
#Create Corpus
docs <- Corpus(DirSource("C:/Users/Hyo/Documents/R/textMining"))
docs
#inspect a particular document
writeLines(as.character(docs[[30]]))
getTransformations()

#create the toSpace content transformer
toSpace <- content_transformer(function(x, pattern) {return (gsub(pattern, " ", x))})
docs <- tm_map(docs, toSpace, "-")
docs <- tm_map(docs, toSpace, ":")
#Remove punctuation ? replace punctuation marks with " "
docs <- tm_map(docs, removePunctuation)

docs <- tm_map(docs, toSpace, "’")
docs <- tm_map(docs, toSpace, "‘")
docs <- tm_map(docs, toSpace, " -")
#Transform to lower case (need to wrap in content_transformer)
docs <- tm_map(docs,content_transformer(tolower))
#Strip digits (std transformation, so no need for content_transformer)
docs <- tm_map(docs, removeNumbers)
#remove stopwords using the standard list in tm
docs <- tm_map(docs, removeWords, stopwords("english"))
#Strip whitespace (cosmetic?)
docs <- tm_map(docs, stripWhitespace)
writeLines(as.character(docs[[30]]))
#load library
library(SnowballC)

#Stem document
docs <- tm_map(docs,stemDocument)
writeLines(as.character(docs[[30]]))
docs <- tm_map(docs, content_transformer(gsub), pattern = "organiz", replacement = "organ")
docs <- tm_map(docs, content_transformer(gsub), pattern = "organis", replacement = "organ")
docs <- tm_map(docs, content_transformer(gsub), pattern = "andgovern", replacement = "govern")
docs <- tm_map(docs, content_transformer(gsub), pattern = "inenterpris", replacement = "enterpris")
docs <- tm_map(docs, content_transformer(gsub), pattern = "team-", replacement = "team")
dtm <- DocumentTermMatrix(docs)
dtm
inspect(dtm[1:2,1000:1005])
freq <- colSums(as.matrix(dtm))
#length should be total number of terms
length(freq)
#create sort order (descending)
ord <- order(freq,decreasing=TRUE)
#inspect most frequently occurring terms

#inspect least frequently occurring terms
freq[tail(ord)]   
dtmr <-DocumentTermMatrix(docs, control=list(wordLengths=c(4, 20), bounds = list(global = c(3,27))))
dtmr
freqr <- colSums(as.matrix(dtmr))
#length should be total number of terms
length(freqr)

#create sort order (asc)
ordr <- order(freqr,decreasing=TRUE)

#inspect most frequently occurring terms

#inspect least frequently occurring terms
freqr[tail(ordr)]
findFreqTerms(dtmr,lowfreq=80)
findAssocs(dtmr, "project", 0.6)
findAssocs(dtmr, "enterpris", 0.6)
findAssocs(dtmr, "system", 0.6)
wf=data.frame(term=names(freqr),occurrences=freqr)
library(ggplot2)
p <- ggplot(subset(wf, freqr>100), aes(term, occurrences))
p <- p + geom_bar(stat="identity")
p <- p + theme(axis.text.x=element_text(angle=45, hjust=1))
p
#wordcloud
library(wordcloud)
#setting the same seed each time ensures consistent look across clouds
set.seed(42)
#limit words by specifying min frequency
wordcloud(names(freqr),freqr, min.freq=70)
#…add color
wordcloud(names(freqr),freqr,min.freq=70,colors=brewer.pal(6,"Dark2"))


# e.g. 1 with output

> Sys.setlocale(category = "LC_ALL", locale = "US")
[1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252"
> library(tm)
> #Create Corpus
> docs <- Corpus(DirSource("D:/Users/Hyo/Documents/TextMining"))
> docs
<<SimpleCorpus>>
Metadata:  corpus specific: 1, document level (indexed): 0
Content:  documents: 30
> #inspect a particular document
> writeLines(as.character(docs[[30]]))
Understanding "flexibility" ?a close-up view of an organizational platitude

Introduction
Flexibility is one of those buzzwords that keeps coming up in organizational communiques and discussions. People are continually asked to display flexibility, without ever being told what the term means:  flexible workplaces, flexible attitudes, flexible jobs ?the word itself has a flexible meaning that depends on the context in which it is used and by whom.
When words are used in this way they become platitudes ?empty words that make a lot of noise. In this post, I analyse the platitude, flexibility, as it is used in organisations. My discussion is based on a paper by Thomas Eriksen entitled, Mind the Gap: Flexibility, Epistemology and the Rhetoric of New Work.
Background ?a bit about organizational platitudes
One of the things that struck me when I moved from academia to industry is the difference in the way words or phrases are used in the two domains. In academics one has to carefully define the terms one uses (particularly if one is coining a new term) whereas in business it doesn't seem to matter, words can mean whatever one wants them to mean (OK, this is an exaggeration, but not by too much). Indeed, as Paul Culmsee and I discuss in the first chapter of The Heretic's Guide to Best Practices, many terms that are commonly bandied about in organizations are platitudes because they are understood differently by different people.
A good example of a platitude is the word governance. One manager may see governance as being largely about oversight and control whereas another might interpret it as being about providing guidance.  Such varying interpretations can result in major differences in the way the two managers implement governance:  the first one might enforce it as a compliance-oriented set of processes that leave little room for individual judgement while the other might implement it as a broad set of guidelines that leave many of the decisions in the hands of those who are actually doing the work. Needless to say, the results in the two cases are likely to be different too.
Flexibility ?the conventional view
A good place to start our discussion of flexibility is with the dictionary. The online Oxford Dictionary defines at as:
Flexibility (noun):
the ability to be easily modified
willingness to change or compromise
The term is widely used in both these senses in organizational settings. For example, people speak of flexible designs (i.e. designs that can be easily modified) or flexible people (referring to those who are willing to change or compromise). However,  and this is the problem:  the term is open to interpretation ?what Jack might term a flexible approach may be seen by Jill as a complete lack of method. These differences in interpretation become particularly obvious when the word is used in a broad context ?such as in a statement justifying an organizational change.  An executive might see a corporate restructure and the resulting changes in jobs/roles as a means to achieve organizational flexibility, but those affected by it may see it as constraining theirs.  As Eriksen states:
Jobs are flexible in the sense that they are unstable and uncertain, few employees hold the same jobs for many years, the content of jobs can be changed almost overnight, and the boundaries between work and leisure are negotiable and chronically fuzzy.
Indeed, such "flexibility" which requires one to change at short notice results in a fragmentation of individual experience and a resulting loss of a coherent narrative of one's life. It appears that increased flexibility in one aspect results in a loss of flexibility in another. Any sensible definition of flexibility ought to reflect this.
Understanding flexibility
Consider the following definition of flexibility proposed by Gregory Bateson:
"Flexibility is uncommitted potential for change"
This deceptively simple statement is a good place to start understanding what flexibility really means for projects, organisations 꿢nd even software systems.
As Eriksen tells us, Bateson proposed this definition in the context of ecology. In particular, Bateson had in mind the now obvious notion that the increased flexibility we gain through our increasingly energy-hungry lifestyles results in a decrease in the environment's capacity to cope with the consequences. This is true of flexibility in any context: a gain in flexibility in one dimension will necessarily be accompanied by a loss of flexibility in another.
Another implication of the above definition is that a system that is running at or near the limits of its operating variables cannot be flexible.  The following examples should make this clear:
A project team that is putting in 18 hour workdays in order to finish a project on time.
A car that's being driven at top speed.
A family living beyond their means.
All these systems are operating at or near their limits, they have little or no spare capacity to accommodate change.
A third implication of the definition follows from the preceding one:  the key variables of a flexible system should lie in the mid-range of their upper and lower limits. In terms of above examples:
The project team should be putting in normal hours.
The car should be driven at or below the posted road speed limits
The family should be living within its income, with a reasonable amount to spare.
Of course, the whole point of ensuring that systems operate in their comfort zone is that they can be revved up if the need arises. Such revving up, however,  should be an exceptional circumstance rather than the norm ?a point that those who run projects, organisations (and, yes, even vehicles) often tend to forget. If one operates a system at the limits of its tolerance for too long, not only will it not be flexible, it will break.
Flexibility in the workplace
As mentioned in the introduction, the term flexibility keeps cropping up in organizational settings: corporate communiques exhort employees to be flexible in the face of change.  This is typically a coded signal that employees should expect uncertainty and be prepared to adjust to it.  A related manifestation of flexibility is the blurring of the distinction between work and personal life. As Eriksen puts it:
The term flexibility is often used to describe this new situation: Jobs are flexible in the sense that they are unstable and uncertain, few employees hold the same jobs for many years, the content of jobs can be changed, and the boundaries between work and leisure are poorly defined.
This trend is aided by recent developments in technology that enable employees to be perpetually on call. This is often sold as a work from home initiative but usually ends up being much more.  Eriksen has this to say about home offices:
One recent innovation typically associated with flexibility is the home office. In Scandinavia (and some other prosperous, technologically optimistic regions), many companies equipped some of their employees with home computers with online access to the company network in the early 1990s, in order to enhance their flexibility. This was intended to enable employees to work from home part of the time, thereby making the era when office workers were chained to the office desk all day obsolete.
In the early days, there were widespread worries among employers to the effect that a main outcome of this new flexibility would consist in a reduction of productivity. Since there was no legitimate way of checking how the staff actually spent their time out of the office, it was often suspected that they worked less from home than they were supposed to. If this were in fact the case, working from home would have led to a real increase in the flexibility of time budgeting. However, work researchers eventually came up with a different picture. By the late 1990s, hardly anybody spoke of the home office as a convenient way of escaping from work; rather, the concern among unionists as well as researchers was now that increasing numbers of employees were at pains to distinguish between working hours and leisure time, and were suffering symptoms of burnout and depression. The home office made it difficult to distinguish between contexts that were formerly mutually exclusive because of differ... <truncated>
It is interesting to see this development in the light of Bateson's definition of flexibility: the employee gains flexibility in space (he or she can work from home or from the office) at the expense of flexibility in time(organization time encroaches on personal time). As Eriksen states:
There seems to be a classic Batesonian flexibility trade-off associated with the new information technologies: increased spatial flexibility entails decreased temporal flexibility. If inaccessibility and 'empty time' are understood as scarce resources, the context of 'new work' thus seems to be an appropriate context for a new economics as well. In fact, a main environmental challenge of our near future will consist in protecting slow time and gaps from environmental degradation.
In short, it appears that flexibility for the organization necessarily implies a loss of flexibility for the individual.
Conclusion
Flexibility is in the eye of the beholder: an action to increase organisational flexibility by, say, redeploying employees would likely be seen by those affected as a move that constrains their  (individual) flexibility.  Such a dual meaning is characteristic of many organizational platitudes such as Excellence, Synergy andGovernance. It is an interesting exercise to analyse such platitudes and expose the difference between their espoused and actual meanings.  So I sign off for 2013, wishing you  many hours of platitude-deconstructing fun :-)
> getTransformations()
[1] "removeNumbers"     "removePunctuation" "removeWords"       "stemDocument"      "stripWhitespace"
> #create the toSpace content transformer
> toSpace <- content_transformer(function(x, pattern) {return (gsub(pattern, " ", x))})
> docs <- tm_map(docs, toSpace, "-")
> docs <- tm_map(docs, toSpace, ":")
> #Remove punctuation ? replace punctuation marks with " "
> docs <- tm_map(docs, removePunctuation)
>
> docs <- tm_map(docs, toSpace, "’")
> docs <- tm_map(docs, toSpace, "‘")
> docs <- tm_map(docs, toSpace, " -")
> #Transform to lower case (need to wrap in content_transformer)
> docs <- tm_map(docs,content_transformer(tolower))
> #Strip digits (std transformation, so no need for content_transformer)
> docs <- tm_map(docs, removeNumbers)
> #remove stopwords using the standard list in tm
> docs <- tm_map(docs, removeWords, stopwords("english"))
> #Strip whitespace (cosmetic?)
> docs <- tm_map(docs, stripWhitespace)
> writeLines(as.character(docs[[30]]))
understanding flexibility ?close view organizational platitude introduction flexibility one buzzwords keeps coming organizational communiques discussions people continually asked display flexibility without ever told term means flexible workplaces flexible attitudes flexible jobs ?word flexible meaning depends context used words used way become platitudes ?empty words make lot noise post analyse platitude flexibility used organisations discussion based paper thomas eriksen entitled mind gap flexibility epistemology rhetoric new work background ?bit organizational platitudes one things struck moved academia industry difference way words phrases used two domains academics one carefully define terms one uses particularly one coining new term whereas business doesnt seem matter words can mean whatever one wants mean ok exaggeration much indeed paul culmsee discuss first chapter heretics guide best practices many terms commonly bandied organizations platitudes understood differently differe... <truncated>
> library(SnowballC)
>
> #Stem document
> docs <- tm_map(docs,stemDocument)
> writeLines(as.character(docs[[30]]))
understand flexibl ?close view organiz platitud introduct flexibl one buzzword keep come organiz communiqu discuss peopl continu ask display flexibl without ever told term mean flexibl workplac flexibl attitud flexibl job ?word flexibl mean depend context use word use way becom platitud ?empti word make lot nois post analys platitud flexibl use organis discuss base paper thoma eriksen entitl mind gap flexibl epistemolog rhetor new work background ?bit organiz platitud one thing struck move academia industri differ way word phrase use two domain academ one care defin term one use particular one coin new term wherea busi doesnt seem matter word can mean whatev one want mean ok exagger much inde paul culmse discuss first chapter heret guid best practic mani term common bandi organ platitud understood differ differ peopl good exampl platitud word govern one manag may see govern larg oversight control wherea anoth might interpret provid guidanc vari interpret can result major differ way two... <truncated>
> docs <- tm_map(docs, content_transformer(gsub), pattern = "organiz", replacement = "organ")
> docs <- tm_map(docs, content_transformer(gsub), pattern = "organis", replacement = "organ")
> docs <- tm_map(docs, content_transformer(gsub), pattern = "andgovern", replacement = "govern")
> docs <- tm_map(docs, content_transformer(gsub), pattern = "inenterpris", replacement = "enterpris")
> docs <- tm_map(docs, content_transformer(gsub), pattern = "team-", replacement = "team")
> dtm <- DocumentTermMatrix(docs)
> dtm
<<DocumentTermMatrix (documents: 30, terms: 3902)>>
Non-/sparse entries: 13979/103081
Sparsity           : 88%
Maximal term length: 48
Weighting          : term frequency (tf)
> inspect(dtm[1:2,1000:1005])
<<DocumentTermMatrix (documents: 2, terms: 6)>>
Non-/sparse entries: 0/12
Sparsity           : 100%
Maximal term length: 7
Weighting          : term frequency (tf)
Sample             :
Terms
Docs                                 critic current cya cynefin david decid
BeyondEntitiesAndRelationships.txt      0       0   0       0     0     0
bigdata.txt                             0       0   0       0     0     0
> freq <- colSums(as.matrix(dtm))
> #length should be total number of terms
> length(freq)
[1] 3902
> #create sort order (descending)
> ord <- order(freq,decreasing=TRUE)
> #inspect most frequently occurring terms
one  organ    can  manag   work system
325    275    244    230    209    193
>
> #inspect least frequently occurring terms
> freq[tail(ord)]
therebi timeorgan  uncommit  unionist   willing   workday
1         1         1         1         1         1
> dtmr <-DocumentTermMatrix(docs, control=list(wordLengths=c(4, 20), bounds = list(global = c(3,27))))
> dtmr
<<DocumentTermMatrix (documents: 30, terms: 1294)>>
Non-/sparse entries: 10071/28749
Sparsity           : 74%
Maximal term length: 15
Weighting          : term frequency (tf)
> freqr <- colSums(as.matrix(dtmr))
> #length should be total number of terms
> length(freqr)
[1] 1294
>
> #create sort order (asc)
> ordr <- order(freqr,decreasing=TRUE)
>
> #inspect most frequently occurring terms
organ   manag    work  system project problem
275     230     209     193     185     173
>
> #inspect least frequently occurring terms
> freqr[tail(ordr)]
hmmm struck multin  lower pseudo  gloss
3      3      3      3      3      3
> findFreqTerms(dtmr,lowfreq=80)
[1] "action"     "approach"   "base"       "busi"       "data"       "design"     "develop"    "differ"     "discuss"    "enterpris"  "exampl"
[12] "group"      "howev"      "import"     "issu"       "make"       "manag"      "mani"       "model"      "often"      "organ"      "peopl"
[23] "point"      "practic"    "problem"    "process"    "project"    "question"   "said"       "situat"     "system"     "thing"      "think"
[34] "time"       "understand" "view"       "well"       "will"       "work"       "chang"      "consult"    "decis"      "even"       "like"
> findAssocs(dtmr, "project", 0.6)
$project inher manag handl occurr 0.82 0.69 0.68 0.67 > findAssocs(dtmr, "enterpris", 0.6)$enterpris
agil   increment     realist     upfront   technolog        solv     neither    movement       happi       adapt   architect architectur       chanc
0.81        0.79        0.77        0.76        0.69        0.68        0.68        0.66        0.66        0.65        0.65        0.65        0.63
fine      featur
0.63        0.62

> findAssocs(dtmr, "system", 0.6)
$system design subset adopt user involv specifi function intend step softwar specif intent compos depart phone frequent today 0.78 0.78 0.77 0.75 0.71 0.71 0.70 0.67 0.67 0.67 0.66 0.66 0.66 0.65 0.63 0.62 0.62 pattern author wherea cognit 0.61 0.60 0.60 0.60 > wf=data.frame(term=names(freqr),occurrences=freqr) > library(ggplot2) > p <- ggplot(subset(wf, freqr>100), aes(term, occurrences)) > p <- p + geom_bar(stat="identity") > p <- p + theme(axis.text.x=element_text(angle=45, hjust=1)) > p > #wordcloud > library(wordcloud) > #setting the same seed each time ensures consistent look across clouds > set.seed(42) > #limit words by specifying min frequency > wordcloud(names(freqr),freqr, min.freq=70) > #…add color > wordcloud(names(freqr),freqr,min.freq=70,colors=brewer.pal(6,"Dark2")) > dtmr <<DocumentTermMatrix (documents: 30, terms: 1294)>> Non-/sparse entries: 10071/28749 Sparsity : 74% Maximal term length: 15 Weighting : term frequency (tf) > inspect(dtmr[1:5]) Error in x$nrow : $operator is invalid for atomic vectors > inspect(dtmr) <<DocumentTermMatrix (documents: 30, terms: 1294)>> Non-/sparse entries: 10071/28749 Sparsity : 74% Maximal term length: 15 Weighting : term frequency (tf) Sample : Terms Docs approach differ exampl manag organ problem project system will work BeyondEntitiesAndRelationships.txt 13 14 6 8 8 5 1 6 12 0 ConditionsOverCauses.txt 16 2 5 9 14 5 2 4 5 13 EmergentDesignInEnterpriseIT.txt 13 11 8 6 8 16 17 13 11 4 FromInformationToKnowledge.txt 2 7 21 7 9 16 4 21 5 10 MakingSenseOfOrganizationalChange.txt 7 4 10 10 26 14 7 6 12 25 MakingSenseOfSensemaking.txt 13 17 15 7 12 12 16 9 18 12 RoutinesAndReality.txt 1 7 2 3 10 6 4 36 8 13 SixHeresiesForBI.txt 2 2 7 3 7 4 0 4 6 5 TheEssenceOfEntrepreneurship.txt 7 15 15 2 2 5 1 0 10 10 ThreeTypesOfUncertainty.txt 20 6 15 9 3 15 1 0 6 7 > dtm <<DocumentTermMatrix (documents: 30, terms: 3902)>> Non-/sparse entries: 13979/103081 Sparsity : 88% Maximal term length: 48 Weighting : term frequency (tf) > dtmr <<DocumentTermMatrix (documents: 30, terms: 1294)>> Non-/sparse entries: 10071/28749 Sparsity : 74% Maximal term length: 15 Weighting : term frequency (tf) > inspect(dtm) <<DocumentTermMatrix (documents: 30, terms: 3902)>> Non-/sparse entries: 13979/103081 Sparsity : 88% Maximal term length: 48 Weighting : term frequency (tf) Sample : Terms Docs can manag one organ problem project system use way work BeyondEntitiesAndRelationships.txt 26 8 15 8 5 1 6 18 9 0 ConditionsOverCauses.txt 8 9 7 14 5 2 4 1 3 13 EmergentDesignInEnterpriseIT.txt 15 6 28 8 16 17 13 14 11 4 FromInformationToKnowledge.txt 35 7 17 9 16 4 21 25 8 10 MakingSenseOfOrganizationalChange.txt 15 10 26 26 14 7 6 10 27 25 MakingSenseOfSensemaking.txt 25 7 26 12 12 16 9 27 21 12 RoutinesAndReality.txt 8 3 13 10 6 4 36 16 9 13 SixHeresiesForBI.txt 6 3 10 7 4 0 4 9 2 5 TheEssenceOfEntrepreneurship.txt 5 2 24 2 5 1 0 6 30 10 ThreeTypesOfUncertainty.txt 13 9 18 3 15 1 0 3 4 7 > Sys.setlocale(category = "LC_ALL", locale = "US") [1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252" > library(tm) > #Create Corpus > docs <- Corpus(DirSource("D:/Users/Hyo/Documents/TextMining")) > docs <<SimpleCorpus>> Metadata: corpus specific: 1, document level (indexed): 0 Content: documents: 30 > #inspect a particular document > writeLines(as.character(docs[[30]])) Understanding "flexibility" ?a close-up view of an organizational platitude Introduction Flexibility is one of those buzzwords that keeps coming up in organizational communiques and discussions. People are continually asked to display flexibility, without ever being told what the term means: flexible workplaces, flexible attitudes, flexible jobs ?the word itself has a flexible meaning that depends on the context in which it is used and by whom. When words are used in this way they become platitudes ?empty words that make a lot of noise. In this post, I analyse the platitude, flexibility, as it is used in organisations. My discussion is based on a paper by Thomas Eriksen entitled, Mind the Gap: Flexibility, Epistemology and the Rhetoric of New Work. Background ?a bit about organizational platitudes One of the things that struck me when I moved from academia to industry is the difference in the way words or phrases are used in the two domains. In academics one has to carefully define the terms one uses (particularly if one is coining a new term) whereas in business it doesn't seem to matter, words can mean whatever one wants them to mean (OK, this is an exaggeration, but not by too much). Indeed, as Paul Culmsee and I discuss in the first chapter of The Heretic's Guide to Best Practices, many terms that are commonly bandied about in organizations are platitudes because they are understood differently by different people. A good example of a platitude is the word governance. One manager may see governance as being largely about oversight and control whereas another might interpret it as being about providing guidance. Such varying interpretations can result in major differences in the way the two managers implement governance: the first one might enforce it as a compliance-oriented set of processes that leave little room for individual judgement while the other might implement it as a broad set of guidelines that leave many of the decisions in the hands of those who are actually doing the work. Needless to say, the results in the two cases are likely to be different too. Flexibility ?the conventional view A good place to start our discussion of flexibility is with the dictionary. The online Oxford Dictionary defines at as: Flexibility (noun): the ability to be easily modified willingness to change or compromise The term is widely used in both these senses in organizational settings. For example, people speak of flexible designs (i.e. designs that can be easily modified) or flexible people (referring to those who are willing to change or compromise). However, and this is the problem: the term is open to interpretation ?what Jack might term a flexible approach may be seen by Jill as a complete lack of method. These differences in interpretation become particularly obvious when the word is used in a broad context ?such as in a statement justifying an organizational change. An executive might see a corporate restructure and the resulting changes in jobs/roles as a means to achieve organizational flexibility, but those affected by it may see it as constraining theirs. As Eriksen states: Jobs are flexible in the sense that they are unstable and uncertain, few employees hold the same jobs for many years, the content of jobs can be changed almost overnight, and the boundaries between work and leisure are negotiable and chronically fuzzy. Indeed, such "flexibility" which requires one to change at short notice results in a fragmentation of individual experience and a resulting loss of a coherent narrative of one's life. It appears that increased flexibility in one aspect results in a loss of flexibility in another. Any sensible definition of flexibility ought to reflect this. Understanding flexibility Consider the following definition of flexibility proposed by Gregory Bateson: "Flexibility is uncommitted potential for change" This deceptively simple statement is a good place to start understanding what flexibility really means for projects, organisations 꿢nd even software systems. As Eriksen tells us, Bateson proposed this definition in the context of ecology. In particular, Bateson had in mind the now obvious notion that the increased flexibility we gain through our increasingly energy-hungry lifestyles results in a decrease in the environment's capacity to cope with the consequences. This is true of flexibility in any context: a gain in flexibility in one dimension will necessarily be accompanied by a loss of flexibility in another. Another implication of the above definition is that a system that is running at or near the limits of its operating variables cannot be flexible. The following examples should make this clear: A project team that is putting in 18 hour workdays in order to finish a project on time. A car that's being driven at top speed. A family living beyond their means. All these systems are operating at or near their limits, they have little or no spare capacity to accommodate change. A third implication of the definition follows from the preceding one: the key variables of a flexible system should lie in the mid-range of their upper and lower limits. In terms of above examples: The project team should be putting in normal hours. The car should be driven at or below the posted road speed limits The family should be living within its income, with a reasonable amount to spare. Of course, the whole point of ensuring that systems operate in their comfort zone is that they can be revved up if the need arises. Such revving up, however, should be an exceptional circumstance rather than the norm ?a point that those who run projects, organisations (and, yes, even vehicles) often tend to forget. If one operates a system at the limits of its tolerance for too long, not only will it not be flexible, it will break. Flexibility in the workplace As mentioned in the introduction, the term flexibility keeps cropping up in organizational settings: corporate communiques exhort employees to be flexible in the face of change. This is typically a coded signal that employees should expect uncertainty and be prepared to adjust to it. A related manifestation of flexibility is the blurring of the distinction between work and personal life. As Eriksen puts it: The term flexibility is often used to describe this new situation: Jobs are flexible in the sense that they are unstable and uncertain, few employees hold the same jobs for many years, the content of jobs can be changed, and the boundaries between work and leisure are poorly defined. This trend is aided by recent developments in technology that enable employees to be perpetually on call. This is often sold as a work from home initiative but usually ends up being much more. Eriksen has this to say about home offices: One recent innovation typically associated with flexibility is the home office. In Scandinavia (and some other prosperous, technologically optimistic regions), many companies equipped some of their employees with home computers with online access to the company network in the early 1990s, in order to enhance their flexibility. This was intended to enable employees to work from home part of the time, thereby making the era when office workers were chained to the office desk all day obsolete. In the early days, there were widespread worries among employers to the effect that a main outcome of this new flexibility would consist in a reduction of productivity. Since there was no legitimate way of checking how the staff actually spent their time out of the office, it was often suspected that they worked less from home than they were supposed to. If this were in fact the case, working from home would have led to a real increase in the flexibility of time budgeting. However, work researchers eventually came up with a different picture. By the late 1990s, hardly anybody spoke of the home office as a convenient way of escaping from work; rather, the concern among unionists as well as researchers was now that increasing numbers of employees were at pains to distinguish between working hours and leisure time, and were suffering symptoms of burnout and depression. The home office made it difficult to distinguish between contexts that were formerly mutually exclusive because of differ... <truncated> It is interesting to see this development in the light of Bateson's definition of flexibility: the employee gains flexibility in space (he or she can work from home or from the office) at the expense of flexibility in time(organization time encroaches on personal time). As Eriksen states: There seems to be a classic Batesonian flexibility trade-off associated with the new information technologies: increased spatial flexibility entails decreased temporal flexibility. If inaccessibility and 'empty time' are understood as scarce resources, the context of 'new work' thus seems to be an appropriate context for a new economics as well. In fact, a main environmental challenge of our near future will consist in protecting slow time and gaps from environmental degradation. In short, it appears that flexibility for the organization necessarily implies a loss of flexibility for the individual. Conclusion Flexibility is in the eye of the beholder: an action to increase organisational flexibility by, say, redeploying employees would likely be seen by those affected as a move that constrains their (individual) flexibility. Such a dual meaning is characteristic of many organizational platitudes such as Excellence, Synergy andGovernance. It is an interesting exercise to analyse such platitudes and expose the difference between their espoused and actual meanings. So I sign off for 2013, wishing you many hours of platitude-deconstructing fun :-) > getTransformations() [1] "removeNumbers" "removePunctuation" "removeWords" "stemDocument" [5] "stripWhitespace" > #create the toSpace content transformer > toSpace <- content_transformer(function(x, pattern) {return (gsub(pattern, " ", x))}) > docs <- tm_map(docs, toSpace, "-") > docs <- tm_map(docs, toSpace, ":") > #Remove punctuation ? replace punctuation marks with " " > docs <- tm_map(docs, removePunctuation) > > docs <- tm_map(docs, toSpace, "’") > docs <- tm_map(docs, toSpace, "‘") > docs <- tm_map(docs, toSpace, " -") > #Transform to lower case (need to wrap in content_transformer) > docs <- tm_map(docs,content_transformer(tolower)) > #Strip digits (std transformation, so no need for content_transformer) > docs <- tm_map(docs, removeNumbers) > #remove stopwords using the standard list in tm > docs <- tm_map(docs, removeWords, stopwords("english")) > #Strip whitespace (cosmetic?) > docs <- tm_map(docs, stripWhitespace) > writeLines(as.character(docs[[30]])) understanding flexibility ?close view organizational platitude introduction flexibility one buzzwords keeps coming organizational communiques discussions people continually asked display flexibility without ever told term means flexible workplaces flexible attitudes flexible jobs ?word flexible meaning depends context used words used way become platitudes ?empty words make lot noise post analyse platitude flexibility used organisations discussion based paper thomas eriksen entitled mind gap flexibility epistemology rhetoric new work background ?bit organizational platitudes one things struck moved academia industry difference way words phrases used two domains academics one carefully define terms one uses particularly one coining new term whereas business doesnt seem matter words can mean whatever one wants mean ok exaggeration much indeed paul culmsee discuss first chapter heretics guide best practices many terms commonly bandied organizations platitudes understood differently differe... <truncated> > #load library > library(SnowballC) > > #Stem document > docs <- tm_map(docs,stemDocument) > writeLines(as.character(docs[[30]])) understand flexibl ?close view organiz platitud introduct flexibl one buzzword keep come organiz communiqu discuss peopl continu ask display flexibl without ever told term mean flexibl workplac flexibl attitud flexibl job ?word flexibl mean depend context use word use way becom platitud ?empti word make lot nois post analys platitud flexibl use organis discuss base paper thoma eriksen entitl mind gap flexibl epistemolog rhetor new work background ?bit organiz platitud one thing struck move academia industri differ way word phrase use two domain academ one care defin term one use particular one coin new term wherea busi doesnt seem matter word can mean whatev one want mean ok exagger much inde paul culmse discuss first chapter heret guid best practic mani term common bandi organ platitud understood differ differ peopl good exampl platitud word govern one manag may see govern larg oversight control wherea anoth might interpret provid guidanc vari interpret can result major differ way two... <truncated> > docs <- tm_map(docs, content_transformer(gsub), pattern = "organiz", replacement = "organ") > docs <- tm_map(docs, content_transformer(gsub), pattern = "organis", replacement = "organ") > docs <- tm_map(docs, content_transformer(gsub), pattern = "andgovern", replacement = "govern") > docs <- tm_map(docs, content_transformer(gsub), pattern = "inenterpris", replacement = "enterpris") > docs <- tm_map(docs, content_transformer(gsub), pattern = "team-", replacement = "team") > dtm <- DocumentTermMatrix(docs) > dtm <<DocumentTermMatrix (documents: 30, terms: 3902)>> Non-/sparse entries: 13979/103081 Sparsity : 88% Maximal term length: 48 Weighting : term frequency (tf) > inspect(dtm[1:2,1000:1005]) <<DocumentTermMatrix (documents: 2, terms: 6)>> Non-/sparse entries: 0/12 Sparsity : 100% Maximal term length: 7 Weighting : term frequency (tf) Sample : Terms Docs critic current cya cynefin david decid BeyondEntitiesAndRelationships.txt 0 0 0 0 0 0 bigdata.txt 0 0 0 0 0 0 > freq <- colSums(as.matrix(dtm)) > #length should be total number of terms > length(freq) [1] 3902 > #create sort order (descending) > ord <- order(freq,decreasing=TRUE) > #inspect most frequently occurring terms > freq[head(ord)] one organ can manag work system 325 275 244 230 209 193 > > #inspect least frequently occurring terms > freq[tail(ord)] therebi timeorgan uncommit unionist willing workday 1 1 1 1 1 1 > dtmr <-DocumentTermMatrix(docs, control=list(wordLengths=c(4, 20), bounds = list(global = c(3,27)))) > dtmr <<DocumentTermMatrix (documents: 30, terms: 1294)>> Non-/sparse entries: 10071/28749 Sparsity : 74% Maximal term length: 15 Weighting : term frequency (tf) > freqr <- colSums(as.matrix(dtmr)) > #length should be total number of terms > length(freqr) [1] 1294 > > #create sort order (asc) > ordr <- order(freqr,decreasing=TRUE) > > #inspect most frequently occurring terms > freqr[head(ordr)] organ manag work system project problem 275 230 209 193 185 173 > > #inspect least frequently occurring terms > freqr[tail(ordr)] hmmm struck multin lower pseudo gloss 3 3 3 3 3 3 > findFreqTerms(dtmr,lowfreq=80) [1] "action" "approach" "base" "busi" "data" "design" [7] "develop" "differ" "discuss" "enterpris" "exampl" "group" [13] "howev" "import" "issu" "make" "manag" "mani" [19] "model" "often" "organ" "peopl" "point" "practic" [25] "problem" "process" "project" "question" "said" "situat" [31] "system" "thing" "think" "time" "understand" "view" [37] "well" "will" "work" "chang" "consult" "decis" [43] "even" "like" > findAssocs(dtmr, "project", 0.6)$project
inher  manag  handl occurr
0.82   0.69   0.68   0.67

> findAssocs(dtmr, "enterpris", 0.6)
$enterpris agil increment realist upfront technolog solv neither 0.81 0.79 0.77 0.76 0.69 0.68 0.68 movement happi adapt architect architectur chanc fine 0.66 0.66 0.65 0.65 0.65 0.63 0.63 featur 0.62 > findAssocs(dtmr, "system", 0.6)$system
design   subset    adopt     user   involv  specifi function   intend     step  softwar
0.78     0.78     0.77     0.75     0.71     0.71     0.70     0.67     0.67     0.67
specif   intent   compos   depart    phone frequent    today  pattern   author   wherea
0.66     0.66     0.66     0.65     0.63     0.62     0.62     0.61     0.60     0.60
cognit
0.60

> wf=data.frame(term=names(freqr),occurrences=freqr)
> library(ggplot2)
> p <- ggplot(subset(wf, freqr>100), aes(term, occurrences))
> p <- p + geom_bar(stat="identity")
> p <- p + theme(axis.text.x=element_text(angle=45, hjust=1))
> p
> #wordcloud
> library(wordcloud)
> #setting the same seed each time ensures consistent look across clouds
> set.seed(42)
> #limit words by specifying min frequency
> wordcloud(names(freqr),freqr, min.freq=70)
> wordcloud(names(freqr),freqr,min.freq=70,colors=brewer.pal(6,"Dark2"))