Skip to content
Snippets Groups Projects
Commit 5ebfd5ce authored by Elisabetta Ronchieri's avatar Elisabetta Ronchieri
Browse files

Update total_ram.R

parent 4015be33
No related branches found
No related tags found
No related merge requests found
# Caricare i dati di total ram esportati da graphana per colonna
df <- read.csv2("grafana_data_total_ram_export_column.csv",skip=2,as.is=T, header=F)
# Assegnare nomi alle colonne del data frame
names(df)<-c('data','mem')
# Assegnare il valore NA ai valori null
df[,2][which(df[2]=='null')] <- NA
# Convertire in numeri i dati della mem
df[2]<-as.numeric(df[,2])
# Convertire il tipo della variabile data
df$data <- as.POSIXct(strptime(df[,1], "%Y-%m-%dT%H:%M:%S"),"%Y-%m-%d %H:%M:%S")
df
plot(df[,'data'],df[,'mem'])
as.Date(df$data,"%Y-%m-%d %H:%M:%S")
# Visualizzare la serie temporale usando diverse funzioni grafiche
# 1. plot
plot(df[,'data'],df[,'mem'])
# 2. plot_ly
library(plotly)
plot_ly(df, x = ~data, y = ~mem, text=paste(as.Date(df$data,"%Y-%m-%d %H:%M:%S")))
df
# 3. ggplot
library(ggplot2)
ggplot(df, aes(x = data, y = mem)) + geom_point()
df
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment