Skip to content

Commit d360610

Browse files
gregorgorjancbenjeffery
authored andcommitted
Using <- in favour of =
1 parent 7f4a400 commit d360610

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tskitr.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ we'll first add some mutations to our tree sequence with the
114114
for each of the tree sequence's sample nodes:
115115

116116
```{code-cell}
117-
ts_mut = msprime$sim_mutations(reduced_ts, rate=1e-4, random_seed=321)
117+
ts_mut <- msprime$sim_mutations(reduced_ts, rate=1e-4, random_seed=321)
118118
paste(ts_mut$num_mutations, "mutations, genetic diversity is", ts_mut$diversity())
119119
```
120120

@@ -123,15 +123,15 @@ sequence {meth}`~TreeSequence.genotype_matrix()` method to return the genotypes
123123
the tree sequence as a matrix object in R.
124124

125125
```{code-cell}
126-
G = ts_mut$genotype_matrix()
126+
G <- ts_mut$genotype_matrix()
127127
G
128128
is(G)
129129
```
130130

131131
We can then use R functions directly on the genotype matrix:
132132

133133
```{code-cell}
134-
allele_frequency = rowMeans(G)
134+
allele_frequency <- rowMeans(G)
135135
allele_frequency
136136
```
137137

@@ -168,10 +168,10 @@ phylogenetic tree representation defined in the the popular
168168
individual trees {meth}`exported in Newick format<Tree.as_newick>`:
169169

170170
```{code-cell}
171-
file = tempfile()
171+
file <- tempfile()
172172
ts_mut$write_nexus(file)
173173
# Warning - ape trees are stored independently, so this will use much more memory than tskit
174-
trees <- ape::read.nexus(file, force.multi = TRUE) # return a set of trees
174+
trees <- ape::read.nexus(file, force.multi=TRUE) # return a set of trees
175175
176176
# Or simply read in a single tree
177177
tree <- ape::read.tree(text=ts_mut$first()$as_newick())

0 commit comments

Comments
 (0)