logo
down
shadow

How do I address R raster mosaic error: 'data' must be of a vector type, was 'NULL'?


How do I address R raster mosaic error: 'data' must be of a vector type, was 'NULL'?

Content Index :

How do I address R raster mosaic error: 'data' must be of a vector type, was 'NULL'?
Tag : r , By : Umang
Date : November 25 2020, 04:01 AM

With these it helps Where exactly does this occur? It looks when reading an input file (but not a tif file). My guess is that you have included a filename that is not correct. I have changed the argument to list.files to possibly fix that, and made some other suggestions.
library(raster)
library(rgdal)
rnames <- list.files(path=".", pattern="\\.tif$")
ras_list <- lapply(rnames, raster)
names(ras_list) <- NULL
ras_list$fun <- mean
ras_list$filename="ALL_00N.tif"
ras_list$overwrite = TRUE
rast_mosaic <- do.call(mosaic,ras_list)

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

Strategies for editing reactive functions in Shiny, 'data' must be of a vector type, was 'NULL' error


Tag : r , By : John Bentley
Date : March 29 2020, 07:55 AM
it fixes the issue Goal: I am trying to create a shiny app that displays (1) the stressplot of a non-metric multidimensional scaling solution, (2) a ggplot of the point configuration, and (3) the results of clustering the point configuration by plotting the point configuration and superimposing chulls of the clustering. , Your input$clust is undefined in:
df_cl <- reactive({
  km <- kmeans(x = pts(), centers = input$clust)
  cl <- km$cluster
  data.frame(pts(), clust = cl)
})
 numericInput('clust', 'Clusters', 2, min = 2, max = 15)

ARIMA forecast keep getting error 'data' must be of a vector type, was 'NULL'


Tag : r , By : brennen
Date : March 29 2020, 07:55 AM
it should still fix some issue I keep getting an error when fitting my ARIMA to the data, 'data' must be of a vector type, was 'NULL'.
library(forecast)
foo <- read.table(file="data.csv", header=T, sep=",")
data <- ts(foo$Car,start = c(1990,1),frequency = 1)

# Use 'forecast' to get predition from the model estimated by 'auto.arima'
ARIMAfit1 <- auto.arima(log10(data), approximation=T, trace=FALSE, allowdrift=F)
summary(ARIMAfit1)
forecast(ARIMAfit1, h = 3)

#      Point Forecast    Lo 80    Hi 80     Lo 95    Hi 95
# 2017       1.415713 1.165870 1.665556 1.0336109 1.797815
# 2018       1.415713 1.128307 1.703119 0.9761635 1.855262
# 2019       1.415713 1.095115 1.736310 0.9254014 1.906024


# The same model estimated using 'arima'
# Here you can use 'predict'
ARIMAfit2 <- arima(log10(data), order=c(0,1,1))
summary(ARIMAfit2)
predict(ARIMAfit2, n.ahead=3)

# $pred
# Time Series:
# Start = 2017 
# End = 2019 
# Frequency = 1 
# [1] 1.415713 1.415713 1.415713
# $se
# Time Series:
# Start = 2017 
# End = 2019 
# Frequency = 1 
# [1] 0.1911677 0.2199090 0.2453055

Error In array :'data' must be of a vector type, was 'NULL' in R


Tag : r , By : Pat
Date : March 29 2020, 07:55 AM
This might help you First off, you should always explicitly include any additional non-base-R packages that you have been using (here forecast). This ensures that code is reproducible.
As to your question, to predict forecast ARIMA models you need to use forecast instead of predict.
library(forecast)
fit <- auto.arima(salesdata1)

pred <- forecast(fit, h = 12)
pred
#   Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
#13           1300  1300  1300  1300  1300
#14           1400  1400  1400  1400  1400
#15           1500  1500  1500  1500  1500
#16           1600  1600  1600  1600  1600
#17           1700  1700  1700  1700  1700
#18           1800  1800  1800  1800  1800
#19           1900  1900  1900  1900  1900
#20           2000  2000  2000  2000  2000
#21           2100  2100  2100  2100  2100
#22           2200  2200  2200  2200  2200
#23           2300  2300  2300  2300  2300
#24           2400  2400  2400  2400  2400

plot(pred)

How can I create raster mosaic using list of rasters?


Tag : r , By : Steven Weber
Date : March 29 2020, 07:55 AM

R: Raster mosaic from list of rasters?


Tag : r , By : Matt Croydon
Date : March 29 2020, 07:55 AM
Related Posts Related QUESTIONS :
  • R, filtering for an element in a list in a dataframe cell
  • Extracting only bottom temperature from 4d NetCDF file
  • How to add/wrap lines of text to .tex with .sh script
  • R - building new variables from sequenced data
  • Sum rows values one after the other
  • Nesting ifelse inside summarytools
  • How best to divide different levels of a factor by one another in dataframe in R?
  • Why does my code run multiple times before I type data into the table? How do I make an action button that creates a tab
  • How to impute missing values not at random?
  • Set the y limits of an added average line of a plotly plot
  • how to calculate a new column after grouping with dplyr
  • Extract data from rows creating new columns using R
  • Create a filled area line plot with plotly
  • When do I need parentheses around an if statement to control the sequence of a formula in R?
  • my graph in ggplot2 contains an "e" character in y-axis
  • Making variables immutable in R
  • R: Difference between the subsequent ranks of a item group by date
  • Match data within multiple time-frames with dplyr
  • Conditional manipulation and extension of rows in data.table also considering previous extensions without for-loop
  • Conditional formula referring to preview row in DF not working
  • Set hoverinfo text in plotly scatterplot
  • Histogram of Sums from Categorical/Binary Data
  • Efficiently find set differences and generate random sample
  • Find closest points from data set B to point in data set A, using lat long in R
  • dplyr join on column A OR column B
  • Replace all string if row starts with (within a column)
  • Is there a possibility to combine position_stack and nudge_x in a stacked bar chart in ggplot2?
  • How can I extract bounding boxes in a row-wise manner using R?
  • How do I easily sum up values in different columns?
  • Reading numeric Date value from CSV file to data.frame in "R"
  • R programming: creating a stacked bar graph, with variable colors for each stacked bar
  • How to identify all columns that contain binary representation
  • Filter different groups by different factor levels
  • Saving .xlsx file to disc, form http post request
  • Add an "all" option under the filter that selects the number of rows displayed in a datatable
  • How to select second column of every xts in list
  • Generate a frequency dataframe out of an input dataframe
  • Why manual autocorrelation does not match acf() results?
  • Merge 3 dataframes which are different to each other
  • remove adjacent duplicates from string
  • How to change the position of stacked stacked bar chart in ggplot in R?
  • How to divide each of a range a variables by a second range of variables in R
  • Why do I need to assemble vector before scaling in Spark?
  • How to select individuals which appear in multiple groups?
  • How can I fill columns based on values in another column?
  • 32 bit R and 64 bit R: output differs
  • Remove a single backslash in paste0 output
  • ggplot2 different label for the first break
  • TSP in R, with given distances
  • How to find the given value from the range of values?
  • Solution on R group by issue _ multiple combination
  • Transform multiple columns with a function that uses different arguments per column
  • How can I parse a string with the format "1/16/2019 1:24:51" into a POSIXct or other date variable?
  • How to plot a box plot in R for outlier detection for a huge number of rows?
  • How to change column name according to another dataframe in R?
  • `sjPlot::tab_df()`--how to set the number of decimal places?
  • time average for specific time range in r
  • joining dataframes by closest time and another key in r
  • How to create nested for loop for a certain range
  • New category based on sequence of date ranges
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com