Confirmatory Factor Analysis with R lavaan I tried to do a CFA with the lavaan package in R.
Here is my model:

I know how to define my latent variables like this:
MASTER.model <- ' Usability  =~ PUS1 + PUS2 + PUS3 + PUS4 + PUS5 
                   PerceivedUsefulness =~ PU1 + PU2 + PU3 + PU4 + PU5
                   PerceivedEaseOfUse   =~ PEOU1 + PEOU2 + PEOU3 + PEOU4 + PEOU5
                   BehavioralIntent =~ BI1 + BI2

But I don't know how to define the links between Usability, EOU, etc.
Is this a covariance, written with e.g. Usability~~PerceivedEaseOfUse or do I write it like this: PerceivedEaseOfUse~Usability which means PerceivedEaseOfUse is regressed from Usability?
My try was:
MASTER.model <- ' Usability  =~ PUS1 + PUS2 + PUS3 + PUS4 + PUS5 
                PerceivedUsefulness =~ PU1 + PU2 + PU3 + PU4 + PU5
                   PerceivedEaseOfUse   =~ PEOU1 + PEOU2 + PEOU3 + PEOU4 + PEOU5
                   BehavioralIntent =~ BI1 + BI2
                   PerceivedUsefulness ~ PerceivedEaseOfUse
                   BehavioralIntent ~ PerceivedEaseOfUse
                   BehavioralIntent ~ PerceivedUsefulness
                    Usability ~~ Usability
                    PerceivedEaseOfUse ~~ PerceivedEaseOfUse
                    PerceivedUsefulness ~~ PerceivedUsefulness                 
                    PerceivedEaseOfUse ~ Usability'

This gave me proper results, but my RMSEA was really poor, which would mean my model doesn't fit my data. I just want to be sure it is not wrong because of me using R in a wrong way.
Thank you.
 A: Deciding how to set the parameters for your model (regression vs. covariance) is really a theoretical question. It should be based on your understanding of the relationships among the variables, using past research and literature reviews to inform your hypotheses.
That said, the way you have it set up right now you are regressing your latent variables on other latent variables, essentially saying that behavioral intent is predicted by perceived ease of use, usefulness, etc. Predicting endogenous latent variables from exogenous latent variables is actually a structural equation model, and you may benefit from reading about and using the lavaan sem function instead of the cfa function. See a tutorial on SEM in lavaan.
If you are not sure about the latent structure of your data I would suggest starting off with an exploratory factor analysis (EFA). See examples at statmethods.net.
It is possible that your latent factors have a lot of overlap and shouldn't really be considered different factors. Or the observed variables may not be loading onto their "proper" factor, both of which would hurt model fit. An EFA would help you determine that.
After you've done that, I would run a number of CFAs, gradually increasing the complexity in a stepwise fashion. First, have all your indicators load on the same latent factor, a unidimensional model. Then have them load on two orthogonal factors by including orthogonal=T. Example below:
fit.HS.ortho <- cfa(HS.model, 
                    data = HolzingerSwineford1939, 
                    orthogonal = TRUE)

Then have them load on two correlated factors (usability ~~ intention). Work your way up until you have four correlated factors. Then compare model fit using anova(fit1, fit2, fit3,etc.).
Once you know what the latent structure of your model is, then you can start specifying structural equation models that hypothesize causal relationships between your factors like the syntax you included above.
A: Based on your model in the picture, what follows is how I would specify the model in lavaan. To be clear, I am not making any claims as to how you should specify your model based on substantial theory of the constructs involved. I am just interpreting the model as pictured. I leave it to you to determine if the model is correctly specified. Assuming it is, I think the following code would reflect the picture not including the actual use node, which I left out because you left it out of your coded model. I do not think you need to specify the covariance of usability explicitly.
MASTER.model <- '
  # measurement model
  Usability  =~ PUS1 + PUS2 + PUS3 + PUS4 + PUS5 
  PerceivedUsefulness =~ PU1 + PU2 + PU3 + PU4 + PU5
  PerceivedEaseOfUse   =~ PEOU1 + PEOU2 + PEOU3 + PEOU4 + PEOU5
  BehavioralIntent =~ BI1 + BI2

  # structural model
  BehavioralIntent ~ PerceivedUsefulness + PerceivedEaseOfUse + Usability
  PerceivedUsefulness ~ PerceivedEaseOfUse + Usability
  PerceivedEaseOfUse ~ Usability

'
As explained by user3511655, this is a structural equation model and therefore you should use the lavaan function sem to obtain the model fit.
