Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
║▒\
║▒▒\
║░▒║
║░▒║
║░▒║
║░▒║
║░▒║
║░▒║
║░▒║
▓▓▓▓
[█▓]
[█▓]
[█▓]
[█▓]
Producto = c("p1", "p2", "p3", "p4", "p5"),
Cantidad = c(10, 15, 8, 23, 12),
Precio_Venta = c(150, 180, 250, 300, 100)
)
ventas$Total_Venta <- apply(ventas[, 2:3], 1, function(x) x[1] * x[2])
cantidad_maxima <- max(ventas$Cantidad)
cantidad_minima <- min(ventas$Cantidad)
producto_max <- ventas$Producto[ventas$Cantidad == cantidad_maxima]
producto_min <- ventas$Producto[ventas$Cantidad == cantidad_minima]
ventas$Precio_Descuento <- mapply(function(precio) {
if (precio > 200) {
return(precio * 0.9)
} else {
return(precio)
}
}, ventas$Precio_Venta)
productos <- c("Arroz", "Frijoles", "Aceite", "Leche", "Pan", "Azúcar", "Café", "Atún")
df <- data.frame(
Productos = sample(productos, cantidad, TRUE),
Precio = round(runif(cantidad, 100, 200), 2),
Categoria = sample(c("Premiun", "Marca propia"), cantidad, TRUE)
)
return(df)
}
produ <- crea_df_productos(10)
produ2 <- crea_df_productos(100)
aplicar_impuesto <- function(df, productos_impuesto) {
df$impuesto <- ifelse(df$Productos %in% productos_impuesto, df$Precio * 0.19, 0)
df$total <- df$impuesto + df$Precio
return(df)
}
productos_con_impuestos <- c("Azúcar", "Café", "Atún")
dftotal <- aplicar_impuesto(produ2, productos_con_impuestos)