R

Asked • 09/05/19

How to get row from R data.frame?

I have a data.frame with column headers. How can I get a specific row from the data.frame as a list (with the column headers as keys for the list)?Specifically, my data.frame is <pre> A B C 1 5 4.25 4.5 2 3.5 4 2.5 3 3.25 4 4 4 4.25 4.5 2.25 5 1.5 4.5 3</pre>And I want to get a row that's the equivalent of > c(a=5, b=4.25, c=4.5) a b c 5.0 4.25 4.5

1 Expert Answer

By:

Inactive Tutor answered • 09/09/26

Tutor
New to Wyzant

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.