Hello! I'm trying to work through the data examples in the book. In the second chapter, I had trouble creating the plot for the censorship data. I had an error that said NULL value passed as symbol address. Everything else worked fine. I decided to move to Chapter 3 and the Krackhardt data. I'm getting the same error. Please see below for my syntax and the error message. (I'm also now getting an error on creating the tenure object. Do you have any suggestions? Thanks!
Danette
library(network)
library(ina)
data(Krackhardt)
Net <- Krackhardt
par(mfrow = c(1, 3))
set.seed(1)
Pal <- colorRampPalette(c("#e5f5e0", "#31a354"))
tenure <- get.vertex.attribute(Net, "Tenure")
col.tenure <- Pal(length(unique(tenure))) [
as.numeric(cut(tenure, breaks = length(unique(tenure))))
]
plot(Net, edge.col="gray", label.col="black", vertex.cex=1.5, vertex.col=col.tenure, label=tenure,
main="Tenure")
library(network)
library(ina)
data(Krackhardt)
Net <- Krackhardt
par(mfrow = c(1, 3))
set.seed(1)
Pal <- colorRampPalette(c("#e5f5e0", "#31a354"))
tenure <- get.vertex.attribute(Net, "Tenure")
Error in get.vertex.attribute(Net, "Tenure") : Not a graph object
col.tenure <- Pal(length(unique(tenure))) [
- as.numeric(cut(tenure, breaks = length(unique(tenure))))
- ]
Error in unique(tenure) : object 'tenure' not found
plot(Net, edge.col="gray", label.col="black", vertex.cex=1.5, vertex.col=col.tenure, label=tenure,
Error in .Call(getEdgeAttribute_R, el, attrname, na.omit, null.na, deleted.edges.omit) :
NULL value passed as symbol address