Quantitative Analysis: NVIDIA | R-bloggers



[This article was first published on DataGeeek, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)


Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t.

Although the investors do not like the pace of revenue growth, in terms of QoQ, NVIDIA’s revenue increased for the first time in five quarters.

Source code:

library(tidyverse)
library(tidyquant)
library(timetk)


#NVIDIA Corporation Earnings
df_nvda_earnings <- 
  read.delim("https://raw.githubusercontent.com/mesdi/blog/refs/heads/main/nvidia_earnings.txt", header = FALSE) %>% 
  as.tibble() %>% 
  janitor::clean_names() %>% 
  rename(date = v1, revenue = v4) %>% 
  select(date, revenue) %>% 
  mutate(date = parse_date(date, "%b %d, %Y") %>% 
           floor_date("month") %m-% months(2) %>% 
           as.yearqtr(.),
         revenue = str_remove(revenue,"B ") %>% as.numeric()) %>% 
mutate(revenue = revenue / lead(revenue) - 1) %>% 
  drop_na()

#Plot
df_nvda_earnings %>% 
  ggplot(aes(x = date, 
             y = revenue)) +
  geom_col(alpha = 0.7,
           fill = "#76b900") +
  geom_smooth(se = FALSE) +
  geom_text(aes(label= paste0(round(revenue,2) * 100,"%")),
            vjust = ifelse(df_nvda_earnings$revenue >= 0, 1.5, -0.5 ), 
            color = "whitesmoke", 
            fontface = "bold",
            size = 6,
            family = "Roboto Slab") +
  scale_x_yearqtr(format = "%Y Q%q") +
  scale_y_continuous(labels = scales::percent) +
  labs(title = "Change of % NVIDIA Corporation's Revenue",
       y = "", 
       subtitle = "Quarter over Quarter",
       x = "") + 
  theme_minimal(base_family = "Roboto Slab") + 
  theme(legend.position = "none",
        plot.subtitle = element_text(size = 16),
        plot.title = ggtext::element_markdown(size = 20),
        axis.text = element_text(face = "bold", size = 18),
        text = element_text(face = "bold", size = 20),
        panel.grid = element_blank(),
        plot.background = element_rect(color = "azure", fill = "azure"),
        panel.grid.major.y = element_line(linetype = "dashed", color = "gray"))





Source link

Related Posts

About The Author

Add Comment