Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7524923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:11:35+00:00 2026-05-30T03:11:35+00:00

This group has been very helpful, I really appreciate all the help. You guys

  • 0

This group has been very helpful, I really appreciate all the help. You guys are awesome. I searched but could not find an answer. I have a data frame which incluces 1st column server names and others have different metrics. I would like to be able to use ggplot2 to go though the data frame and create charts based on unique rows (servernames). How can I do this given a large data set.

Here is a sample data set:

Hostname            Date          CPU Mem  cpu       avg        io       mem           
host1       2012-01-01 01:00:00   27.24   2.33       0.47       2.33     27.20
host1       2012-01-01 02:00:00   28.00  22.38      36.50      22.38     27.49
host2       2012-01-01 03:00:00   29.31   7.58      12.23       7.58     28.56
host2       2012-01-01 04:00:00   29.37   2.44       0.35       2.44     29.30
host3       2012-01-01 05:00:00   29.07   2.86       1.04       2.86     28.02
host3       2012-01-01 06:00:00   28.05   2.74       0.67       2.74     27.96

 > str(yy)
 List of 10
 $ Hostname  : Factor w/ 37 levels "host1",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ Date      : POSIXct[1:26088], format: "2012-01-01 01:00:00" "2012-01-01         
 02:00:00" "2012-01-01 03:00:00" "2012-01-01 04:00:00" ...
 $ variable  : chr [1:26088] "1:00:00" "2:00:00" "3:00:00" "4:00:00" ...
 $ 5         : num [1:26088] 27.2 28 29.3 29.4 29.1 ...
 $ 60        : num [1:26088] NA NA NA NA NA NA NA NA NA NA ...
 $ 61        : num [1:26088] NA NA NA NA NA NA NA NA NA NA ...
 $ CPUAVG    : num [1:26088] 2.33 22.38 7.58 2.44 2.86 ...
 $ CPUAVG+Sev: num [1:26088] 0.47 36.5 12.23 0.35 1.04 ...
 $ CPUMaximum: num [1:26088] 2.33 22.38 7.58 2.44 2.86 ...
 $ MemoryAVG : num [1:26088] 27.2 27.5 28.6 29.3 28 ...
- attr(*, "row.names")= int [1:26088] 1 2 3 4 5 6 7 8 9 10 ...
 - attr(*, "idvars")= chr [1:3] "Hostname" "Date" "variable"
 - attr(*, "rdimnames")=List of 2
 ..$ :'data.frame':    26088 obs. of  3 variables:
 .. ..$ Hostname: Factor w/ 37 levels "host1",..: 1 1 1 1 1 1 1 1 1 1 ...
 .. ..$ Date    : Factor w/ 31 levels "01/01/2012","01/02/2012",..: 1 1 1 1 1 1 1 1 
1    1 ...
 .. ..$ variable: Factor w/ 24 levels "Hour1","Hour2",..: 1 2 3 4 5 6 7 8 9 10 ...
 ..$ :'data.frame':    7 obs. of  1 variable:
.. ..$ MetricType: Factor w/ 7 levels "5","60","61",..: 1 2 3 4 5 6 7
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T03:11:38+00:00Added an answer on May 30, 2026 at 3:11 am

    Sounds like a facetting question to me. Here’s an example. Updated with your data

    # Dummy data    
    x <- data.frame(
      hostname=rep(paste("host",1:3,sep=""),1000),
      date=as.Date(1:1000,origin="2005-01-01"),
      CPUMEM=rnorm(1000)+20,
      CPU=rnorm(1000)+10,
      avg=rnorm(1000)+10,
      io=rnorm(1000)+5,
      mem=rnorm(1000)+27)
    
    x <- melt(x, c("hostname","date"))
    
    ggplot(x, aes(date,value, color=variable)) + geom_line() + facet_grid(~hostname)
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question has been asked before and I read all the answers
I know this question has been asked multiple times (however, I could still not
I know this question has been asked several times, but I would like to
I'm sure this question has been answered before, but I can't find an answer
I have a user document which has a group field. This field is an
This has bugged me for a long time. 99% of the time, the GROUP
I'm not very good at SQL, but I'm certainly learning. So this one provides
I know this question has been asked quite a few times, however, I have
I havn't been able to find an answer to this, and it may very
I'm using Linq to entities applying a Table per Type approach. This has been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.