<?xml version="1.0" encoding="utf-8"?>
<FlipProject flipVersion="4.3.3" location="C:\Users\Tim\Dropbox (Numbers)\flipGenerics\flipGenerics.Q" dataFileLocation="C:\Users\Tim\Dropbox (Numbers)\Example Data\Cola Tracking - January to September.sav" dataFileDateTime="2014-06-07 07:38:05Z" dataFileSize="202816" grokVersion="8.53" saveVersion="1.33">
<StripHtmlFromLabels value="undecided" />
<Guid>10f62af1-145b-4f56-9648-ea11ca950b3c</Guid>
<Options proportionsBessel="true" />
<ReportOptions>
<StyleScreen>12788485-431b-4f9a-8b94-0e00c131503d</StyleScreen>
<StylePrint>6813e0ca-e5c6-4209-b14a-a540292ac79a</StylePrint>
<StylePdf>6813e0ca-e5c6-4209-b14a-a540292ac79a</StylePdf>
<StyleCopyPaste>6813e0ca-e5c6-4209-b14a-a540292ac79a</StyleCopyPaste>
</ReportOptions>
<OutputOptions />
<rInstalledPackages>MASS,smacof</rInstalledPackages>
<QuestionSetExtras qset="a281e705-61ef-419e-b7a0-774c80654b98" autoDetectQuestions="true" />
<ImportReader qset="a281e705-61ef-419e-b7a0-774c80654b98" type="SPSSFileReader" defaultEncoding="Windows-1252" dataFileLocation="C:\Users\Tim\Dropbox (Numbers)\Example Data\Cola Tracking - January to September.sav" dataFileDateTime="2014-06-07 07:38:05Z" dataFileSize="202816" />
<Variables qset="a281e705-61ef-419e-b7a0-774c80654b98">
<Variable change="1">
<Name>UniqueID</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1" qid="7c4c1d3c-0243-4760-8726-05e131eace54">
<Name>date</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1" qid="3f708859-e627-49ae-93cd-f2052195e7d4">
<Name>d1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1" qid="91813358-01cb-4dbd-a460-5be725d5b3f2">
<Name>d2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1" qid="73946ee9-4da9-42ed-9498-b2528adb1c57">
<Name>d3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1" qid="d392acae-4d91-4a1c-9a2d-8c97e733e605">
<Name>d4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1" qid="f1601926-9e7f-4919-b42a-8eb009f9af8b">
<Name>d4o</Name>
<Values type="Text" />
</Variable>
<Variable change="1" qid="ccfe0913-de49-4fc0-a75d-6f27f3b3cc86">
<Name>q1a_1</Name>
<Values type="Text" />
</Variable>
<Variable change="1" qid="88d92a3b-2e83-470d-948a-af2917f2175a">
<Name>q1a_b</Name>
<Values type="Text" />
</Variable>
<Variable change="1" qid="9365d720-cfda-4fa9-ba79-935a53a0a65b">
<Name>q1a_c</Name>
<Values type="Text" />
</Variable>
<Variable change="1">
<Name>q1b_1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q1b_2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q1b_3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q1b_4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q1b_5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q1b_6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q2a_1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q2a_2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q2a_3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q2a_4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q2a_5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q2a_6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q2b_1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q2b_2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q2b_3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q2b_4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q2b_5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q2b_6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1" qid="db0bd85a-4f3b-46cb-ab45-f2902cf7ac48">
<Name>q3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q4a</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q4b</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q4c</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q4d</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q4e</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q4f</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5a1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5a2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5a3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5a4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5a5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5a6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5a7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5b1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5b2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5b3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5b4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5b5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5b6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5b7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5c1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5c2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5c3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5c4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5c5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5c6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5c7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5d1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5d2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5d3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5d4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5d5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5d6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5d7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5e1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5e2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5e3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5e4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5e5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5e6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5e7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5f1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5f2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5f3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5f4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5f5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5f6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5f7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5g1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5g2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5g3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5g4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5g5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5g6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5g7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5h1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5h2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5h3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5h4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5h5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5h6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5h7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5i1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5i2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5i3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5i4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5i5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5i6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q5i7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1" qid="886b2a7b-394e-43b7-8276-e76df9925f9c">
<Name>q6oe</Name>
<Values type="Text" />
</Variable>
<Variable change="1">
<Name>q7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1" qid="09d24b99-c003-43ad-921f-bb34b20872f7">
<Name>q8</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_6_8</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_6_7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_6_6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_6_5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_6_4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_6_3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_6_2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_6_1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_6_0</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_5_8</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_5_7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_5_6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_5_5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_5_4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_5_3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_5_2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_5_1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_5_0</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_4_8</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_4_7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_4_6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_4_5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_4_4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_4_3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_4_2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_4_1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_4_0</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_3_8</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_3_7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_3_6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_3_5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_3_4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_3_3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_3_2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_3_1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_3_0</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_2_8</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_2_7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_2_6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_2_5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_2_4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_2_3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_2_2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_2_1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_2_0</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_1_8</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_1_7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_1_6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_1_5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_1_4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_1_3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_1_2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_1_1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_1_0</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_0_8</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_0_7</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_0_6</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_0_5</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_0_4</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_0_3</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_0_2</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_0_1</Name>
<Values type="Numeric" />
</Variable>
<Variable change="1">
<Name>q9_0_0</Name>
<Values type="Numeric" />
</Variable>
</Variables>
<Questions qset="a281e705-61ef-419e-b7a0-774c80654b98">
<Question change="1" type="Single Response - Numeric">
<Name>Unique Identifier</Name>
<Ref>293402e6-891c-4657-b17d-6498cf98653e</Ref>
<Variable>UniqueID</Variable>
</Question>
<Question change="1" type="Multiple Response - Binary" needCheckValuesToCount="true">
<Name>Awareness</Name>
<Ref>5a8b4f6b-4938-4f0c-a881-cb69cd2407ef</Ref>
<Variable>q1b_1</Variable>
<Variable>q1b_2</Variable>
<Variable>q1b_3</Variable>
<Variable>q1b_4</Variable>
<Variable>q1b_5</Variable>
<Variable>q1b_6</Variable>
</Question>
<Question change="1" type="Two Dimensional - Numeric">
<Name>q2</Name>
<Ref>9d342f5f-61bb-407a-8edd-92db2de70875</Ref>
<Variable>q2a_1</Variable>
<Variable>q2a_2</Variable>
<Variable>q2a_3</Variable>
<Variable>q2a_4</Variable>
<Variable>q2a_5</Variable>
<Variable>q2a_6</Variable>
<Variable>q2b_1</Variable>
<Variable>q2b_2</Variable>
<Variable>q2b_3</Variable>
<Variable>q2b_4</Variable>
<Variable>q2b_5</Variable>
<Variable>q2b_6</Variable>
</Question>
<Question change="1" type="Multiple Response - Categorical">
<Name>Brand attitude</Name>
<MultipleResponseSetName>$Brandattitude</MultipleResponseSetName>
<Ref>c5b1d154-f505-4d59-ab20-62c636df9df7</Ref>
<Variable>q4a</Variable>
<Variable>q4b</Variable>
<Variable>q4c</Variable>
<Variable>q4d</Variable>
<Variable>q4e</Variable>
<Variable>q4f</Variable>
</Question>
<Question change="1" type="Two Dimensional - Binary" needCheckValuesToCount="true">
<Name>q5</Name>
<Ref>018cc131-1537-498d-82e3-20ada6628e42</Ref>
<Variable>q5a1</Variable>
<Variable>q5a2</Variable>
<Variable>q5a3</Variable>
<Variable>q5a4</Variable>
<Variable>q5a5</Variable>
<Variable>q5a6</Variable>
<Variable>q5a7</Variable>
<Variable>q5b1</Variable>
<Variable>q5b2</Variable>
<Variable>q5b3</Variable>
<Variable>q5b4</Variable>
<Variable>q5b5</Variable>
<Variable>q5b6</Variable>
<Variable>q5b7</Variable>
<Variable>q5c1</Variable>
<Variable>q5c2</Variable>
<Variable>q5c3</Variable>
<Variable>q5c4</Variable>
<Variable>q5c5</Variable>
<Variable>q5c6</Variable>
<Variable>q5c7</Variable>
<Variable>q5d1</Variable>
<Variable>q5d2</Variable>
<Variable>q5d3</Variable>
<Variable>q5d4</Variable>
<Variable>q5d5</Variable>
<Variable>q5d6</Variable>
<Variable>q5d7</Variable>
<Variable>q5e1</Variable>
<Variable>q5e2</Variable>
<Variable>q5e3</Variable>
<Variable>q5e4</Variable>
<Variable>q5e5</Variable>
<Variable>q5e6</Variable>
<Variable>q5e7</Variable>
<Variable>q5f1</Variable>
<Variable>q5f2</Variable>
<Variable>q5f3</Variable>
<Variable>q5f4</Variable>
<Variable>q5f5</Variable>
<Variable>q5f6</Variable>
<Variable>q5f7</Variable>
<Variable>q5g1</Variable>
<Variable>q5g2</Variable>
<Variable>q5g3</Variable>
<Variable>q5g4</Variable>
<Variable>q5g5</Variable>
<Variable>q5g6</Variable>
<Variable>q5g7</Variable>
<Variable>q5h1</Variable>
<Variable>q5h2</Variable>
<Variable>q5h3</Variable>
<Variable>q5h4</Variable>
<Variable>q5h5</Variable>
<Variable>q5h6</Variable>
<Variable>q5h7</Variable>
<Variable>q5i1</Variable>
<Variable>q5i2</Variable>
<Variable>q5i3</Variable>
<Variable>q5i4</Variable>
<Variable>q5i5</Variable>
<Variable>q5i6</Variable>
<Variable>q5i7</Variable>
</Question>
<Question change="1" type="Single Response - Categorical">
<Name>Weight-consciousness</Name>
<Ref>1e959b43-5d3a-490c-8eb7-b98f7baae839</Ref>
<Variable>q7</Variable>
<Tags>
<Tag>Weight</Tag>
</Tags>
</Question>
<Question change="1" type="Multiple Response - Numeric">
<Name>Max-Diff Experiment: I</Name>
<Ref>6be244f3-9262-4bbb-8b5c-f855d6201316</Ref>
<Variable>q9_6_8</Variable>
<Variable>q9_6_7</Variable>
<Variable>q9_6_6</Variable>
<Variable>q9_6_5</Variable>
<Variable>q9_6_4</Variable>
<Variable>q9_6_3</Variable>
<Variable>q9_6_2</Variable>
<Variable>q9_6_1</Variable>
<Variable>q9_6_0</Variable>
</Question>
<Question change="1" type="Multiple Response - Numeric">
<Name>Max-Diff Experiment: I1</Name>
<Ref>9adfb096-ad87-4cca-a3f7-459616ea65a4</Ref>
<Variable>q9_5_8</Variable>
<Variable>q9_5_7</Variable>
<Variable>q9_5_6</Variable>
<Variable>q9_5_5</Variable>
<Variable>q9_5_4</Variable>
<Variable>q9_5_3</Variable>
<Variable>q9_5_2</Variable>
<Variable>q9_5_1</Variable>
<Variable>q9_5_0</Variable>
</Question>
<Question change="1" type="Multiple Response - Numeric">
<Name>Max-Diff Experiment: I2</Name>
<Ref>06f7ffae-c72f-4f5b-a0ee-a56b7bf53a79</Ref>
<Variable>q9_4_8</Variable>
<Variable>q9_4_7</Variable>
<Variable>q9_4_6</Variable>
<Variable>q9_4_5</Variable>
<Variable>q9_4_4</Variable>
<Variable>q9_4_3</Variable>
<Variable>q9_4_2</Variable>
<Variable>q9_4_1</Variable>
<Variable>q9_4_0</Variable>
</Question>
<Question change="1" type="Multiple Response - Numeric">
<Name>Max-Diff Experiment: I3</Name>
<Ref>6ebf50f0-eee1-4a33-b92a-0106fa1931aa</Ref>
<Variable>q9_3_8</Variable>
<Variable>q9_3_7</Variable>
<Variable>q9_3_6</Variable>
<Variable>q9_3_5</Variable>
<Variable>q9_3_4</Variable>
<Variable>q9_3_3</Variable>
<Variable>q9_3_2</Variable>
<Variable>q9_3_1</Variable>
<Variable>q9_3_0</Variable>
</Question>
<Question change="1" type="Multiple Response - Numeric">
<Name>Max-Diff Experiment: I4</Name>
<Ref>74cefd14-36b4-4575-a71d-bd056ee6ee0f</Ref>
<Variable>q9_2_8</Variable>
<Variable>q9_2_7</Variable>
<Variable>q9_2_6</Variable>
<Variable>q9_2_5</Variable>
<Variable>q9_2_4</Variable>
<Variable>q9_2_3</Variable>
<Variable>q9_2_2</Variable>
<Variable>q9_2_1</Variable>
<Variable>q9_2_0</Variable>
</Question>
<Question change="1" type="Multiple Response - Numeric">
<Name>Max-Diff Experiment: I5</Name>
<Ref>f6161034-6c9a-416e-b7b0-b09ba76e23e0</Ref>
<Variable>q9_1_8</Variable>
<Variable>q9_1_7</Variable>
<Variable>q9_1_6</Variable>
<Variable>q9_1_5</Variable>
<Variable>q9_1_4</Variable>
<Variable>q9_1_3</Variable>
<Variable>q9_1_2</Variable>
<Variable>q9_1_1</Variable>
<Variable>q9_1_0</Variable>
</Question>
<Question change="1" type="Multiple Response - Numeric">
<Name>Max-Diff Experiment: I6</Name>
<Ref>70a5c5b3-4486-49c6-81d9-5e80df24e8cb</Ref>
<Variable>q9_0_8</Variable>
<Variable>q9_0_7</Variable>
<Variable>q9_0_6</Variable>
<Variable>q9_0_5</Variable>
<Variable>q9_0_4</Variable>
<Variable>q9_0_3</Variable>
<Variable>q9_0_2</Variable>
<Variable>q9_0_1</Variable>
<Variable>q9_0_0</Variable>
</Question>
</Questions>
<Analyses>
<Ref>a3fced96-145a-4838-b64b-a3056fc3f999</Ref>
<Table change="1">
<Ref>90ff6d43-21c7-46ca-9bc3-04999356eed9</Ref>
<Name>Unique Identifier</Name>
<Show>293402e6-891c-4657-b17d-6498cf98653e</Show>
<ByItem>SUMMARY</ByItem>
<TableSeries>
<Name>Average</Name>
</TableSeries>
</Table>
<Table change="1">
<Ref>77d46305-b00c-4bb3-abd3-c73f7badbeb1</Ref>
<Name>Unique Identifier</Name>
<Show>293402e6-891c-4657-b17d-6498cf98653e</Show>
<ByItem>SUMMARY</ByItem>
<TableSeries>
<Name>Average</Name>
</TableSeries>
</Table>
<Group>
<Name>Data</Name>
<Ref>f0f7825c-7c91-4d89-a89a-80ad87c65690</Ref>
<LocalFileItem path="C:\Users\Tim\Dropbox (Numbers)\flipGenerics\inst\extdata\Breakfast_Dissimilarities.csv" change="6">
<Ref>f7286b37-7804-4b6e-846b-9080b4e10b96</Ref>
<Name>Breakfast_Dissimilarities.csv</Name>
</LocalFileItem>
<RItem change="4">
<Ref>e4cb2084-eb12-4302-af11-04a5d677c9e2</Ref>
<Name>breakfastDissimilarities</Name>
<Name>breakfastDissimilarities</Name>
<Frozen>F</Frozen>
<Code>data = read.csv(Breakfast_Dissimilarities.csv)
breakfasts = names(data[,-1])
breakfastDissimilarities = vector("list", 4)
n = 4
k = 15
firstRow = seq(1,nrow(data),k)
names(breakfastDissimilarities) = data[firstRow,1]
for (i in 1:4) {
zmat = as.matrix(data[firstRow[i]:(firstRow[i] + k - 1),-1])
dimnames(zmat) = list(breakfasts,breakfasts)
breakfastDissimilarities[[i]] = as.dist(zmat)
}
breakfastDissimilarities</Code>
<CodeName />
<Arguments />
<Referenced>
<LocalFile guid="f7286b37-7804-4b6e-846b-9080b4e10b96" qset="00000000-0000-0000-0000-000000000000">Breakfast_Dissimilarities.csv</LocalFile>
</Referenced>
<Version>0</Version>
</RItem>
</Group>
<Group>
<Name>scatterplot.R</Name>
<Ref>b338f5ac-76f4-44d6-85be-40ef4908805a</Ref>
<Group>
<Name>Functions</Name>
<Ref>026f109b-f7fe-4baf-ac41-94fc921fbdc9</Ref>
<RItem change="1">
<Ref>fcd12265-23aa-4f98-8d2c-257045c4a6a3</Ref>
<Name>Distance</Name>
<Name>Distance</Name>
<Frozen>F</Frozen>
<Code>Distance = function(e1x, e1y, e2x, e2y) {
#
sqrt(SquaredDistance(e1x, e1y, e2x, e2y))
}</Code>
<CodeName />
<Arguments />
<Referenced />
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>6f0acb99-f32c-45a4-b5c4-ee3c38f8e707</Ref>
<Name>SquaredDistance</Name>
<Name>SquaredDistance</Name>
<Frozen>F</Frozen>
<Code>SquaredDistance = function(e1x, e1y, e2x, e2y) {
(e2y - e1y)^2 + (e2x - e1x)^2
}</Code>
<CodeName />
<Arguments />
<Referenced />
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>e1554071-6c05-40fd-bc5a-8e67cc71f6c2</Ref>
<Name>DistanceToLineSegment</Name>
<Name>DistanceToLineSegment</Name>
<Frozen>F</Frozen>
<Code>DistanceToLineSegment = function(px, py, ax, ay, bx, by) {
l2 = SquaredDistance(ax, ay, bx, by)
if (l2 == 0)
return(sqrt(SquaredDistance(px, py, ax, ay)))
t = ((px - ax) * (bx - ax) + (py - ay) * (by - ay)) / l2
if (t < 0)
return(sqrt(SquaredDistance(px, py, ax, ay)))
if (t > 1)
return(sqrt(SquaredDistance(px, py, bx, by)))
sqrt(SquaredDistance(px, py, ax + t * (bx - ax), ay + t * (by - ay)))
}</Code>
<CodeName />
<Arguments />
<Referenced>
<RItem guid="6f0acb99-f32c-45a4-b5c4-ee3c38f8e707" qset="00000000-0000-0000-0000-000000000000">SquaredDistance</RItem>
</Referenced>
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>0fb04d86-c7c7-4a7d-a20b-32bb28d70a13</Ref>
<Name>DistanceToBox</Name>
<Name>DistanceToBox</Name>
<Frozen>F</Frozen>
<Code>#' Distance to a line segment
#' \code{DistanceToBox} Computes the distance between a point and the nearest point on a box (0 if in the box)
#'
#' @param px The x coordinate of a point.
#' @param py The y coordinate of a point.
#' @param ax The x coordinate of the bottom-left of the box.
#' @param ay The y coordinate of the bottom-left of the box.
#' @param bx The x coordinate of the bottom-right of the box.
#' @param by The y coordinate of the bottom-right of the box.
#' @param cx The x coordinate of the top-right of the box.
#' @param cy The y coordinate of the top-right of the box.
#' @param dx The xcoordinates of the top-left of the box.
#' @param dy The y coordinate of the top-left of the box.
#' @return The squared distance.
DistanceToBox = function(px, py, ax, ay, bx, by, cx, cy, dx, dy) {
d.horizontal = Distance(ax, ay, bx, by)
d.vertical = Distance(bx, by, cx, cy)
d.p.ab = DistanceToLineSegment(px, py, ax, ay, bx, by)
d.p.bc = DistanceToLineSegment(px, py, bx, by, cx, cy)
d.p.cd = DistanceToLineSegment(px, py, cx, cy, dx, dy)
d.p.da = DistanceToLineSegment(px, py, dx, dy, ax, ay)
# checking to see if point is in the box
if (d.p.bc <= d.horizontal & d.p.da <= d.horizontal & d.p.ab <= d.vertical & d.p.cd <= d.vertical)
return(0)
min(d.p.ab, d.p.bc, d.p.cd, d.p.da)
}
</Code>
<CodeName />
<Arguments />
<Referenced>
<RItem guid="fcd12265-23aa-4f98-8d2c-257045c4a6a3" qset="00000000-0000-0000-0000-000000000000">Distance</RItem>
<RItem guid="e1554071-6c05-40fd-bc5a-8e67cc71f6c2" qset="00000000-0000-0000-0000-000000000000">DistanceToLineSegment</RItem>
</Referenced>
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>f9f04892-a711-4797-9d10-d2f30640444e</Ref>
<Name>BoxOverlap</Name>
<Name>BoxOverlap</Name>
<Frozen>F</Frozen>
<Code>#' Whether or not two boxes overlap
#' \code{BoxOverlap} Checks to see if two boxes overlap
#'
#' @param ax1 The x coordinate of the bottom-left of the first box.
#' @param ay1 The y coordinate of the bottom-left of the first box.
#' @param bx1 The x coordinate of the bottom-right of the first box.
#' @param by1 The y coordinate of the bottom-right of the first box.
#' @param cx1 The x coordinate of the top-right of the first box.
#' @param cy1 The y coordinate of the top-right of the first box.
#' @param dx1 The x coordinate of the top-left of the first box.
#' @param dy1 The y coordinate of the top-left of the first box.
#' @param ax2 The x coordinate of the bottom-left of the second box.
#' @param ay2 The y coordinate of the bottom-left of the second box.
#' @param bx2 The x coordinate of the bottom-right of the second box.
#' @param by2 The y coordinate of the bottom-right of the second box.
#' @param cx2 The x coordinate of the top-right of the second box.
#' @param cy2 The y coordinate of the top-right of the second box.
#' @param dx2 The x coordinate of the top-left of the second box.
#' @param dy2 The y coordinate of the top-left of the second box.
#' @return true if the boxes overlap and false otherwise.
BoxOverlap = function(ax1, ay1, bx1, by1, cx1, cy1, dx1, dy1, ax2, ay2, bx2, by2, cx2, cy2, dx2, dy2) {
# Returns: boolean
#
if (DistanceToBox(ax1, ay1, ax2, ay2, bx2, by2, cx2, cy2, dx2, dy2) == 0)
return(TRUE)
if (DistanceToBox(bx1, by1, ax2, ay2, bx2, by2, cx2, cy2, dx2, dy2) == 0)
return(TRUE)
if (DistanceToBox(cx1, cy1, ax2, ay2, bx2, by2, cx2, cy2, dx2, dy2) == 0)
return(TRUE)
if (DistanceToBox(dx1, dy1, ax2, ay2, bx2, by2, cx2, cy2, dx2, dy2) == 0)
return(TRUE)
if (DistanceToBox(ax2, ay2, ax1, ay1, bx1, by1, cx1, cy1, dx1, dy1) == 0)
return(TRUE)
if (DistanceToBox(bx2, by2, ax1, ay1, bx1, by1, cx1, cy1, dx1, dy1) == 0)
return(TRUE)
if (DistanceToBox(cx2, cy2, ax1, ay1, bx1, by1, cx1, cy1, dx1, dy1) == 0)
return(TRUE)
if (DistanceToBox(dx2, dy2, ax1, ay1, bx1, by1, cx1, cy1, dx1, dy1) == 0)
return(TRUE)
FALSE
}</Code>
<CodeName />
<Arguments />
<Referenced>
<RItem guid="0fb04d86-c7c7-4a7d-a20b-32bb28d70a13" qset="00000000-0000-0000-0000-000000000000">DistanceToBox</RItem>
</Referenced>
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>56706437-c512-45a0-a153-37ae8608abb5</Ref>
<Name>BoxCoordinates</Name>
<Name>BoxCoordinates</Name>
<Frozen>F</Frozen>
<Code>#' Box coordinates
#' \code{BoxOverlap} Computes the positions of the corner of a box.
#'
#' @param x x coordinate of the middle of the box.
#' @param y y coordinate of the middle of the box.
#' @param w width of the box in the x-scale.
#' @param h height of the box in the y-scale.
#' @return A vector containing the coordinates of a box.
BoxCoordinates = function(x, y, w, h) {
p1 = x - w / 2
p2 = y - h / 2
p3 = x + w / 2
p4 = y + h / 2
c(p1, p2, p3, p2, p3, p4, p1, p4)
}</Code>
<CodeName />
<Arguments />
<Referenced />
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>431eb239-33b0-4570-bd52-9a932229f43c</Ref>
<Name>IsOverlap</Name>
<Name>IsOverlap</Name>
<Frozen>F</Frozen>
<Code>#' Box center
#' \code{BoxCenter} Computes the coordinates of the center of a box based upon the coordinates of the corner.
#'
#' @param ax The x coordinate of the bottom-left of the box.
#' @param ay The y coordinate of the bottom-left of the box.
#' @param bx The x coordinate of the bottom-right of the box.
#' @param by The y coordinate of the bottom-right of the box.
#' @param cx The x coordinate of the top-right of the box.
#' @param cy The y coordinate of the top-right of the box.
#' @param dx The x coordinate of the top-left of the box.
#' @param dy The y coordinate of the top-left of the box.
#' @return vector containing the x,y coordinates of the center.
BoxCenter = function(ax, ay, bx, by, cx, cy, dx, dy) {
c((ax + bx) / 2, (ay + dy) / 2)
}
#' Box Overlaps
#' \code{IsOverlap} Tests if a box overlaps any other boxes.
#'
#' @param boxes A list of boxes, where each box is its coordinates.
#' @param this.box The box to check to see if it overlaps with the rest.
#' @return TRUE if there is an overlap and false otherwise.
IsOverlap = function(boxes, this.box) {
if (length(boxes) == 0)
return(FALSE)
for (box in boxes) {
if (BoxOverlap(box[1],box[2],box[3],box[4],box[5],box[6],box[7],box[8], this.box[1],this.box[2],this.box[3],this.box[4],this.box[5],this.box[6],this.box[7],this.box[8]))
return(TRUE)
}
FALSE
}</Code>
<CodeName />
<Arguments />
<Referenced>
<RItem guid="f9f04892-a711-4797-9d10-d2f30640444e" qset="00000000-0000-0000-0000-000000000000">BoxOverlap</RItem>
</Referenced>
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>fe338053-2eae-405e-ac5b-ca4aa909e4c6</Ref>
<Name>GetXlim</Name>
<Name>GetXlim</Name>
<Frozen>F</Frozen>
<Code>#' ggplot xlim
#' \code{GetXlim} Tests if a box overlaps any other boxes.
#'
#' @param p A \code{\link[ggplot2]{ggplot}} plot.
#' @return A vector containing the minimum and and maximum value of x plotted.
GetXlim = function(p) {
g = ggplot_build(p)
g$panel$ranges[[1]]$x.range
}
</Code>
<CodeName />
<Arguments />
<Referenced />
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>572ecdea-522b-43f0-bc26-bccd8acca856</Ref>
<Name>GetYlim</Name>
<Name>GetYlim</Name>
<Frozen>F</Frozen>
<Code>#' ggplot ylim
#' \code{GetYlim} Tests if a box overlaps any other boxes.
#'
#' @param p A \code{\link[ggplot2]{ggplot}} plot.
#' @return A vector containing the minimum and and maximum value of y plotted.
GetYlim = function(p) {
g = ggplot_build(p)
g$panel$ranges[[1]]$y.range
}</Code>
<CodeName />
<Arguments />
<Referenced />
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>90fd2c02-9144-4399-8ad5-4cf66a97d9a4</Ref>
<Name>ReducePointAndLabelOverlap</Name>
<Name>ReducePointAndLabelOverlap</Name>
<Frozen>F</Frozen>
<Code>#' Find better cootrdinates for text labels
#' \code{GetYlim} Identifies a better set of coordinates to place labels in a labeled ggplot scatterplot.
#'
#' @param p A \code{\link[ggplot2]{ggplot}} plot.
#' @param cex Relative font, line and glyph size.
#' @param fixed.aspect If true, forces the x and y dimensions to be on the same scale.
#' @param tstep The angle (theta) step size as the algorithm spirals out.
#' @param rstep The radius step size (in standard deviations) as the algorithm spirals out.
#' @return label.coords Recommended label coordinates.
#' @return dimensions Width and height of the text to be plotted in terms of the scale of x and y.
ReducePointAndLabelOverlap = function (p, cex = 1, fixed.aspect = FALSE, tstep = 0.1, rstep = 0.1){
# Inspired by wordlayout {wordcloud}
#
# getting the coordinates
labels = p$data$labels
label.coords = point.coords = p$data[,1:2]
col.labels = colnames(label.coords)
n = length(labels)
# determining scale of the points and text relative to plot coordinates (dodgy hack)
#print( par()$pin)
initial.x.scale = x.scale = diff(GetXlim(p)) / par()$pin[1] * 0.8
y.scale = diff(GetYlim(p)) / par()$pin[2] * 0.8
#print(c("orig", x.scale, y.scale))
if (fixed.aspect) {
x.scale = y.scale = max(x.scale, y.scale)
}
# print(c("modified", x.scale, y.scale))
w = h = strheight("Jj", "inches", cex = cex)
initial.w = w = w * x.scale
h = h * y.scale
#print(c(w, h))
#print(strwidth(labels, "inches", cex = cex))
widths = strwidth(labels, "inches", cex = cex) * x.scale# / initial.x.scale
sdx = sd(label.coords[,1], na.rm = TRUE)
sdy = sd(label.coords[,2], na.rm = TRUE)
if (sdx == 0)
sdx <- 1
if (sdy == 0)
sdy <- 1
# computing position of the points (assuming they are the same height as the first label)
boxes = vector("list", n)
for (i in 1:n)
boxes[[i]] = BoxCoordinates(point.coords[i,1], point.coords[i,2], w * .8, h * .8)
# preventing overlap of points
for (i in 2:n)
for (prev.i in 1:(i - 1))
if (sum(point.coords[i,] == point.coords[prev.i,]) == 2) {
radian = 2 * pi * (n + i) / (2 * n)
point.coords[i, 1] = point.coords[i, 1] + w / 4 * cos(radian)
point.coords[i, 2] = point.coords[i, 2] + h / 4 * sin(radian)
}
# getting the coordinates for the labels
dimensions = matrix(c(widths,rep(h,n)), n, 2, dimnames = list(labels, c("width", "height")))
label.coords[,2] = h + label.coords[,2] #putting the initial labels above the points
box.coordinates = vector("list", n)
thetas = 2 * pi * (1:n) / n
for (i in 1:n) {
theta = thetas[i]
x1 = x0 = label.coords[i, 1]
y1 = y0 = label.coords[i, 2]
r = 0
label = labels[i]
w = widths[i]
overlapped = TRUE
new.position.counter = 0
while (overlapped) {
this.box = BoxCoordinates(x1, y1, w, h)
if (!IsOverlap(boxes, this.box)) {
boxes[[i + n]] <- this.box
label.coords[i, ] = c(x1, y1)
overlapped = FALSE
} else {
new.position.counter = new.position.counter + 1
if (new.position.counter == 1){# trying to put the point underneath
y1 = y0 - 2 * h
} else if (new.position.counter == 2){# trying to put the point to the left
x1 = x0 - (initial.w + widths[i])
y1 = y0 - h * 1.2
} else if (new.position.counter == 3){# trying to put the point to the left
x1 = x0 + (initial.w + widths[i])
y1 = y0 - h
} else {
theta <- theta + tstep
r <- r + rstep * tstep/(2 * pi)
x1 <- x0 + sdx * r * cos(theta)
y1 <- y0 + sdy * r * sin(theta)
}
}
}
}
list(label.coords = as.data.frame(label.coords), dimensions = dimensions)
}
</Code>
<CodeName />
<Arguments />
<Referenced>
<RItem guid="fe338053-2eae-405e-ac5b-ca4aa909e4c6" qset="00000000-0000-0000-0000-000000000000">GetXlim</RItem>
<RItem guid="572ecdea-522b-43f0-bc26-bccd8acca856" qset="00000000-0000-0000-0000-000000000000">GetYlim</RItem>
<RItem guid="56706437-c512-45a0-a153-37ae8608abb5" qset="00000000-0000-0000-0000-000000000000">BoxCoordinates</RItem>
<RItem guid="431eb239-33b0-4570-bd52-9a932229f43c" qset="00000000-0000-0000-0000-000000000000">IsOverlap</RItem>
</Referenced>
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>b5d77f7c-a021-4b6a-9767-994072647399</Ref>
<Name>LabeledScatterPlot</Name>
<Name>LabeledScatterPlot</Name>
<Frozen>F</Frozen>
<Code>#' Find better cootrdinates for text labels
#' \code{GetYlim} Identifies a better set of coordinates to place labels in a labeled ggplot scatterplot.
#' #
#' @param coords The xy coordinates of the points.
#' @param group A factor indicating group membership for each point.
#' @param row.labels A vector of labels which will, if supplied, over-ride the rownames of coodinates.
#' @param col.labels A vector of labels which will, if supplied, over-ride the colnames of coodinates.
#' @param title Title for the plot.
#' @param legend.title Title for the legend (which only appears if group is not null).
#' @param fixed.aspect if true, forces the x and y dimensions to be on the same scale.
#' @param auto.tidy Move the labels around so that fewer overlap.
#' @param colors Colors that are cycled through where there is only one series, or, used to demarkate series where there are multiple series.
#' @param auto.color When the number of rows of coords is less than or equal to this, a single color is used to label the points. Otherwise, they cycle throuogh the colors.
#' @param coords Relative font, line and glyph size.
#' @param general.color The color to be used in axes and titles.
#' @param cex Relative font, line and glyph size.
#' @param ... Additional arguments.
#' @param object An object to be plotted.
#' @param row.description A title for the rows.
#' @param column.description A title for the columns.
#' @return p A \code{\link[ggplot2]{ggplot}} plot.
#' @examples
#'
#' # MDS - square
#' library(smacof)
#' data(breakfastDissimilarities)
#' mdsInterval <- smacofSym(breakfastDissimilarities[[4]],
#' type = "interval", eps = 1e-12, itmax = 100000)
#' LabeledScatterPlot(mdsInterval, title = "Interval-scale MDS of Breakfast Dissimilarities")
#'
#' data(colaPerceptions)
#' LabeledScatterPlot(colaPerceptions[,c(7,8)], title = "Scatterplot of perceptions data",
#' auto.tidy = TRUE, auto.color = 5, fixed.aspect = TRUE)
#' @export
LabeledScatterPlot <- function(coords, ...) UseMethod("LabeledScatterPlot")
</Code>
<CodeName />
<Arguments />
<Referenced />
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>62c9c92c-0834-4044-a813-aa50d30baaff</Ref>
<Name>LabeledScatterPlot.default</Name>
<Name>LabeledScatterPlot.default</Name>
<Frozen>F</Frozen>
<Code>#' @describeIn LabeledScatterPlot Default labeled scatterplot
#' @export
LabeledScatterPlot.default = function(coords, group = NULL, row.labels = NULL, col.labels = NULL, title = "", legend.title = "",
fixed.aspect = TRUE, auto.tidy = TRUE,
colors = qColors, auto.color = 10, general.color = "gray28",
cex = 1, ...) {
require("ggplot2")
# identifying the labels
if (is.null(row.labels))
row.labels = rownames(coords)
n = length(row.labels)
if (is.null(col.labels)) {
col.labels = colnames(coords)
if(is.null(col.labels)) {
xlab = "Dimension 1"
ylab = "Dimension 2"
} else {
xlab = col.labels[1]
ylab = col.labels[2]
}
}
# Setting the colors
#
has.groups = !is.null(group)
if (!has.groups) {
if (auto.color >= n) {
group = rep(5, n)
} else {
group = array(1:length(colors), n)
}
}
group = factor(group)
#
# Setting limits to the axes so that they can easily accomodate the text
#
point.coords = as.data.frame(coords)
point.coords$labels = row.labels
# initial plot to get the coordinates
p = ggplot(point.coords, aes_string(x = col.labels[1], y = col.labels[2], label = "labels")) + geom_point()
if (fixed.aspect)
p = p + coord_fixed(ratio = 1)#, xlim = NULL, ylim = NULL, wise = NULL)
#
# moving points and labels to avoid overlap
#
new.coords = ReducePointAndLabelOverlap(p, cex, fixed.aspect)
label.dimensions = new.coords$dimensions
label.coords = new.coords$label.coords
point.coords$labels = label.coords$labels = row.labels
point.coords$group = label.coords$group = group
smallest.x = min(point.coords[,1], label.coords[,1] - label.dimensions[,1] / 2)
biggest.x = max(point.coords[,1], label.coords[,1] + label.dimensions[,1] / 2)
smallest.y = min(point.coords[,2], label.coords[,2] - label.dimensions[,2] / 2)
biggest.y = max(point.coords[,2], label.coords[,2] + label.dimensions[,2] / 2)
#
# creating the plot a second time
#
p = ggplot(point.coords, aes_string(x = col.labels[1], y = col.labels[2]))#, colour = "labels")) #+ scale_fill_manual(values=c("#F8766D", "#00BA38"))
p = p + theme_bw()
p = p + geom_point(size = 2 * cex, aes(colour = group))
p = p + geom_text(data = label.coords, aes_string(x = col.labels[1], y = col.labels[2], label = "labels", group = "group", colour = "group"), size = 3 * cex, show_guide = F )
p = p + labs(title = title)
p = p + xlim(smallest.x, biggest.x) + ylim(smallest.y, biggest.y)
p = p + scale_colour_manual(values = qColors, name = legend.title)
if (fixed.aspect)
p = p + coord_fixed(ratio = 1)#, xlim = NULL, ylim = NULL, wise = NULL)
if (has.groups) {
#p = p + scale_colour_manual(values = qColors, name = legend.title)
p = p + theme(legend.text = element_text(colour = general.color, size = 10 * cex))
} else {
p = p + theme(legend.position = "none")
}
p = p + theme(axis.text.x = element_text(colour = general.color, size = 8 * cex))
p = p + theme(axis.text.y = element_text(colour = general.color, size = 8 * cex))
p = p + theme(axis.title.x = element_text(colour = general.color, size = 10 * cex))
p = p + theme(axis.title.y = element_text(colour = general.color, size = 10 * cex))
p = p + theme(axis.title = element_text(size = 10, face = "bold"))
p = p + theme(plot.title = element_text(size = 12 * cex, face="bold", vjust = cex * 1.2))
#
# connecting points to text using lines
#
for (i in 1:n) {
x = coords[i, 1]
y = coords[i, 2]
x1 = label.coords[i, 1]
y1 = label.coords[i, 2]
w = label.dimensions[i, 1]
h = label.dimensions[i, 2]
cs = BoxCoordinates(x1, y1, w, h)
abs.slope = function(x1, y1, x2, y2) {
abs((y1 - y2) / (x1 - x2))
}
if (DistanceToBox(x, y, cs[1], cs[2], cs[3], cs[4], cs[5], cs[6], cs[7], cs[8]) > h) {
line.color = colors[group[i]]
if (abs.slope(x, y, x1, y1) < 0.5) {
if (x > x1) { # point to the righy of label
p = p + geom_segment(aes_string(x = x, xend = cs[3], y = y, yend = cs[2] + h / 2), colour = line.color, size = cex / 2)#, size = 3)
} else { # point to the left of label
p = p + geom_segment(aes_string(x = x, xend = cs[1], y = y, yend = cs[2] + h / 2), colour = line.color, size = cex / 2)#, colour = transparent.colors[i], size = 3)
}
} else {
if (y > y1) { # point above the label
p = p + geom_segment(aes_string(x = x, xend = cs[1] + w / 2, y = y, yend=cs[8]), colour = line.color, size = cex / 2)##, colour = transparent.colors[i], size = 3)
} else { # point below the label
p = p + geom_segment(aes_string(x = x, xend = cs[1] + w / 2, y = y, yend=cs[2]), colour = line.color, size = cex / 2)##, colour = transparent.colors[i], size = 3)
}
}
}
}
p
}
</Code>
<CodeName />
<Arguments />
<Referenced>
<RItem guid="90fd2c02-9144-4399-8ad5-4cf66a97d9a4" qset="00000000-0000-0000-0000-000000000000">ReducePointAndLabelOverlap</RItem>
<RItem guid="56706437-c512-45a0-a153-37ae8608abb5" qset="00000000-0000-0000-0000-000000000000">BoxCoordinates</RItem>
<RItem guid="0fb04d86-c7c7-4a7d-a20b-32bb28d70a13" qset="00000000-0000-0000-0000-000000000000">DistanceToBox</RItem>
</Referenced>
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>0b12aa3c-99aa-4f3e-9fdb-2121ba04c304</Ref>
<Name>LabeledScatterPlot.smacof</Name>
<Name>LabeledScatterPlot.smacof</Name>
<Frozen>F</Frozen>
<Code>#' @describeIn LabeledScatterPlot Labeled scatterplot of smacof object
#' @export
LabeledScatterPlot.smacof = function(object, ...) {
LabeledScatterPlot.default(object$conf, fixed.aspect = TRUE, ...)
}</Code>
<CodeName />
<Arguments />
<Referenced>
<RItem guid="62c9c92c-0834-4044-a813-aa50d30baaff" qset="00000000-0000-0000-0000-000000000000">LabeledScatterPlot.default</RItem>
</Referenced>
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>e2448079-eec6-438c-b7b5-cfb76e23b782</Ref>
<Name>LabeledScatterPlot.smacofB</Name>
<Name>LabeledScatterPlot.smacofB</Name>
<Frozen>F</Frozen>
<Code>#' @describeIn LabeledScatterPlot Labeled scatterplot of smacofB object
#' @export
LabeledScatterPlot.smacofB = function(object, ...) {
LabeledScatterPlot.default(object$conf, fixed.aspect = TRUE, ...)
}</Code>
<CodeName />
<Arguments />
<Referenced>
<RItem guid="62c9c92c-0834-4044-a813-aa50d30baaff" qset="00000000-0000-0000-0000-000000000000">LabeledScatterPlot.default</RItem>
</Referenced>
<Version>0</Version>
</RItem>
<RItem change="1">
<Ref>1365ed09-868b-4e22-89a3-84b58975c78a</Ref>
<Name>LabeledScatterPlot.smacofR</Name>
<Name>LabeledScatterPlot.smacofR</Name>
<Frozen>F</Frozen>
<Code>#' @describeIn LabeledScatterPlot Labeled scatterplot of smacofR object
#' @export
LabeledScatterPlot.smacofR = function(object, row.description = "Rows", column.description = "Columns", ...) {
coords = rbind(object$conf.row, object$conf.col)
print(coords)
group = c(rep(row.description, length(object$spp.row)),rep(column.description, length(object$spp.col)))
print(group)
LabeledScatterPlot.default(coords, fixed.aspect = TRUE, group = group, ...)
}
</Code>
<CodeName />
<Arguments />
<Referenced>
<RItem guid="62c9c92c-0834-4044-a813-aa50d30baaff" qset="00000000-0000-0000-0000-000000000000">LabeledScatterPlot.default</RItem>
</Referenced>
<Version>0</Version>
</RItem>
</Group>
<Group>
<Name>Examples</Name>
<Ref>ccd5d5ea-b833-40c1-bd3a-fe32d67ef91f</Ref>
<RItem change="6">
<Ref>9219ae3c-2f20-4b2a-a93d-72d2aeb47c6d</Ref>
<Name>res.rect</Name>
<Name>res.rect</Name>
<Frozen>F</Frozen>
<Code>res.rect <- smacofRect(breakfast, itmax = 1000)
</Code>
<CodeName />
<Arguments />
<Referenced />
<Version>1</Version>
</RItem>
<RItem change="6">
<Ref>db587bd0-b536-49df-b455-1ef5563594fe</Ref>
<Name>res.rect</Name>
<Name>res.rect</Name>
<Frozen>F</Frozen>
<Code>res.rect <- smacofRect(breakfast, itmax = 1000)
</Code>
<CodeName />
<Arguments />
<Referenced />
<Version>0</Version>
</RItem>
<RItem change="6">
<Ref>90f6abf4-a9d5-44b4-a925-ad77e77b482e</Ref>
<Name>obj21</Name>
<Name>obj21</Name>
<Frozen>F</Frozen>
<Code>z = as.matrix(breakfastDissimilarities[[1]])+as.matrix(breakfastDissimilarities[[2]])+as.matrix(breakfastDissimilarities[[3]])+as.matrix(breakfastDissimilarities[[4]])
z = as.dist(z)
isoMDS(z)
</Code>
<CodeName />
<Arguments />
<Referenced>
<RItem guid="e4cb2084-eb12-4302-af11-04a5d677c9e2" qset="00000000-0000-0000-0000-000000000000">breakfastDissimilarities</RItem>
</Referenced>
<Version>3</Version>
</RItem>
<RItem change="6">
<Ref>da70c028-61b6-42a5-954d-b82cc4a2cb86</Ref>
<Name>obj24</Name>
<Name>obj24</Name>
<Frozen>F</Frozen>
<Code>z = as.matrix(breakfastDissimilarities[[1]])+as.matrix(breakfastDissimilarities[[2]])+as.matrix(breakfastDissimilarities[[3]])+as.matrix(breakfastDissimilarities[[4]])
z = as.dist(z)
isoMDS(z)
</Code>
<CodeName />
<Arguments />
<Referenced>
<RItem guid="e4cb2084-eb12-4302-af11-04a5d677c9e2" qset="00000000-0000-0000-0000-000000000000">breakfastDissimilarities</RItem>
</Referenced>
<Version>0</Version>
</RItem>
<RItem change="6">
<Ref>326d6234-9da7-40c1-850b-a595b10213a1</Ref>
<Name>obj22</Name>
<Name>obj22</Name>
<Frozen>F</Frozen>
<Code>library(MASS)
corresp(matrix(runif(9),3))
</Code>
<CodeName />
<Arguments />
<Referenced />
<Version>3</Version>
</RItem>
</Group>
</Group>
</Analyses>
<Styles>
<TableStyle ref="6813e0ca-e5c6-4209-b14a-a540292ac79a" name="Sobre" fileVer="0.3">
<HeaderFont family="Calibri" size="12" style="1" />
<FooterFont family="Calibri" size="9" style="0" />
<ColFont family="Calibri" size="9.75" style="0" />
<RowFont family="Calibri" size="9.75" style="0" />
<TableFont family="Calibri" size="9.75" style="0" />
<SeriesFont family="Calibri" size="9" style="0" />
<HeaderColour>-16777216</HeaderColour>
<FooterColour>-16777216</FooterColour>
<ColColour>-16777216</ColColour>
<RowColour>-16777216</RowColour>
<TableColour>-16777216</TableColour>
<SeriesColour>-16777216</SeriesColour>
<SigColourPos>-16776961</SigColourPos>
<SigColourNeg>-65536</SigColourNeg>
<BorderColour>-16777216</BorderColour>
<ShrinkColumns />
<InlineSeries />
<InlineQNames />
<BoldNets />
<MinimalBorders />
<ExportFooterSep />
<SigArrows />
<SigFontColour />
<NColsToFit>15</NColsToFit>
<ShowMissingAs>NaN</ShowMissingAs>
</TableStyle>
<TableStyle ref="12788485-431b-4f9a-8b94-0e00c131503d" name="Colorful" fileVer="0.3">
<HeaderFont family="Arial" size="12" style="1" />
<FooterFont family="Arial" size="9" style="0" />
<ColFont family="Arial" size="8.25" style="0" />
<RowFont family="Arial" size="8.25" style="0" />
<TableFont family="Arial" size="8.25" style="0" />
<SeriesFont family="Arial" size="8.25" style="0" />
<HeaderColour>-16777216</HeaderColour>
<FooterColour>-16777216</FooterColour>
<ColColour>-16777216</ColColour>
<RowColour>-16777216</RowColour>
<TableColour>-16777216</TableColour>
<SeriesColour>-16777216</SeriesColour>
<SigColourPos>-16776961</SigColourPos>
<SigColourNeg>-65536</SigColourNeg>
<BorderColour>-16777216</BorderColour>
<ShowGraph />
<ShrinkColumns />
<ColourHeaders />
<PlaceFooterAtMargin />
<ExportFooterSep />
<SigArrows />
<SigFontColour />
<NColsToFit>15</NColsToFit>
<ShowMissingAs>NaN</ShowMissingAs>
</TableStyle>
</Styles>
<History>
<Created change="1" date="Thursday, 13 November 2014" time="5:03:38 PM" user="Tim" />
<Modified change="2" date="Thursday, 13 November 2014" time="5:14:11 PM" user="Tim" />
<Modified change="3" date="Thursday, 13 November 2014" time="5:24:19 PM" user="Tim" />
<Modified change="4" date="Thursday, 13 November 2014" time="5:34:37 PM" user="Tim" />
<Modified change="5" date="Thursday, 13 November 2014" time="5:36:48 PM" user="Tim" />
<Modified change="6" date="Thursday, 13 November 2014" time="5:45:30 PM" user="Tim" />
</History>
<Version grokVersion="8.53" saveVersion="1.33" realVersion="8.54" />
</FlipProject>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.