Warning in dist function

Hello. I have the next script.

tdfile <- read.table("tdfile.txt", header = T)

d <- dist(tdfile)
fit <- cmdscale(d,eig=TRUE, k=3) # k is the number of dim
fit # view results

x1 <- fit$points[,1]
x2 <- fit$points[,2]
x3 <- fit$points[,3]

tdfile.txt:
x y
-0.000619727820637277 0.334742234439879
0.486972842621572 0.645794059282842
0.761097709102752 0.896891734895503
0.265979758391511 1.13248315974883
....

After the script is done I had the warning:

"In dist (tdfile): NA created as a result of the conversion"

What's wrong with code? What I must do?

I do not see any error or warning while running your code. Your output is what you expected?

JossChavez, hello!
Sorry, but I'm newbie in MDS and R.
I don't know how my output must be. When I used MDS for converting 3D data to 2D data it was great, all good. Now I want to do reverse convert 2D to 3D and I have the warning.
my output:

$points
              [,1]        [,2]          [,3]
 [1,] -0.225902329  0.48924010  7.890892e-02
 [2,] -0.011027571 -0.04451218  1.507612e-02
 [3,]  0.187935638 -0.35943167  1.020084e-02
 [4,]  0.503054630  0.08761832 -5.290819e-02
 [5,] -0.153064842  0.23068597  3.131540e-02
....

Maybe something wrong in column 3, values are so small...

I don't know MDS package or what your work is about... But conceptually how does this make sense ? "When I used MDS for converting 3D data to 2D data it was great, all good. Now I want to do reverse convert 2D to 3D "
How would you determine what the additional dimension should contain?
For example, if I took a colour image and saved it as greyscale, there is no principled way to reverse an operation that discards information.

Maybe you can give me advice.
My steps:

  1. I have many vectors(3 values).
  2. I use MDS and get points.
  3. I draw some rectangles for points in the group.
  4. Line is 3 points.
  5. Now.

What's wrong?

1 to 3 make some sense, but you completely lost me at 4 and 5. Can you think of a different way to describe?

1 to 3 make some sense, but you completely lost me at 4 and 5. Can you think of a different way to describe?

Ok.
Step 4. I describe lines (of a rectangle) like 3 points (begin, middle, end).
Step 5. I thought I can get values of lines (of all point of lines) by MDS, and then use that's value in the system of linear equations to know input vector(1 Step) in some group or no.

Maybe you can suggest another way.

rectangles have 4 lines, and can be described by 4 points, each line is represented by a beginning and end point. these lines have middle points , as well as points 1 third from each end, 1 quarter from each end and on to infinity... I dont see why you would mention the middle . I find that confusing.

As I've never done MDS, I'm probably not the best person to help you along.
Have you searched the internet for examples of where someone has done something along the lines of what you want to do ? If there is a clear example , it should be straightforward to adapt it to your own data. (I would think)

All lines in rectangles have 3 points in my way.
But, Thank you.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.