How the R language code block is highlighted
This article mainly explains "how to highlight R language code blocks". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to highlight R language code blocks.
Tips:
1. The comment lines in the code should be on a separate line, with a blank line before and after each line, so as not to cause code highlighting errors.
two。 After the code has been highlighted, you can use the shift+enter key to add blank lines when the code needs blank lines, while the direct enter code block will break
The following is the perfect display after the blank line:
Use Bio::SeqIO;use Bio::Seq;use Data::Dumper;$in = Bio::SeqIO- > new (- file = > "D:/share/scripts/Arabidopsis_thaliana.TAIR10.cds.all.fa",-alphabet= > "dna",-format = > 'Fasta') $out = Bio::SeqIO- > new (- file = > "> D:/share/scripts/aa.fa",-format = > 'fasta'); while (my $seqobj = $in- > next_seq ()) {# the human read-able id of the sequencemy $id=$seqobj- > id (); # string of sequencemy $seq=$seqobj- > seq (); # a description of the sequencemy $desc=$seqobj- > desc () # one of 'dna','rna','protein' https://www.bioinformatics.org/sms/iupac.htmlmy $alphabet=$seqobj- > alphabet (); my $len=$seqobj- > length (); print $id. "\ n"; print $seq. "\ n"; print $desc. "\ n"; print $alphabet. "\ n"; print $len. "\ n"; print $seqobj. "\ n"; print Dumper ($seqobj); $out- > write_seq ($seqobj); last;}
If there are no blank lines, the code displays an error:
Use Bio::SeqIO;use Bio::Seq;use Data::Dumper;$in = Bio::SeqIO- > new (- file = > "D:/share/scripts/Arabidopsis_thaliana.TAIR10.cds.all.fa",-alphabet= > "dna",-format = > 'Fasta') $out = Bio::SeqIO- > new (- file = > "> D:/share/scripts/aa.fa",-format = > 'fasta'); while (my $seqobj = $in- > next_seq ()) {# the human read-able id of the sequencemy $id=$seqobj- > id (); # string of sequencemy $seq=$seqobj- > seq (); # a description of the sequencemy $desc=$seqobj- > desc () # one of 'dna','rna','protein' https://www.bioinformatics.org/sms/iupac.htmlmy $alphabet=$seqobj- > alphabet (); my $len=$seqobj- > length (); print $id. "\ n"; print $seq. "\ n"; print $desc. "\ n"; print $alphabet. "\ n"; print $len. "\ n"; print $seqobj. "\ n"; print Dumper ($seqobj); $out- > write_seq ($seqobj); last } at this point, I believe you have a deeper understanding of "how to highlight R language code blocks". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!