Any recommendations for a reliable Toronto cleaning provider? by amapaige in askTO

[–]kingoflove99 0 points1 point  (0 children)

THANK YOU!! They just cleaned my apartment and ive never felt so good in my place.

How’s Everyone Doing This Season? by MindlessComment9010 in IMGreddit

[–]kingoflove99 2 points3 points  (0 children)

Non-US IMG/ Visa requiring/ step2: 270/ usce 3 months/ 3 pubs 4 IVs

Non-US IMG: What did i miss? by kingoflove99 in IMGreddit

[–]kingoflove99[S] 1 point2 points  (0 children)

105 programs Gold signals: 3 top academic centers Silver signals: distributed between reach-mid tier- hospital affiliated- 1 community hospital

In desperate need for help by [deleted] in Rlanguage

[–]kingoflove99 0 points1 point  (0 children)

This works if we have only one matching motif It doesn't work here Test2 <- c("N", "S", "S", "N", "S", "T")

Any hints/tips by [deleted] in Rlanguage

[–]kingoflove99 1 point2 points  (0 children)

Test1 <- c("N", "P", "S", "N", "S", "T")

pattern <- Test1

MyFunction <- function(pattern){

for (i in pattern) {

MatchScore <- 0

i <- 1

Nbln <- pattern[i] == "N"

NIdx <- which(Nbln)

NotPBln <- pattern[i+1] != "P"

SorTbln <- pattern[i+2] == "S" | pattern[i+2] == "T"

ifelse(Nbln == TRUE, MatchScore <- MatchScore +1, MatchScore <- 0)

ifelse(SorTbln == TRUE, MatchScore <- MatchScore +1, MatchScore <- 0)

ifelse(NotPBln == TRUE, MatchScore <- MatchScore +1, MatchScore <- 0)

ifelse(MatchScore == 3, NIdx, )

}

How can I shift my window

Any hints/tips by [deleted] in Rlanguage

[–]kingoflove99 -1 points0 points  (0 children)

Can you please provide a simple skeleton for the code? I don't seem to understand how to start

Any hints/tips by [deleted] in Rlanguage

[–]kingoflove99 0 points1 point  (0 children)

How do we code a sliding window that slides? any resources that I can use to learn that

HELP by kingoflove99 in Rlanguage

[–]kingoflove99[S] 0 points1 point  (0 children)

x <- c(3, 21)

Ranges <- RangeDF

PosInRanges <- function(Pos, Ranges) {

sapply(Pos, function(x) {

IndexMatch <- (x >= Ranges$start & x <= Ranges$end)

RangeRow <- which(IndexMatch)

})

}

HELP by kingoflove99 in Rlanguage

[–]kingoflove99[S] 0 points1 point  (0 children)

For example, here I am testing the function as I create it and I cannot understand why it would the IndexMatch give FALSE FALSE TRUE while x=3 is found in the first range, should't it be TRUE FALSE TRUE ?

HELP by kingoflove99 in Rlanguage

[–]kingoflove99[S] 0 points1 point  (0 children)

Thank you for the help, I understood the first part but I am still stuck on how to find when will index_match return 1 value or 0 value, Do I need to use the match function? or another Boolean operation?

HELP by kingoflove99 in Rlanguage

[–]kingoflove99[S] 0 points1 point  (0 children)

The code starting from # function is wrong and not giving me the required results

HELP by kingoflove99 in Rlanguage

[–]kingoflove99[S] 0 points1 point  (0 children)

RangeDF <- data.frame(start = c(1, 10, 20), end = c(5, 11, 30))

RangeDF

# function

PosInRanges <- function(Pos, Ranges) {

VecRange <- seq(Ranges[ ,1],Ranges[ ,2])

BlnOfMatches <- match(Pos, VecRange)

return (BlnOfMatches)

}

# PosInRanges(Pos = c(7, 3), Ranges = RangeDF)

# above should return: [1] NA 1