# [Solved] 'list' object cannot be coerced to type 'double' in Recommenderlab

V

#### Vincent Batens

##### Guest
Vincent Batens Asks: 'list' object cannot be coerced to type 'double' in Recommenderlab
I'm having trouble converting a dataframe into a realRatingMatrix. Following the answers of this question. I did this:

Code:
data$Username <- as.factor(data$Username)

data$BGGId <- as.factor(data$BGGId)

data$Rating <- as.numeric(unlist(data$Rating))

temp <- as(data,"realRatingMatrix")

When I execute the last line, I get this error message:

Code:
Error in asMethod(object) :
'list' object cannot be coerced to type 'double'

I don't know what that means exactly, seems like an error inside of the function or something like that.

This is the structure of my dataframe after executing the first 3 lines:

Code:
tibble [65,535 x 3] (S3: tbl_df/tbl/data.frame)
$Username: Factor w/ 13733 levels "A Friend of Grouchy",..: 1 2 2 2 2 3 4 4 4 5 ...$ BGGId   : Factor w/ 9643 levels "6","13","21",..: 825 5767 5385 2 4533 2 379 172 4902 4533 ...
$Rating : num [1:65535] 7 4 4 5 7 6 4 6.8 6.5 6.8 ... Can somebody tell me what that error message means in this context exactly and how to fix it? SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, solveforum. ## Unreplied Threads #### How to prove that a po [duplicate] Swarupananda Dhua Asks: How to prove that a po [duplicate] How can I prove that if a polynomial of SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others. #### How to solve Poisson's equation for the potential? • AnonAstroZ • Physics • Replies: 0 AnonAstroZ Asks: How to solve Poisson's equation for the potential? i'm working with a spherical symmetric system and have found it to have mass density$\rho$=$\frac{1}{4\pi r^2} \frac{dM(r)}{dr}$. Poisson's equation says$\nabla^2 \Omega(r) $=$4\pi G \rho(r)$. I'm confused on how to solve this equation for the potential$\Omega$given the$\rho$that i found. Is there anyone that can advise or provide a starting point? I have been out of school and mathematics for a few years. Thank you! SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others. #### why do magnetic fields exist as line? • SONIC BooM • Physics • Replies: 0 SONIC BooM Asks: why do magnetic fields exist as line? why there are no magnetic field lines between two magnetic field lines. why don't magnetic fields exist as a solid Ovid of influence? SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others. #### What is an intuitive way of understanding the direction of static friction during rolling normally or up or down? • Tian Pu • Physics • Replies: 0 Tian Pu Asks: What is an intuitive way of understanding the direction of static friction during rolling normally or up or down? some of the answers to the question involved a more detailed analysis, but is there a way to understand the direction without doing so? SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others. #### How is work done by Tension zero in this case? • Nishchal123 • Physics • Replies: 0 Nishchal123 Asks: How is work done by Tension zero in this case? How is the Work done by tension in this case .Theres no horizontal force acting so Com wont displace in horizontal it will be in vertical. But Workdone by tension in m should be T2l/3 costheta and 2m should have been T✓l^2 + 2l^2/3 costheta .How is it zero? SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others. #### How can I use the Table and Append commands to make Dimen • Julissa Velasquez • Mathematics • Replies: 0 Julissa Velasquez Asks: How can I use the Table and Append commands to make Dimen I have two sets of data with different dimensions. I would like to use the Table function to create data to fill the dimensions and append it to the set, so both sets have the same dimensions. I would like to start from the last value and create various x values (up to 2500) while the y can stay the same. So that data2 {917, 2} matches the dimensions of data 1 {1337,2}. Any insight would be greatly appreciated. Data is here: https://docs.google.com/spreadsheets/d/1Z-tVwtRmt6UD3v67eMO0e5lws8wwZ6G3hLaZJkETSK0/edit?usp=sharing Code:  In[1]:= data1 = Import["/Users/julissavelasquez/Box/1_Harrison Lab/03_Formic \ Acid/Wodtke_2021_Fig4C/hyperthermal_dist.xlsx", "SkipLines" -> 2][[1]]; In[2]:= data2 = Import["/Users/julissavelasquez/Box/1_Harrison Lab/03_Formic \ Acid/Wodtke_2021_Fig4C/thermal_dist.xlsx", "SkipLines" -> 2][[1]]; In[3]:= {Dimensions[data1], Dimensions[data2]} Out[3]= {{1337, 2}, {917, 2}} In[4]:= data2[[1 ;; 2]] Out[4]= {{2.9895, 0.00054879}, {5.979, 0.00054814}} In[5]:= data2[[-2 ;; -1]] Out[5]= {{2487.29, 2.7924*10^-6}, {2490.28, 2.1354*10^-6}} In[6]:= Table[data2, {i, 2490.28, 2500}] Out[6]= If[25048064219406400976 ===$SessionID,
Out[6], Message[
MessageName[Syntax, "noinfoker"]]; Missing["NotAvailable"]; Null]

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

#### How can I Prove this? Is the explanation correct?

alwayscurious Asks: How can I Prove this? Is the explanation correct?
The Problem is:- if there is a polynomial-time, additive 80-approximation algorithm for the Minimum Vertex Cover problem, then P = NP.

What i am thinking is, since we already know that the Min vertex cover + 80 vertices which spans vertex cover can be solved in polynomial time and then we need to find V-80 vertices from V ( V is total number of vertices in vertex cover) which is also vertex cover. this can also be done in polynomial time. Therefore the Min. Vertex Cover Problem can be solved in polynomial time. Therefore, P=NP.

I feel like this is wrong explanation. Any help is appreciated.

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.