Jimmy Lee
Jimmy Lee

Reputation: 117

How to expand the function of seq() to list or dataframe?

So now I have a list look like this:

$a
[1] 2

$b
[1] 5

$c
[1] 3

Just wonder if there's a way to make them become:

$a
[1] 1 2

$b
[1] 1 2 3 4 5

$c
[1] 1 2 3

Thank you very much for your answer!!

Upvotes: 4

Views: 52

Answers (1)

akrun
akrun

Reputation: 887951

We can use seq

lapply(lst1, seq)

Upvotes: 2

Related Questions