as data frame not working expected

+1 vote

I ran the following code to read data from a CSV file:

normData= read.csv("normData.csv");

and my normData looks like:

enter image description here

But When I ran the following code to form a Data Frame:

datExpr0 = as.data.frame(t(normData));

I get the following data:

enter image description here

from where the an extra raw (v1,v2,v3,v4,v5,v6) coming from?

Nov 5, 2018 in Data Analytics by Hannah
• 18,540 points
1,810 views

1 answer to this question.

0 votes

Try using:

setNames(as.data.frame(t(normData[-1])), normData[[1]])
answered Nov 5, 2018 by Kalgi
• 52,350 points

Related Questions In Data Analytics

0 votes
1 answer

How to apply list to a function which give data frame as output

If you use  tidyverse, you can use ...READ MORE

answered Apr 11, 2018 in Data Analytics by Sahiti
• 6,370 points
768 views
+1 vote
3 answers

Filtering R data-frame with multiple conditions

You can use the 'filter' function from ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
87,130 views
+1 vote
2 answers

Finding number of missing values and removing those missing values from a data-frame

To find number of missing values for ...READ MORE

answered Aug 14, 2019 in Data Analytics by anonymous
1,083 views
+1 vote
2 answers

How to sort a data frame by columns in R?

You can use dplyr function arrange() like ...READ MORE

answered Aug 21, 2019 in Data Analytics by anonymous
• 33,030 points
1,787 views
+10 votes
3 answers

Which is a better initiative to learn data science: Python or R?

Well it truly depends on your requirement, If ...READ MORE

answered Aug 9, 2018 in Data Analytics by Abhi
• 3,720 points
1,604 views
0 votes
1 answer

How can I perform word stemming in R

The tm package in R provides the stemDocument() function to stem the ...READ MORE

answered Aug 20, 2018 in Data Analytics by Abhi
• 3,720 points
4,524 views
0 votes
1 answer

How to know the type of an object?

To find the type of an object ...READ MORE

answered Sep 20, 2018 in Data Analytics by Abhi
• 3,720 points
701 views
0 votes
2 answers

In data frame how to spilt strings into values?

You can do this using dplyr and ...READ MORE

answered Dec 5, 2018 in Data Analytics by Kalgi
• 52,350 points
1,076 views
+1 vote
3 answers

Which language should I learn when starting career as data scientist - R or Python

I'll put down a few parameters on ...READ MORE

answered Oct 26, 2018 in Data Analytics by Kalgi
• 52,350 points
1,567 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP