How to change order of x axis using cenboxplot() function










0















I am using the NADA package to create censored boxplots using the function cenboxplot(). I am wondering if there a way to change the ordering of the x axis. I know how to do this in several different ways with the boxplot() function, but cannot find a way to carry this over.










share|improve this question



















  • 2





    Can you provide some example code to show what you have already tried?

    – Nick Ellis
    Nov 13 '18 at 18:31











  • Also, could you please tag the language you are using?

    – Jan Boyer
    Nov 13 '18 at 18:58











  • For the boxplot() function, my code looks like this, which orders the x-axis the way I want it: pH$Site<-factor(pH$Site, levels=c("Tank 1", "Tank 2", "Post CW")) boxplot(pH$pH ~ pH$Site, las=1, main="pH", xlab="Sample Site", ylab="pH") Because the cenboxplot() function requires a numeric vector, a logical vector that shows whether not the value is censored, and then a factor vector used for grouping ‘obs’ into subsets, I don't know how to reorder the x-axis. More here: rdocumentation.org/packages/NADA/versions/1.6-1/topics/…

    – Claire
    Nov 14 '18 at 19:49
















0















I am using the NADA package to create censored boxplots using the function cenboxplot(). I am wondering if there a way to change the ordering of the x axis. I know how to do this in several different ways with the boxplot() function, but cannot find a way to carry this over.










share|improve this question



















  • 2





    Can you provide some example code to show what you have already tried?

    – Nick Ellis
    Nov 13 '18 at 18:31











  • Also, could you please tag the language you are using?

    – Jan Boyer
    Nov 13 '18 at 18:58











  • For the boxplot() function, my code looks like this, which orders the x-axis the way I want it: pH$Site<-factor(pH$Site, levels=c("Tank 1", "Tank 2", "Post CW")) boxplot(pH$pH ~ pH$Site, las=1, main="pH", xlab="Sample Site", ylab="pH") Because the cenboxplot() function requires a numeric vector, a logical vector that shows whether not the value is censored, and then a factor vector used for grouping ‘obs’ into subsets, I don't know how to reorder the x-axis. More here: rdocumentation.org/packages/NADA/versions/1.6-1/topics/…

    – Claire
    Nov 14 '18 at 19:49














0












0








0








I am using the NADA package to create censored boxplots using the function cenboxplot(). I am wondering if there a way to change the ordering of the x axis. I know how to do this in several different ways with the boxplot() function, but cannot find a way to carry this over.










share|improve this question
















I am using the NADA package to create censored boxplots using the function cenboxplot(). I am wondering if there a way to change the ordering of the x axis. I know how to do this in several different ways with the boxplot() function, but cannot find a way to carry this over.







r boxplot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 23:17









user6910411

33.8k976100




33.8k976100










asked Nov 13 '18 at 18:23









ClaireClaire

1




1







  • 2





    Can you provide some example code to show what you have already tried?

    – Nick Ellis
    Nov 13 '18 at 18:31











  • Also, could you please tag the language you are using?

    – Jan Boyer
    Nov 13 '18 at 18:58











  • For the boxplot() function, my code looks like this, which orders the x-axis the way I want it: pH$Site<-factor(pH$Site, levels=c("Tank 1", "Tank 2", "Post CW")) boxplot(pH$pH ~ pH$Site, las=1, main="pH", xlab="Sample Site", ylab="pH") Because the cenboxplot() function requires a numeric vector, a logical vector that shows whether not the value is censored, and then a factor vector used for grouping ‘obs’ into subsets, I don't know how to reorder the x-axis. More here: rdocumentation.org/packages/NADA/versions/1.6-1/topics/…

    – Claire
    Nov 14 '18 at 19:49













  • 2





    Can you provide some example code to show what you have already tried?

    – Nick Ellis
    Nov 13 '18 at 18:31











  • Also, could you please tag the language you are using?

    – Jan Boyer
    Nov 13 '18 at 18:58











  • For the boxplot() function, my code looks like this, which orders the x-axis the way I want it: pH$Site<-factor(pH$Site, levels=c("Tank 1", "Tank 2", "Post CW")) boxplot(pH$pH ~ pH$Site, las=1, main="pH", xlab="Sample Site", ylab="pH") Because the cenboxplot() function requires a numeric vector, a logical vector that shows whether not the value is censored, and then a factor vector used for grouping ‘obs’ into subsets, I don't know how to reorder the x-axis. More here: rdocumentation.org/packages/NADA/versions/1.6-1/topics/…

    – Claire
    Nov 14 '18 at 19:49








2




2





Can you provide some example code to show what you have already tried?

– Nick Ellis
Nov 13 '18 at 18:31





Can you provide some example code to show what you have already tried?

– Nick Ellis
Nov 13 '18 at 18:31













Also, could you please tag the language you are using?

– Jan Boyer
Nov 13 '18 at 18:58





Also, could you please tag the language you are using?

– Jan Boyer
Nov 13 '18 at 18:58













For the boxplot() function, my code looks like this, which orders the x-axis the way I want it: pH$Site<-factor(pH$Site, levels=c("Tank 1", "Tank 2", "Post CW")) boxplot(pH$pH ~ pH$Site, las=1, main="pH", xlab="Sample Site", ylab="pH") Because the cenboxplot() function requires a numeric vector, a logical vector that shows whether not the value is censored, and then a factor vector used for grouping ‘obs’ into subsets, I don't know how to reorder the x-axis. More here: rdocumentation.org/packages/NADA/versions/1.6-1/topics/…

– Claire
Nov 14 '18 at 19:49






For the boxplot() function, my code looks like this, which orders the x-axis the way I want it: pH$Site<-factor(pH$Site, levels=c("Tank 1", "Tank 2", "Post CW")) boxplot(pH$pH ~ pH$Site, las=1, main="pH", xlab="Sample Site", ylab="pH") Because the cenboxplot() function requires a numeric vector, a logical vector that shows whether not the value is censored, and then a factor vector used for grouping ‘obs’ into subsets, I don't know how to reorder the x-axis. More here: rdocumentation.org/packages/NADA/versions/1.6-1/topics/…

– Claire
Nov 14 '18 at 19:49













0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287311%2fhow-to-change-order-of-x-axis-using-cenboxplot-function%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287311%2fhow-to-change-order-of-x-axis-using-cenboxplot-function%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3

Museum of Modern and Contemporary Art of Trento and Rovereto