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 6546443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:42:30+00:00 2026-05-25T11:42:30+00:00

I am porting part of a program (not enough to compile and run) from

  • 0

I am porting part of a program (not enough to compile and run) from R to C++. I am not familiar with R. I have done okay using the references online, but was stumped by the following line:

cnt2.2<-cnt2[,-1]

I am guessing:

  1. cnt2 is a 2 dimensional matrix
  2. cnt2.2 is a new variable being declared with a period ‘.’ used the same way an alphabetic character would be.
  3. <- is an assignment.
  4. [,-1] accesses part of the array. I thought [,5] meant all rows, 5th column only. If this is correct, I have no idea what -1 refers to.
  • 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-05-25T11:42:30+00:00Added an answer on May 25, 2026 at 11:42 am

    This is covered in section 2.7 of the manual: http://cran.r-project.org/doc/manuals/R-intro.html#Index-vectors

    It is a negative index into the cnt2 object specifying all rows and all columns except the first column.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm porting a windows forms program to run on Windows Phone 7. Part of
Porting an application from C# (1.1 framework) to VB.NET (3.5 framework), and I have
We're porting an application from Tru64 to SLES11 and the part that I'm working
I am working on porting code from JAVA to C#, and part of the
I'm porting some code from lisp, but I got stuck at this part (apparently
I'm using a Java program to POST some XML data from a remote client
I have implemeneted a method into my c# program to run a batch file,
We have an application that we're porting to Mac OS from Windows. Once installed,
I'm making simple webcam program using OpenCV 2.3 and got stuck by the compile
I'm porting a class from plain JDBC to use Spring. Part of this class

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.