seq is short for sequence. A sequence is an ordered list of objects (or events). Like a set, it contains members (also called elements or terms), and the number of terms (possibly infinite) is called the length of the sequence. Unlike a set, order matters, and exactly the same elements can appear multiple times at different positions in the sequence. Sometimes, sequence is used as a generic name for both list, array and set for convenience.
Questions tagged [seq]
730 questions
-1
votes
2 answers
Use for loop to take steps of 15 and match vector to dataframe column
I have a series of numbers that are 0 or 1. total length is 35115 or if you take 35115/15 you have 2341 blocks. I want to step through each block and see if my vector tmp matches the column of interest that contains the blocks. I want to seq along…

Genetics
- 279
- 2
- 11
-1
votes
3 answers
How to determine if every three lines has the desired number of letters?
I have a big data set and would like to check if every third line has the desired number of bases.
example:
line 1
line 2
ATTGAC
line 4
line 5
TTCGGATC
line 7
line 8
GGTCAA
So line 6 contains 8 bases instead of 6. I would like my script to stop if…
-1
votes
3 answers
Create this vector using rep() and seq()
I'm starting with R language and I have to create this vector using rep() and seq().
1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9
I've been trying some stuff but but I'm not achieving it.

Hotkrat
- 9
- 1
- 3
-1
votes
1 answer
R: calculate percent through data range - create bin
I am absolutely brand new to coding in R - in fact coding in general, so excuse my ignorance.
I have a data file with 'start' and 'end' position values for features of varying lengths. I would like to output a file that creates bins for each feature…

czyscner
- 13
- 4
-1
votes
1 answer
Don't understand the seq function
I'm reading a book on R and I don't understand the behavior of the seq function. Can someone please explain to me what it's doing when you give it a vector such as what is shown below on line 4?
> seq(1,5,1)
[1] 1 2 3 4 5
> x <- c(1,5,1)
>…

vitalious
- 241
- 2
- 9
-1
votes
1 answer
How do I check if a series of numbers multiplying a number n are integers
I want to check if a series of numbers multiplying a number n are integers. However, when I use the seq function to develop this series and multiply n, then checking if it is a integer sequence, I will find something wrong, such as the following…

Iean Lin
- 9
-1
votes
2 answers
How to find number of variable sites between two DNA sequences
Is there a way I can find number of variable sites for a pair of nucleotide sequences using R and also which sites are variable ?
For eg.
Seq1=ATGCCCCGTAATGC
Seq2=AGGCAACGTAAAGC
I want the number of variable sites as 5 and the positions 2,3,5,6,12…

Anurag Mishra
- 1,007
- 6
- 16
- 23
-1
votes
2 answers
getting sequence number from mongodb always undefined
I am trying to get by code the next sequence number but it always says "undefined".
I did this in my mongoDB before:
db.PresentationCollection.insert(
{
_id: "editorID",
seq: 0
}
)
my code (name is editorID):
function…

spinker
- 298
- 4
- 20
-2
votes
1 answer
Adding padded zeros to name files
Based off this: How to zero pad a sequence of integers in bash so that all have the same width?
I need to create new file names to enter into an array representing chromosomes 1-22 with three digits…

tacrolimus
- 500
- 2
- 12
-2
votes
1 answer
Array filtering based on a condition in scala
I have the below array with me
scala> Array((65.0,53.0,54.0),(20.0,30.0,24.0),(11.0,19.0,43.0))
res3: Array[(Double, Double, Double)] = Array((65.0,53.0,54.0), (20.0,30.0,24.0), (11.0,19.0,43.0))
How to filter out the items from this array based…

abc_spark
- 383
- 3
- 19
-2
votes
2 answers
Spark - java.lang.ClassCastException: cannot assign instance of scala.collection.immutable.List$SerializationProxy
I have a dataframe with Schema :
root
|-- QUERY: string (nullable = true)
|-- TYPE: string (nullable = true)
|-- DEVICE: string (nullable = true)
|-- PURCHASE_UNITS_SUM: double (nullable = true)
|-- CLICK_SUM: decimal(38,18) (nullable = true)
…

user3407267
- 1,524
- 9
- 30
- 57
-2
votes
1 answer
print out only certain column between matching strings
input:
#word1 #word2 #word3 #word4
1.00 2.00 3.00 4.00
#end
#word1 #word3 #word4
11.00 13.00 14.00
#end
#word1 #word2 #word3 #word4
21.00 22.00 23.00 24.00
#end
#word1 #word3 #word4
31.00 33.00 …

usermrt
- 53
- 8
-2
votes
1 answer
R: loop won't run due to a seq.default error
I am trying to calculate the area under the curve for every 10ms of a short piece of EEG wave. To first practice this I made a small dataset to run the auc (from package {flux}) function on.
x <- seq(1:10)
y <- c(0:4,5:1)
df <-…

Fred
- 31
- 1
- 6
-2
votes
1 answer
How to deal with List of currying function in Scala
In the following Scala code I have a sequence of currying functions with different signatures. I want to iterate through them and invoke.
def intCheck(b: Int)(a: Int) = a == b
def stringCheck(b: String)(a: String) = a == b
def doubleCheck(b:…

Anil Kurian
- 223
- 2
- 3
-2
votes
2 answers
Creating a repeating sequence in R
I need to create a pattern like this with the rep() and seq() commands.
It should look like this:
[1] 0.0 0.0 0.0 0.8 0.8 0.8 1.6 1.6 1.6 2.4 2.4 2.4 3.2 3.2 3.2 4.0 4.0 4.0 4.8
[20] 4.8 4.8
Do you have any idea how to do so?

Domewitz
- 21
- 2