Displaying 5 results from an estimated 5 matches for "rsolution".
Did you mean:
solution
2016 Apr 18
2
Sum of Numeric Values in a DF Column
... and here is a non-dplyr rsolution:
> z <-gsub("[^[:digit:]]"," ",dd$Lower)
> sapply(strsplit(z," +"),function(x)sum(as.numeric(x),na.rm=TRUE))
[1] 105 67 60 100 80
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things i...
2016 Apr 18
0
Sum of Numeric Values in a DF Column
...trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Mon, Apr 18, 2016 at 10:43 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
> ... and here is a non-dplyr rsolution:
>
>> z <-gsub("[^[:digit:]]"," ",dd$Lower)
>
>> sapply(strsplit(z," +"),function(x)sum(as.numeric(x),na.rm=TRUE))
> [1] 105 67 60 100 80
>
>
> Cheers,
> Bert
> Bert Gunter
>
> "The trouble with having an open mind i...
2016 Apr 18
0
Sum of Numeric Values in a DF Column
## Continuing with your data
AA <- stringr::str_extract_all(dd[[2]],"[[:digit:]]+")
BB <- lapply(AA, as.numeric)
## I think you are looking for one of the following two expressions
sum(unlist(BB))
sapply(BB, sum)
On Mon, Apr 18, 2016 at 12:48 PM, Burhan ul haq <ulhaqz at gmail.com> wrote:
> Hi,
>
> I request help with the following:
>
> INPUT: A data frame
2007 Mar 06
2
Package RODBC
I have some questions about the RODBC package.
library(RODBC) # required for those who want to repeat these lines
1st, I noticed that the following sequence does not work:
channel <- odbcConnextExcel("test.xls")
tables <- sqlTables(channel)
name1 <- tables[1, "TABLE_NAME"] # this should be the name
plan1 <- sqlFetch(channel, name1) # bang!
2016 Apr 18
3
Sum of Numeric Values in a DF Column
Hi,
I request help with the following:
INPUT: A data frame where column "Lower" is a character containing numeric
values (different count or occurrences of numeric values in each row,
mostly 2)
> dput(dd)
structure(list(State = c("Alabama", "Alaska", "Arizona", "Arkansas",
"California"), Lower = c("R 72?33",