title: rowMeans doesn't work on my data - all vectors are numeric
body: <p>I need help on how to get one vector with the mean values of every row which results in the same length as the ones that are combined with the function.</p>
  <p>I did this on the same data before with rowMeans (different subset but actually the same - I did though paste my way of getting to the subset as well). I created numeric vectors out of the dataset and now try to combine them but I always get the error:</p>
  <blockquote>
  <p>Error in rowMeans(subset(SME_partyA, select = c(ASvarchange1,
  ASvarchange2,  :    'x' must be numeric</p>
  </blockquote>
  <p>I see other people pasting their console typings in here so I'm trying to paste mine.</p>
  <pre><code>dfs &lt;- split(data_final, f = list(data_final$X__13, data_final$X__18))
  
  SME_partyA &lt;- rbind(dfs$`No.between 1 and 10 employees`,dfs$`No.between 11 and 50 employees`,dfs$`No.between 51 and 250 employees`)
  
  ASvarchange1 &lt;- as.numeric(SME_partyA$X__24)
  ASvarchange2 &lt;- as.numeric(SME_partyA$X__25)
  ASvarchange3 &lt;- as.numeric(SME_partyA$X__26)
  ASvarchange4 &lt;- as.numeric(SME_partyA$X__27)
  ASvarchange3R &lt;- car::recode(ASvarchange3, &quot;0=10;1=9;2=8;3=7;4=6;5=5;6=4;7=3;8=2;9=1;10=0&quot;)
  
  SME_partyA$ALChange &lt;- rowMeans(subset(SME_partyA, select = c(ASvarchange1, ASvarchange2, ASvarchange3, ASvarchange4)), na.rm = TRUE)
  </code></pre>
  <blockquote>
  <p>Error in rowMeans(subset(SME_partyA, select = c(ASvarchange1,
  ASvarchange2,  :
  'x' must be numeric</p>
  </blockquote>
  <p>Data:</p>
  <pre><code>dput(head(data_final))
  structure(list(`2021-06-28-Rohdaten von Umfrage employer-and-employee-needs-in-the-home-office-environment (alle beendeten)` = c(&quot;ID&quot;, 
  &quot;166&quot;, &quot;42&quot;, &quot;161&quot;, &quot;190&quot;, &quot;217&quot;), X__1 = c(&quot;Datum&quot;, &quot;2021-05-19&quot;, 
  &quot;2021-03-26&quot;, &quot;2021-05-19&quot;, &quot;2021-05-19&quot;, &quot;2021-05-19&quot;), X__2 = c(&quot;Frage 1 - Please select your age group&quot;, 
  &quot;18-24 years&quot;, &quot;18-24 years&quot;, &quot;18-24 years&quot;, &quot;18-24 years&quot;, &quot;18-24 years&quot;
  ), X__3 = c(&quot;Frage 2 - Please indicate which gender you belong to.&quot;, 
  &quot;male&quot;, &quot;female&quot;, &quot;male&quot;, &quot;female&quot;, &quot;male&quot;), X__4 = c(&quot;Frage 3 - Do you have children living in the same household? - up to 3 years&quot;, 
  NA, NA, NA, NA, NA), X__5 = c(&quot;Frage 3 - Do you have children living in the same household? - between 4 and 6 years&quot;, 
  NA, NA, NA, NA, NA), X__6 = c(&quot;Frage 3 - Do you have children living in the same household? - between 7 and 9 years&quot;, 
  NA, NA, NA, NA, NA), X__7 = c(&quot;Frage 3 - Do you have children living in the same household? - between 10 and 12 years&quot;, 
  NA, NA, NA, NA, NA), X__8 = c(&quot;Frage 3 - Do you have children living in the same household? - between 13 an 15 years&quot;, 
  NA, NA, NA, NA, NA), X__9 = c(&quot;Frage 3 - Do you have children living in the same household? - between 16 and 18 years&quot;, 
  NA, NA, NA, NA, NA), X__10 = c(&quot;Frage 3 - Do you have children living in the same household? - older than 18 years&quot;, 
  NA, NA, NA, NA, NA), X__11 = c(&quot;Frage 4 - What is your current employment status?&quot;, 
  &quot;Apprentice&quot;, &quot;Apprentice&quot;, &quot;Apprentice&quot;, &quot;Apprentice&quot;, &quot;Apprentice&quot;
  ), X__12 = c(&quot;Frage 5 - Are you employed by a company alongside being a student?&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__13 = c(&quot;Frage 6 - Do you have managerial responsibility in your current job?&quot;, 
  &quot;No&quot;, &quot;No&quot;, &quot;No&quot;, &quot;No&quot;, &quot;No&quot;), X__14 = c(&quot;Frage 7 - For how many years have you been carrying out your current occupation?&quot;, 
  &quot;0-5 years&quot;, &quot;0-5 years&quot;, &quot;0-5 years&quot;, &quot;0-5 years&quot;, &quot;0-5 years&quot;
  ), X__15 = c(&quot;Frage 8 - How many years ago did you start your professional career?&quot;, 
  &quot;0-5 years ago&quot;, &quot;6-10 years ago&quot;, &quot;0-5 years ago&quot;, &quot;0-5 years ago&quot;, 
  &quot;0-5 years ago&quot;), X__16 = c(&quot;Frage 9 - For how many years have you been working for your current employer?&quot;, 
  &quot;0-5 years&quot;, &quot;0-5 years&quot;, &quot;0-5 years&quot;, &quot;0-5 years&quot;, &quot;0-5 years&quot;
  ), X__17 = c(&quot;Frage 10 - How many years ago did you start your current business?&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__18 = c(&quot;Frage 11 - How many employees are employed by the company you are working at?&quot;, 
  &quot;more than 250 employees&quot;, &quot;between 51 and 250 employees&quot;, &quot;more than 250 employees&quot;, 
  &quot;more than 250 employees&quot;, &quot;more than 250 employees&quot;), X__19 = c(&quot;Frage 12 - Are you currently working from home?&quot;, 
  &quot;yes, I work particular days from home (since more than 6 weeks).&quot;, 
  &quot;yes, I've worked from home since more than 6 weeks.&quot;, &quot;no, but I worked from home within the last 12 months. All in all it was more than 6 weeks.&quot;, 
  &quot;yes, I work particular days from home (since more than 6 weeks).&quot;, 
  &quot;yes, I work particular days from home (since more than 6 weeks).&quot;
  ), X__20 = c(&quot;Frage 13 - Are your employees / certain employees currently working from home or did they work from home within the last months?&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__21 = c(&quot;Frage 14 - Is a member of your household currently working from home?&quot;, 
  &quot;No&quot;, &quot;Yes&quot;, &quot;No&quot;, &quot;Yes&quot;, &quot;Yes&quot;), X__22 = c(&quot;Frage 15 - Is it possible in your eyes to carry out your occupation from home?&quot;, 
  &quot;0&quot;, &quot;0&quot;, &quot;2&quot;, &quot;1&quot;, &quot;6&quot;), X__23 = c(&quot;Frage 16 - Is it possible in your eyes for your employees to carry out their occupation from home?&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__24 = c(&quot;Frage 17 - After starting to work from home, I quickly got used to the new way of working.&quot;, 
  &quot;1&quot;, &quot;5&quot;, &quot;1&quot;, &quot;0&quot;, &quot;7&quot;), X__25 = c(&quot;Frage 18 - In my eyes, change is a chance.&quot;, 
  &quot;0&quot;, &quot;4&quot;, &quot;1&quot;, &quot;0&quot;, &quot;2&quot;), X__26 = c(&quot;Frage 19 - I like it when everything stays the way it is.&quot;, 
  &quot;0&quot;, &quot;10&quot;, &quot;9&quot;, &quot;10&quot;, &quot;2&quot;), X__27 = c(&quot;Frage 20 - I have fun learning something new.&quot;, 
  &quot;3&quot;, &quot;1&quot;, &quot;0&quot;, &quot;0&quot;, &quot;3&quot;), X__28 = c(&quot;Frage 21 - While working from home I am regularly in touch and have regular exchanges with my direct supervisor.&quot;, 
  &quot;1&quot;, &quot;3&quot;, &quot;5&quot;, &quot;0&quot;, &quot;2&quot;), X__29 = c(&quot;Frage 22 - My supervisor motivating me improved since I've started working from home.&quot;, 
  &quot;5&quot;, &quot;6&quot;, &quot;5&quot;, &quot;2&quot;, &quot;8&quot;), X__30 = c(&quot;Frage 23 - I enjoy my current job.&quot;, 
  &quot;2&quot;, &quot;2&quot;, &quot;0&quot;, &quot;0&quot;, &quot;7&quot;), X__31 = c(&quot;Frage 24 - I am able to motivate myself very well.&quot;, 
  &quot;0&quot;, &quot;6&quot;, &quot;0&quot;, &quot;0&quot;, &quot;2&quot;), X__32 = c(&quot;Frage 25 - Since I started working from home, I make less mistakes at work.&quot;, 
  &quot;2&quot;, &quot;5&quot;, &quot;5&quot;, &quot;4&quot;, &quot;7&quot;), X__33 = c(&quot;Frage 26 - In my opinion, my performance while working from home is better than while working at the office.&quot;, 
  &quot;5&quot;, &quot;7&quot;, &quot;5&quot;, &quot;5&quot;, &quot;8&quot;), X__34 = c(&quot;Frage 27 - Since I started working from home, I am better at achieving the goals me and my employer agreed on.&quot;, 
  &quot;5&quot;, &quot;7&quot;, &quot;5&quot;, &quot;5&quot;, &quot;8&quot;), X__35 = c(&quot;Frage 28 - I am more diligent working from home compared to working in the office.&quot;, 
  &quot;2&quot;, &quot;9&quot;, &quot;5&quot;, &quot;5&quot;, &quot;10&quot;), X__36 = c(&quot;Frage 29 - It usually takes longer for me to work on a task from home than if I completed it in the office&quot;, 
  &quot;5&quot;, &quot;5&quot;, &quot;2&quot;, &quot;3&quot;, &quot;2&quot;), X__37 = c(&quot;Frage 30 - The longer processing time rather is reason to the fact that something / someone distracts me and that my manager has more difficulties at controlling me than to a slower internet connection etc.&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;8&quot;, &quot;6&quot;, &quot;4&quot;), X__38 = c(&quot;Frage 31 - Since it is more difficult for my manager to control my work from home, I also make less effort.&quot;, 
  &quot;7&quot;, &quot;5&quot;, &quot;8&quot;, &quot;9&quot;, &quot;5&quot;), X__39 = c(&quot;Frage 32 - While working from home I only report to my manager about my work progress if he or she asks about or requests it.&quot;, 
  &quot;3&quot;, &quot;0&quot;, &quot;7&quot;, &quot;1&quot;, &quot;8&quot;), X__40 = c(&quot;Frage 33 - When working from home, it is expected that one shall be reachable around the clock.&quot;, 
  &quot;6&quot;, &quot;10&quot;, &quot;2&quot;, &quot;10&quot;, &quot;10&quot;), X__41 = c(&quot;Frage 34 - When working from home, I find it harder to stick to break times.&quot;, 
  &quot;1&quot;, &quot;0&quot;, &quot;1&quot;, &quot;0&quot;, &quot;3&quot;), X__42 = c(&quot;Frage 35 - When working from home, I have shorter active working hours on average compared to when working in the office.&quot;, 
  &quot;7&quot;, &quot;0&quot;, &quot;3&quot;, &quot;10&quot;, &quot;2&quot;), X__43 = c(&quot;Frage 36 - I am regularly in touch and have regular exchanges with my employees when they are working from home.&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__44 = c(&quot;Frage 37 - When my employees work from home, I have to give more motivation to them in order for their performance to be comparable to them working in the office.&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__45 = c(&quot;Frage 38 - I give more motivation to my employees more when they work from home.&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__46 = c(&quot;Frage 39 - Since my employees have been working from home, they are better at achieving the goals they agreed on with me / the company.&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__47 = c(&quot;Frage 40 - I know what my employees are working on when they are working from home.&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__48 = c(&quot;Frage 41 - It is important to me to know what my employees are working on when they are working from home.&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__49 = c(&quot;Frage 42 - I want my employees to actively report to me on their work progress when they work from home&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__50 = c(&quot;Frage 43 - Compared to working in the office, the time it takes my employees to complete similar tasks increased significantly.&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__51 = c(&quot;Frage 44 - I expect my employees to be reachable around the clock when they are working from home.&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__52 = c(&quot;Frage 45 - When working from home, my employees have shorter active working hours on average compared to when working in the office.&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__53 = c(&quot;Frage 46 - What prevents you / your employer from you working from home? - 1.&quot;, 
  NA, NA, NA, NA, NA), X__54 = c(&quot;Frage 46 - What prevents you / your employer from you working from home? - 2.&quot;, 
  NA, NA, NA, NA, NA), X__55 = c(&quot;Frage 46 - What prevents you / your employer from you working from home? - 3.&quot;, 
  NA, NA, NA, NA, NA), X__56 = c(&quot;Frage 46 - What prevents you / your employer from you working from home? - 4&quot;, 
  NA, NA, NA, NA, NA), X__57 = c(&quot;Frage 46 - What prevents you / your employer from you working from home? - 5&quot;, 
  NA, NA, NA, NA, NA), X__58 = c(&quot;Frage 47 - What prevents you / your employees from them working from home? - 1.&quot;, 
  NA, NA, NA, NA, NA), X__59 = c(&quot;Frage 47 - What prevents you / your employees from them working from home? - 2.&quot;, 
  NA, NA, NA, NA, NA), X__60 = c(&quot;Frage 47 - What prevents you / your employees from them working from home? - 3.&quot;, 
  NA, NA, NA, NA, NA), X__61 = c(&quot;Frage 47 - What prevents you / your employees from them working from home? - 4.&quot;, 
  NA, NA, NA, NA, NA), X__62 = c(&quot;Frage 47 - What prevents you / your employees from them working from home? - 5.&quot;, 
  NA, NA, NA, NA, NA), X__63 = c(&quot;Frage 48 - Please imagine your employer allows you to work from home. Which 3 needs would most importantly be met for you beeing able to work from home? - 1.&quot;, 
  NA, NA, NA, NA, NA), X__64 = c(&quot;Frage 48 - Please imagine your employer allows you to work from home. Which 3 needs would most importantly be met for you beeing able to work from home? - 2.&quot;, 
  NA, NA, NA, NA, NA), X__65 = c(&quot;Frage 48 - Please imagine your employer allows you to work from home. Which 3 needs would most importantly be met for you beeing able to work from home? - 3.&quot;, 
  NA, NA, NA, NA, NA), X__66 = c(&quot;Frage 49 - Please imagine you could allow your employees to work from home. Which 3 needs would most importantly be met for you to actually let your employees work from home? - 1.&quot;, 
  NA, NA, NA, NA, NA), X__67 = c(&quot;Frage 49 - Please imagine you could allow your employees to work from home. Which 3 needs would most importantly be met for you to actually let your employees work from home? - 2.&quot;, 
  NA, NA, NA, NA, NA), X__68 = c(&quot;Frage 49 - Please imagine you could allow your employees to work from home. Which 3 needs would most importantly be met for you to actually let your employees work from home? - 3.&quot;, 
  NA, NA, NA, NA, NA), X__69 = c(&quot;Frage 50 - I use the following technical devices for my work at home. - Laptop / Computer / (Spalten 1-4)&quot;, 
  &quot;Was already in my personal possession&quot;, &quot;Provided by my employer&quot;, 
  &quot;Was already in my personal possession&quot;, &quot;Was already in my personal possession&quot;, 
  &quot;Was already in my personal possession&quot;), X__70 = c(&quot;Frage 50 - I use the following technical devices for my work at home. - Second monitor / (Spalten 1-4)&quot;, 
  &quot;Was already in my personal possession&quot;, &quot;I don't have / use this&quot;, 
  &quot;I don't have / use this&quot;, &quot;Was already in my personal possession&quot;, 
  &quot;I don't have / use this&quot;), X__71 = c(&quot;Frage 50 - I use the following technical devices for my work at home. - External keyboard / (Spalten 1-4)&quot;, 
  &quot;Was already in my personal possession&quot;, &quot;I don't have / use this&quot;, 
  &quot;Was already in my personal possession&quot;, &quot;Was already in my personal possession&quot;, 
  &quot;I don't have / use this&quot;), X__72 = c(&quot;Frage 50 - I use the following technical devices for my work at home. - External mouse / (Spalten 1-4)&quot;, 
  &quot;Was already in my personal possession&quot;, &quot;I don't have / use this&quot;, 
  &quot;I don't have / use this&quot;, &quot;Was already in my personal possession&quot;, 
  &quot;I don't have / use this&quot;), X__73 = c(&quot;Frage 50 - I use the following technical devices for my work at home. - Headphones / Headset / (Spalten 1-4)&quot;, 
  &quot;Was already in my personal possession&quot;, &quot;Was already in my personal possession&quot;, 
  &quot;Was already in my personal possession&quot;, &quot;Was already in my personal possession&quot;, 
  &quot;Was already in my personal possession&quot;), X__74 = c(&quot;Frage 50 - I use the following technical devices for my work at home. - Phone / (Spalten 1-4)&quot;, 
  &quot;I don't have / use this&quot;, &quot;Was already in my personal possession&quot;, 
  &quot;Was already in my personal possession&quot;, &quot;Was already in my personal possession&quot;, 
  &quot;Was already in my personal possession&quot;), X__75 = c(&quot;Frage 51 - I consider myself as technically skilled.&quot;, 
  &quot;0&quot;, &quot;7&quot;, &quot;0&quot;, &quot;0&quot;, &quot;0&quot;), X__76 = c(&quot;Frage 52 - With the technical devices available to me, I can practice my profession from home without restrictions.&quot;, 
  &quot;2&quot;, &quot;3&quot;, &quot;3&quot;, &quot;2&quot;, &quot;8&quot;), X__77 = c(&quot;Frage 53 - It's not a problem for me to use my private technical devices or purchase new devices for my work at home.&quot;, 
  &quot;5&quot;, &quot;2&quot;, &quot;9&quot;, &quot;10&quot;, &quot;10&quot;), X__78 = c(&quot;Frage 54 - Work space&quot;, 
  &quot;Work space - a lockable room which is usually not used as an office (after work)&quot;, 
  &quot;Work space - a lockable room which is usually not used as an office (after work)&quot;, 
  &quot;Work space - a lockable room, which is primarily used as an office&quot;, 
  &quot;Work space - a lockable room which is usually not used as an office (after work)&quot;, 
  &quot;Work space - a lockable room which is usually not used as an office (after work)&quot;
  ), X__79 = c(&quot;Frage 54 - Work place&quot;, &quot;Work place - a table and a chair&quot;, 
  &quot;Work place - a table and a chair&quot;, &quot;Work place - a desk and an office chair&quot;, 
  &quot;Work place - a desk and an office chair&quot;, &quot;Work place - a desk and an office chair&quot;
  ), X__80 = c(&quot;Frage 55 - Household members who are also in the apartment during my working hours or, if present, neighbors' noises do not bother me at work.&quot;, 
  &quot;7&quot;, &quot;8&quot;, &quot;8&quot;, &quot;6&quot;, &quot;0&quot;), X__81 = c(&quot;Frage 56 - I can focus a lot worse while working from home than when working in the office.&quot;, 
  &quot;5&quot;, &quot;2&quot;, &quot;2&quot;, &quot;5&quot;, &quot;2&quot;), X__82 = c(&quot;Frage 57 - When working in the office, I have a lot more contact with my colleagues than when working from home.&quot;, 
  &quot;0&quot;, &quot;2&quot;, &quot;0&quot;, &quot;5&quot;, &quot;0&quot;), X__83 = c(&quot;Frage 58 - If I have any questions or there's a need to interact, I can reach my colleagues from the home office just as quickly as when working together in the office.&quot;, 
  &quot;5&quot;, &quot;5&quot;, &quot;10&quot;, &quot;3&quot;, &quot;10&quot;), X__84 = c(&quot;Frage 59 - How often do team-internal meetings take place that are organised by your manager?&quot;, 
  &quot;once a week&quot;, &quot;twice a week&quot;, &quot;twice a week&quot;, &quot;daily&quot;, &quot;twice a week&quot;
  ), X__85 = c(&quot;Frage 60 - How often would you wish for team-internal meetings that are organised by your manager taking place?&quot;, 
  &quot;once a week&quot;, &quot;daily&quot;, &quot;daily&quot;, &quot;twice a week&quot;, &quot;twice a week&quot;
  ), X__86 = c(&quot;Frage 61 - I found the following from my employer to be particularly good / helpful when working from home or when switching from the office to the home office&quot;, 
  NA, NA, NA, &quot;.&quot;, NA), X__87 = c(&quot;Frage 62 - With the technical devices available to my employees, they can practice their profession from home without restrictions.&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__88 = c(&quot;Frage 63 - I expect my employees to (also) use their private technical devices or purchase new devices for their work at home.&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__89 = c(&quot;Frage 64 - How often do team-internal meetings take place that are organised by you or other mangers?&quot;, 
  &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;, &quot;-2&quot;), X__90 = c(&quot;Frage 65 - I found the following from my employees / one employee to be particularly good / exemplary when working from home or when switching from the office to the home office&quot;, 
  NA, NA, NA, NA, NA), X__91 = c(&quot;ist anonym&quot;, &quot;1&quot;, &quot;1&quot;, &quot;1&quot;, &quot;1&quot;, 
  &quot;1&quot;), X__92 = c(&quot;abgeschlossen&quot;, &quot;1&quot;, &quot;1&quot;, &quot;1&quot;, &quot;1&quot;, &quot;1&quot;), X__93 = c(&quot;beendet&quot;, 
  &quot;1&quot;, &quot;1&quot;, &quot;1&quot;, &quot;1&quot;, &quot;1&quot;), X__94 = c(&quot;Beantwortungsdauer (in s)&quot;, 
  &quot;358.48&quot;, &quot;404.25&quot;, &quot;428.38&quot;, &quot;446.06&quot;, &quot;453.82&quot;), X__95 = c(&quot;Antwort-Quote&quot;, 
  &quot;0.6153999999999999&quot;, &quot;0.6153999999999999&quot;, &quot;0.6308&quot;, &quot;0.6462&quot;, 
  &quot;0.6308&quot;), X__96 = c(&quot;Attribut 1&quot;, NA, NA, NA, NA, NA), X__97 = c(&quot;Passwort&quot;, 
  NA, NA, NA, NA, NA), X__98 = c(&quot;Sprache&quot;, &quot;de&quot;, &quot;de&quot;, &quot;de&quot;, &quot;en&quot;, 
  &quot;de&quot;), X__99 = c(&quot;Startzeit&quot;, &quot;05/19/2021&quot;, &quot;03/26/2021&quot;, &quot;05/19/2021&quot;, 
  &quot;05/19/2021&quot;, &quot;05/19/2021&quot;), X__100 = c(&quot;Endzeit&quot;, &quot;05/19/2021&quot;, 
  &quot;03/26/2021&quot;, &quot;05/19/2021&quot;, &quot;05/19/2021&quot;, &quot;05/19/2021&quot;), X__101 = c(&quot;Laufzeit&quot;, 
  &quot;00:05:58&quot;, &quot;00:06:44&quot;, &quot;00:07:08&quot;, &quot;00:07:26&quot;, &quot;00:07:33&quot;), 
      X__102 = c(&quot;Dauer f&lt;U+00FC&gt;r Seite 1 (in s)&quot;, &quot;14&quot;, &quot;18&quot;, 
      &quot;10&quot;, &quot;6&quot;, &quot;48&quot;), X__103 = c(&quot;Dauer f&lt;U+00FC&gt;r Seite 2 (in s)&quot;, 
      &quot;23&quot;, &quot;29&quot;, &quot;26&quot;, &quot;21&quot;, &quot;21&quot;), X__104 = c(&quot;Dauer f&lt;U+00FC&gt;r Seite 3 (in s)&quot;, 
      &quot;69&quot;, &quot;78&quot;, &quot;125&quot;, &quot;75&quot;, &quot;88&quot;), X__105 = c(&quot;Dauer f&lt;U+00FC&gt;r Seite 4 (in s)&quot;, 
      &quot;91&quot;, &quot;110&quot;, &quot;79&quot;, &quot;172&quot;, &quot;169&quot;), X__106 = c(&quot;Dauer f&lt;U+00FC&gt;r Seite 5 (in s)&quot;, 
      &quot;160&quot;, &quot;167&quot;, &quot;186&quot;, &quot;171&quot;, &quot;125&quot;), X__107 = c(&quot;Dauer f&lt;U+00FC&gt;r Seite 6 (in s)&quot;, 
      &quot;2&quot;, &quot;2&quot;, &quot;2&quot;, &quot;2&quot;, &quot;2&quot;)), row.names = c(NA, -6L), class = c(&quot;tbl_df&quot;, 
  &quot;tbl&quot;, &quot;data.frame&quot;))
  </code></pre>
  <p>So I tried this myself with another example and failed... Could anyone tell me where my mistake is?</p>
  <blockquote>
  <p>LargeCo_partyB1 &lt;- rbind(dfs$<code>-2.more than 250 employees</code>,dfs$<code>Yes.more than 250 employees</code>)</p>
  </blockquote>
  <blockquote>
  <p>colsContB &lt;- paste0('X__', 47:49)</p>
  </blockquote>
  <blockquote>
  <p>new_colsContB &lt;- paste0('Bvarcont', seq_along(colsContB))</p>
  </blockquote>
  <blockquote>
  <p>LargeCo_partyB[new_colsContB] &lt;- lapply(LargeCo_partyB)[colsContB], as.numeric)
  Error: unexpected ',' in &quot;LargeCo_partyB[new_colsContB] &lt;- lapply(LargeCo_partyB)[colsContB],&quot;</p>
  </blockquote>
  <blockquote>
  <p>LargeCo_partyB$BLCont &lt;- rowMeans(LargeCo_partyB[new_colsContB], na.rm = TRUE)
  Error: Columns <code>Bvarcont1</code>, <code>Bvarcont2</code>, <code>Bvarcont3</code> not found
  Call <code>rlang::last_error()</code> to see a backtrace</p>
  </blockquote>