Open OFish opened 10 years ago
Hey @OFish,
I think the na.rm error is being produced by the quantile function being called as part of ichoropleth. Hence, you can't solve this just by adding na.rm=TRUE to the ichoropleth call.
Some things don't work correctly with missing data. If you're ok with na.rm, perhaps just clean up the data frame itself, or better, make a clean version to use here.
I encountered the same issue and went with this, which I found acceptable for my data:
zipdat3$value[is.na(zipdat3$value)] <- 0
with zipdat3 being a modification of zipdat2, a modification of zipdat, due to taking destructive actions like setting things to zero.
Also, this seems like more of a stackoverflow question than an rMaps issue, but perhaps this error should be handled into something that doesn't invite people to try passing na.rm=TRUE.
Good point @bhtucker. I will modify the code so that a more informative error message is thrown.
Hi Ramnath,
I was trying to use crosslet function from rMaps package and got the following error :
data(web_index) crosslet(data=web_index,id_field="country",fields=c("web_index","universal_access"))
Error in crosslet(data = web_index, id_field = "country", fields = c("web_index", : unused arguments (id_field = "country", fields = c("web_index", "universal_access"))
@Ankit-DA
Without hijacking this completely try using the code format shown on the first rMaps page:
library(rMaps)
crosslet(
x = "country",
y = c("web_index", "universal_access", "impact_empowerment", "freedom_openness"),
data = web_index
)
I had this running without an error (although I didn't look at the output).
@Ankit-DA The note by @ekstroem is correct. rMaps
internally maps x
to id_field
and y
to fields
. So use x
and y
and it should work.
Thanks so much @ekstroem and @ramnathv . It is executing now without error, however I don't see the output in the output window of RStudio, probably something to do with the configuration setting of RStudio. Is there a way I could store the resultant output HTML in a file and host that file somewhere on another server ?
Thanks !
@Ankit-DA - Sounds like you may be looking for the save method; I haven't use rMaps for crosslet, but I imagine the syntax may resemble ichoropleth:
d1 <- ichoropleth(x~zipcode,data=sumdf,pal='Greens',ncuts=9,animate='tax_year',map="ESRG_nyczip")
d1$save('regcoeffs.html', cdn = TRUE)
This save method is inherited from rCharts in general; see page 9 here: https://media.readthedocs.org/pdf/rcharts/latest/rcharts.pdf
Thanks @bhtucker for your response, however, $save is giving an error . This is what I tried - d<-crosslet( x = "country", y = c("web_index", "universal_access", "impact_empowerment", "freedom_openness"), data = web_index ) d$save('regcoeffs.html', cdn = TRUE)
Error in mapply(FUN = f, ..., SIMPLIFY = FALSE) : zero-length inputs cannot be mixed with those of non-zero length
Hi, I'm using a data.frame that has missing values in the "Country" column. The code I run, gives me the following error:
and if I do this, then I get the following message:
So I tried doing this, which gives me the same error message.
What am I missing?
Cheers,
O.