I have 4 assignemnts that I cannot seem to do or comprehend. I can load data into RStudio, but when I follow the commands given I keep getting error codes. I"m so lost with this that I don't even know how to ask what I need help with at this point. I think I need to be walked through what I"m supposed to be doing.
You've come to the right place - so after you load the data, what do you do next? What errors are you seeing?
library(readxl)
assignment3_data <- read_excel("assignment3_data.xlsx")
View(assignment3_data)
cor(assignment3_data)
Abundance Richness Diversity Evenness Dominance
Abundance 1.00000000 0.4604106 0.3917484 -0.00104315 0.2798182
Richness 0.46041059 1.0000000 0.9202242 0.34481744 0.9053254
Diversity 0.39174836 0.9202242 1.0000000 0.59905406 0.9250234
Evenness -0.00104315 0.3448174 0.5990541 1.00000000 0.6251702
Dominance 0.27981825 0.9053254 0.9250234 0.62517015 1.0000000
pairs(assignment3_data.pch16)
Error in pairs(assignment3_data.pch16) :
object 'assignment3_data.pch16' not found
model.a<-lm(assignment3_data$Diversity~assignment3_data$Richness~assignment3_data$Evenness)
Error in model.frame.default(formula = assignment3_data$Diversity ~ assignment3_data$Richness ~ :
object is not a matrix
model.b<-lm(assignment3_data$Diversity~assignment3_data$Abundance~assignment3_data$Richness~assignment3_data$Evenness)
Error in model.frame.default(formula = assignment3_data$Diversity ~ assignment3_data$Abundance ~ :
object is not a matrix
model.c<-lm(assignment3_data$Diversity~assignment3_data$Abundance~assignment3_data$Richness~assignment3_data$Evenness~assignment3_data$Dominance)
Error in model.frame.default(formula = assignment3_data$Diversity ~ assignment3_data$Abundance ~ :
object is not a matrix
model.d<-lm(assignment3_data$Abundance~assignment3_data$Dominance)
model.e<-lm(diversity-1)
Error in stats::model.frame(formula = diversity - 1, drop.unused.levels = TRUE) :
object 'diversity' not found
pairs(assignment3_data.pch16)
Error in pairs(assignment3_data.pch16) :
object 'assignment3_data.pch16' not found
model.a<-lm(assignment3_data$Diversity~assignment3_data$Richness+assignment3_data$Evenness)
model.b<-lm(assignment3_data$Diversity~assignment3_data$Abundance+assignment3_data$Richness+assignment3_data$Evenness)
model.c<-lm(assignment3_data$Diversity~assignment3_data$Abundance+assignment3_data$Richness+assignment3_data$Evenness+assignment3_data$Dominance)
model.d<-lm(assignment3_data$Abundance~assignment3_data$Dominance)
model.e<-lm(diversity-1)
Error in stats::model.frame(formula = diversity - 1, drop.unused.levels = TRUE) :
object 'diversity' not found
pairs(assignment3_data.pch=16)
Error in pairs.default(assignment3_data.pch = 16) :
argument "x" is missing, with no default
model.a<-lm(assignment3_data$Diversity~assignment3_data$Richness+assignment3_data$Evenness)
model.b<-lm(assignment3_data$Diversity~assignment3_data$Abundance+assignment3_data$Richness+assignment3_data$Evenness)
model.c<-lm(assignment3_data$Diversity~assignment3_data$Abundance+assignment3_data$Richness+assignment3_data$Evenness+assignment3_data$Dominance)
model.d<-lm(assignment3_data$Abundance~assignment3_data$Dominance)
model.e<-lm(diversity-1)
Error in stats::model.frame(formula = diversity - 1, drop.unused.levels = TRUE) :
object 'diversity' not found
install.package(MuMln)
Error in install.package(MuMln) :
could not find function "install.package"
library(foreign)
data <-read.csv(“data.csv”)
Error: unexpected input in "data <-read.csv(“"
require(MuMIn)
Loading required package: MuMIn
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called ‘MuMIn’
Session restored from your saved work on 2022-Jun-15 19:20:51 UTC (2 hours ago)
I suppose that I should add my assignement so you know what I"m attempting to do.
_Mod Edit _ : verbatim homework instructions have been redacted
Hi, welcome!
Please have a look to our homework policy, homework inspired questions are welcome but they should not include verbatim instructions from your course.
As @ andresrcs points out we cannot do your assignment for you but I think we can offer a bit of help.
Do these first commands work?
library(readxl)
assignment3_data <- read_excel("assignment3_data.xlsx")
View(assignment3_data)
cor(assignment3_data)
If so it means you have loaded the data successfully.
Next, what is
assignment3_data.pch16
I do not see why it would exist. You might want to start from there.
I know you can't do my homework, and I only added it becasue I'm unsure of how to word any of it.
The first bit did work, and I have the output numbers from it. I'm trying to make the scatter plots of the models and it won't work, so I"m not sure what I did wrong because I copied it from our assignment sheet
The code worked until after the numbers of data where is says "pairs(assignment3_data.pch16" and after that everything was wrong
The problem is that I cannot see where
assignment3_data.pch16
comes from. I suspect it does not exist. Where did you get it?
What happens if you try
str(assignment3_data.pch16)
print(assignment3_data.pch16)
If I am correct you should get error messages. If not can you post the output here?
Added to the previous comment, it looks like most of the code should work if you just replaced assignment3_data.pch16
with assignment3_data
.
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.