Displaying 20 results from an estimated 400 matches similar to: "summarize_all Function"
2020 Oct 01
0
summarize_all Function
The warning gives some suggestions. E.g., replace funs(sum,prod) with
list(sum=sum,prod=prod).
% R CMD Rscript -e 'library(dplyr,warn.conflicts=FALSE);
data.frame(X=1:3,Y=c(11,13,17)) %>% summarize_all(funs(sum,prod))'
X_sum Y_sum X_prod Y_prod
1 6 41 6 2431
Warning message:
`funs()` is deprecated as of dplyr 0.8.0.
Please use a list of either functions or lambdas:
2020 Oct 01
0
summarize_all Function
Hello,
Any of the two will do, the first is now preferred.
library(dplyr)
mtcars %>%
summarise(across(everything(), sum))
mtcars %>%
summarise_all(sum) # no need for `funs()`
Hope this helps,
Rui Barradas
?s 18:29 de 01/10/20, Jeff Reichman escreveu:
> r-help Forum
>
>
>
> I'm using the dplyr:: summarize_all(funs(sum)) function and am receiving a
>
2018 May 05
1
Discovering patterns in textual strings
"Does that help?"
No. I am not your private consultant. You need to reply to the list, which
I have cc'ed here, not just me.
I am still somewhat confused by your specifications, but others may not be.
Part of my confusion stems from your failure to provide a reproducible
example (see e.g. the posting guide linked below). For example, I cannot
tell from your text whether the Abc
2023 May 16
3
Recombining Mon and Year values
R Help
I have a data.frame where I've broken out the year <dbl> and an ordered
month <ord> values. But I need to recombine them so I can graph mon-year in
order but when I recombine I lose the month order and the results are
plotted alphabetical.
Year month mon_year
<dbl> <ord>
2021 Mar Mar-2021
2021 Jan
2018 May 07
0
Discovering patterns in textual strings
Bert
Here are some examples of the type of text strings I?m dealing with:
??????.??.???
??????.??.??????????
?Torrent? Pro - Torrent App
?Torrent?-Torrent Downloader
1 Pic 8 Words - Syllables
1 Pic 8 Words - Syllables
27043_Spanish songs for children
28.android.com.alpha.horoscope
28.android.com.bravo.horoscope
28.Card Game - Offline
28.card Game Multiplayer
37045_Spanish songs
2023 May 16
1
Recombining Mon and Year values
?s 21:29 de 16/05/2023, Jeff Reichman escreveu:
> R Help
>
>
>
> I have a data.frame where I've broken out the year <dbl> and an ordered
> month <ord> values. But I need to recombine them so I can graph mon-year in
> order but when I recombine I lose the month order and the results are
> plotted alphabetical.
>
>
>
> Year month
2018 May 04
4
Discovering patterns in textual strings
R Help Forum
Is there a R library (or a way) that I can extract unique character strings,
or repeating patterns in textual strings. Say for example I have the
following records:
Abc_1234_kjhksh_276
Abc
Abc_1234_lakdofyo_324
Bce_876_skdhk_*&^%*&
Bce
Bce_454
And I would like to see the following results
Abc
Abc_1234
Bce
Jeff Reichman
[[alternative HTML version
2018 Apr 12
3
Bivariate Normal Distribution Plots
R-Help
I am attempting to create a series of bivariate normal distributions. So using the mvtnorm library I have created the following code ...
# Standard deviations and correlation
sig_x <- 1
sig_y <- 1
rho_xy <- 0.0
# Covariance between X and Y
sig_xy <- rho_xy * sig_x *sig_y
# Covariance matrix
Sigma_xy <- matrix(c(sig_x ^ 2, sig_xy, sig_xy, sig_y ^ 2), nrow = 2, ncol = 2)
2018 Mar 13
2
Understanding TS objects
R Help Community
I'm trying to understand time series (TS) objects. Thought I understood but recently have run into a series of error messages that I'm not sure how to handle. I have 15 years of quarterly data and I typically create a TS object via something like...
data.ts <- ts(mydata, start = 2002, frequency = 4)
this create a matric as opposed to a vector object as I receive a
2017 Aug 24
2
likert Package
R- Help Forum
Working with the "likert" package and I can't figure out why my "bar" graphs
are backwards (see attached). The percentages are place correctly but the
bars are backwards.
#Sample code
# libraries
library(likert)
# create data
band <- c("Band 3","Band 3","Band 3","Band 3","Band 3","Band
2023 Aug 31
2
How to create an R input
R Help
Trying to figure out how to create a simple program that will as the user
from a value input and simply add 5 units to that value then ask the user
for another value and add 45 units to it and on and on. Then how does one
exit the loop of program?
# Create a function called `add_five`
add_five <- function(x) {
# Add 5 to the input value
x + 5
}
readline(prompt =
2017 Aug 23
2
likert Package
R- Help Forum
Working with the "likert" package and find that my "bar" graphs are
backwards (see attached)
> summary(results)
Item low neutral high mean sd
4 Q4 5 15 80 2.75 0.5501196
5 Q5 20 40 40 2.20 0.7677719
1 Q1 65 30 5 1.40 0.5982430
3 Q3 5 90 5 2.00 0.3244428
2 Q2 90 10 0 1.10 0.3077935
2018 May 26
3
Grouping by 3 variable and renaming groups
ALCON
I'm trying to figure out how to rename groups in a data frame after groups
by selected variabels. I am using the dplyr library to group my data by 3
variables as follows
# group by lat (StoreX)/long (StoreY)
priceStore <- LapTopSales[,c(4,5,15,16)]
priceStore <- priceStore[complete.cases(priceStore), ] # keep only non NA
records
priceStore_Grps <- priceStore %>%
2018 May 26
0
Grouping by 3 variable and renaming groups
Hello,
See if this is it:
priceStore_Grps$StoreID <- paste("Store",
seq_len(nrow(priceStore_Grps)), sep = "_")
Hope this helps,
Rui Barradas
On 5/26/2018 2:03 PM, Jeff Reichman wrote:
> ALCON
>
>
>
> I'm trying to figure out how to rename groups in a data frame after groups
> by selected variabels. I am using the dplyr library to group my
2023 Jun 04
2
Adding a numeric class to a data.frame
R-Help Community
How do I add a numeric class to a data .frame.
For example, I have calculated the following probabilities
1 2 3
0.0011566127 0.0009267028 0.0081623324
How would I add them back into my data.frame for example
My_df <- data.frame(col_1 = c('A', 'B', 'C')) such that I end up with
col_1
2018 May 26
1
Grouping by 3 variable and renaming groups
Hello,
Sorry, but I think my first answer is wrong.
You probably want something along the lines of
sp <- split(priceStore_Grps, priceStore_Grps$StorePC)
res <- lapply(seq_along(sp), function(i){
sp[[i]]$StoreID <- paste("Store", i, sep = "_")
sp[[i]]
})
res <- do.call(rbind, res)
row.names(res) <- NULL
Hope this helps,
Rui Barradas
On 5/26/2018
2011 Aug 31
2
stumped on how to reorder factors
I am trying to reorder a factor data type so that when I plot stats
associated with the factor, the ordering makes sense.
For instance, if I have a factor entered as follows ...
A = as.factor(c("1", "10", "3", "3", "10", "10"))
levels(A)
... the ordering does not really make sense (assuming I want the factor
ordered by integer
2004 Apr 22
6
wondershaper, host *exclusion*?
Hi,
I really like the wondershaper script, it works very well for me. My
question is this. Is there a way to get certain remote hosts to be
excluded from the shaping? I ask because I don''t have my box connected
directly through the net. It sits behind a nat device, and has ports
forwarded in for services. I''d like to limit the ports and services, but
only to things going outside
2017 Nov 08
2
Help Converting Calendars
R-Help
Trying to convert a Gregorian calendar dataset to a Persian calendar
dataset. But I end up with a list and not sure what to do. For example ...
dates <- c("2017-10-1","2017-10-2","2017-10-3")
myData <- data.frame(dates)
myData$dates <- as.Date(myData$dates, format = "%Y-%m-%d")
> myData
dates
1 2017-10-01
2 2017-10-02
3
2017 Nov 08
0
Help Converting Calendars
How about
> p_dates <- paste0(p.dates[[3]], "-", p.dates[[2]], "-", p.dates[[1]])
> myData$p_dates <- p_dates
> print(myData, right=FALSE)
dates p_dates
1 2017-10-01 1396-7-9
2 2017-10-02 1396-7-10
3 2017-10-03 1396-7-11
> str(myData)
'data.frame': 3 obs. of 2 variables:
$ dates : Date, format: "2017-10-01"