Hello fellow Stackers! This is my first question so i am curious if you can help me! :)
First: I checked similar questions and unfortunately none of the solutions worked for me. Tried it for nearly 3 days now :/ Since I am working with sensitive data I cannot provide the original table for reprex, unfortunately. However I will create a small substitutional example-table for testing.
To get to the problem:
I want to predict a norm value using the package "CNorm". It requires raw data, classification data, a model and min/max values and some other things that are less important. The problem is: Whatever I do, whatever Data-type and working directory I use, it gives me the error "$ operator is invalid for atomic vectors" to change that I transformed the original .sav-file to a Dataframe. Well- nothing happened. I tested the type of the data and it said dataframe, not atomic vector. Also i tried using "[1]" for location or ["Correct"] for names but still the same error showed up. Same for using 2 single Dataframes, using lists. I have tried to use $ to check, if i get a different error but also the same. I even used another workspace to check if the old workspace was bugged.
So maybe I just did really stupid mistakes but I really tried and it did not work out so I am asking you, what the solution might be. Here is some data to test! :)
install.packages("haven")
library(haven)
install.packages("CNORM")
library(CNORM)
SpecificNormValue <- predictNorm((Data_4[1]),(Data_4[2]),model = T,minNorm = 12, maxNorm = 75, force = FALSE, covariate = NULL)
So that is one of the commands I used on the Dataframe "Data_4". I also tried not using brackets or using "xxx" to get the column names but to no avail.
The following is the example Dataframe. To test it more realistic I would recommend an Exel-file with 2 columns and 900 rows(+ Column title) (like the original). The "correct"-values can be random selected by Excel and they differ from 35 to 50, the age differs from 6 to 12.
Correct | Age |
---|---|
40 | 6 |
45 | 7 |
50 | 6 |
35 | 6 |
I really hope someone of you can figure out the problem and how I get the command properly running. I really have no other idea right now.
Thanks for checking my question and thanks in advance for your time! I would be glad to hear from you!