Error occurred in netCDF routine NF90_get_att NetCDF: Attribute not found - netcdf

I have downloaded the meteorological data in NetCDF format from two different sites. I need to merge two files to put in my ocean model. when running the model with the merged file I got the below error.
Error occurred in NetCDF routine NF90_get_att NetCDF: Attribute not found.
I think before merging I have to same the attributes of two NetCDF files. but I don't know how to do it. could you please tell me How can I fix this ?
Here is the link that I have shared the two files and the piece of the code. this code is a part of my ocean model that reads the meteorological file.
https://drive.google.com/open?id=1GB4VbweJvZrKLkK8rUxBXz1gjVcj_n3N
Any help would be appreciated.

Firstly, you are reading relative humidity into a variable that seems to be for dew point temperature. This seems to be fundamentally wrong, so please check.
It appears that your code is looking for variable attributes scale_factor and add_offset in all variables. But your rhum variable is stored as percent with no scaling. You could try adding scale_factor=1.0 and add_offset=0 to rhum. To do this, look at the documentation for ncatted.
Alternatively, modify the fortran code so that scaling is not used for this variable.

Related

R Social Network Analysis/Data Manipulation Question: Reading in .edges, .circles, .egofeat, .feat, and .featnames files

So I'm working with a network dataset from Stanford's SNAP Datasets and "SNAP" has wrappers for Python and C++ but not R - however, the data is still usable since I believe it's a mix of CSV files.
I can actually read in the .edges file and form an igraph object but want to read in the other files, get the attributes & add those attributes to the igraph object for analysis. I'm just confused on how to work with the .circles, .egofeat, .feat, and .featnames files since the documentation on the dataset is very scarce. Hoping someone has worked with the dataset in R or even another language and has any pointers to get started.
Thank you!

Is there a way to define a current quarter in R?

I have written a small program in R, and when I get to this following line:
i=which(grepl(yyyy.q, Metrop$year))+1
I get the following error message:
Error in grepl(yyyy.q, Metrop$year) : object 'yyyy.q' not found
I think maybe this is occurring because I haven't defined 2019.3 as the current "yyyy.q". And that is what I need to do in order to tell R to start forecasting according to my model. Does that seem like the likely problem? I thought that was the problem but have struggled to fix it.
Here is how I am defining things in the beginning of my program before I get to the actual model specification, I assume the full code isn't necessary, but happy to share if that helps.
Metrop<-Houston
name<-"National"
Metrop<-Metrop[Metrop$year>=1989.4,]
Screenshot of dataset
Thanks for you help. Happy to share any more code or data if necessary.

How to use DWD R package in order to remove biases and merge two microarray datasets

I am trying to find a way to use distance weighted discrimination method (DWD) to remove biases from multiple microarray datasets.
My starting point is this. The problem is that Matlab version runs only under Windows, needs excel 5 format as input (where data appears to be truncated at line 65535 - matlab error is:
Error reading record for cells starting at column 65535. Try saving as Excel 98.
). Java version runs only with caBIG support, which, if I understood, has been shut down recently.
So I searched a lot and I find R/DWD package but from example I could not get how to provide the two datasets to merge to kdwd function.
Does anybody know how to use it?
Thanks
Try this, it has a DWD implementation
http://www.bioconductor.org/packages/release/bioc/html/inSilicoMerging.html

R Raster writeRaster doesn't overwrite

Identifying a potential bug here. When calling writeRaster overwrite=TRUE, the new raster values remain unchanged. I originally wrote the wrong raster object, then corrected the code, and wrote a new raster to the same file name. The values in the attribute table of the written file are the same as the original, even though the raster object I am writing has the correct attributes when viewed in R.
Workaround was to give the new raster a different name (or manually delete the old).
R 3.0.0, Windows 7 64-b
Apologies to Brian, with whom I share our modeling workstation. This was my post.
Josh O'Brien- Looks like you were right, there was something locking the write-protection. I think ArcCatalog was locking it up.
This tool has performed as expected many times since this incident.
I found the same issue.
I confirm that if you have ArcMap open, the R function overwrite=TRUE doesn't work.
By the way, without any warning message.
Hope this help other R-user in managing raster files.

Matrix in R - phytools subscript out of bounds

I wanted to build a matrix representation parsimony with R. I found this phylogenetic package and I've decided to give it a try, although I'm a newbie in R.
subset of the trees can be found here
When I use the example I'm able to generate a test tree perfectly. However when I use my file, I'm getting this error:
Error in XX[rownames(X[[i]]), c(j:((j - 1) + ncol(X[[i]])))] <- X[[i]]
[1:nrow(X[[i]]), : subscript out of bounds
Another thing that I'm imaging is not working like it should is species. Because if I print species I will get an empty "" and two NA.
(...)
if(i==1) species<-phy[[i]]$tip.label
EDIT
I've tried with others newick files and have the same and different errors. Although the function says:
This function reads a file which contains one or several trees in
parenthetic format known as the Newick or New Hampshire format.
It doesn't seem to be able to read these files. Any idea?
Is anybody willing to help to understand what should I do to avoid this error?
Thank you!
How did I solve the problem?
I've tried with different newick files and all of them gave me an error.
Since it worked with the example provided by the author, after one suggestion I've decided to write those test trees into a file, realized that the trees didn't have any distances, after removing the distances from the file, the code provided by Liam worked!

Resources