Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8392257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:28:20+00:00 2026-06-09T19:28:20+00:00

I have created an empty data frame using another data frame with the below

  • 0

I have created an empty data frame using another data frame with the below code.

compare<-data.frame(nrow=nrow(test_email),ncol=ncol(test_data))
colnames(compare)<-c("email", "gender")

Now, I am trying to assign value to the columns of compare data frame based on some conditions using simple assignment statement.

compare[1,1]<-test_email[1,1]
compare[1,2]<-test_data[1,2]

In the above, test_email[1,1] has an email ID like”abc@gmail.com”
But, after assignment compare[1,1] has value 81 and not the email ID.
I am not able to get it why the email is not getting assigned and some numeric vlaue is getting assigned. Can anyone let me know this reason and how to solve. Structure of test_email is below:

structure(list(email = structure(c(81L, 75L, 57L, 61L, 79L, 76L),
.Label = "ajay.bansal@siemens.com", "amanmeet.bhalla@gmail.com",
"aoneshp@gmail.com", "aparna_anand@msn.com", "ar.ashwani@gmail.com",
"ar.parulbansal@gmail.com", "ar.preet02@gmail.com",
"asdawsd@yahoo.com", "assd@yopmail.com",
"avijeet_yadav@rediffmail.com", "avneng1.negi@gmail.com",
"avnihatnagar@yahoo.com", "bansalanuj007@yahoo.com.au",
"bhanu5877@yahoo.co.in"), class = "factor")), .Names = "email",
w.names = c(NA, 6L), class = "data.frame")

I am not able to find out why R is converting email into some numeric values during assignment.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:28:21+00:00Added an answer on June 9, 2026 at 7:28 pm

    Your assignment is still reading the email addresses as factors.

    A simple approach to this would be:

    compare[1,1] <- as.character(test_email[1,1])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using QtWebkit's javascript bridge, I have created a class to interface the data in
I have created an empty json object having an array itemlist(which further contains itemid
I am building an Day View calendar app. I have already created the empty
For a new project I have created a local folder tree with empty Visual
I have a DbContext that is empty. Mappings are created dynamically and the DbContext
I have created an android application that calls (using kSOAP library) a SOAP based
I have recently started using R and am still getting used to its data
I have created a blog application using Ruby on Rails and have just added
in my android application i have created Background thread to load data from the
I have created an app using a badly named database, all alterations to important

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.