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,550 points
409 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,310 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,380 points
130 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,620 points
53,354 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
256 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
• 32,930 points
607 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 8, 2018 in Data Analytics by Abhi
• 3,720 points
305 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
517 views
0 votes
1 answer

How to know the type of an object?

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

answered Sep 19, 2018 in Data Analytics by Abhi
• 3,720 points
109 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 4, 2018 in Data Analytics by Kalgi
• 52,310 points
226 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,310 points
241 views