% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{to_dataframe}
\alias{to_dataframe}
\title{Convertir Tweets o Usuarios a Data Frame}
\usage{
to_dataframe(x)
}
\arguments{
\item{x}{Lista de tweets o usuarios}
}
\value{
data.frame o tibble
}
\description{
Convierte una lista de tweets o usuarios a data.frame usando purrr::map_dfr
}
\examples{
\donttest{
tweets <- list(
  list(
    id = "1", date = as.POSIXct("2026-01-01"), text = "Hello R",
    username = "rstats", user_displayname = "R Stats", user_id = "10",
    reply_count = 0, retweet_count = 1, like_count = 2, quote_count = 0,
    views_count = 100, lang = "en", url = "https://example.com/1",
    user_followers = 1000, user_verified = FALSE
  )
)
class(tweets) <- c("twscraper_tweets", "list")
df <- to_dataframe(tweets)

users <- list(list(
  id = "10", username = "rstats", displayname = "R Stats",
  description = "Example user", followers_count = 1000,
  following_count = 50, tweets_count = 200, verified = FALSE,
  created = "2026-01-01", location = "", url = "",
  profile_image_url = ""
))
class(users) <- c("twscraper_users", "list")
users_df <- to_dataframe(users)

users[[1]]$source_tweet_id <- "1"
retweeters_df <- to_dataframe(users)  # incluye source_tweet_id
}
}
